mftsccs-browser 2.2.38-beta → 2.2.39-beta

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
1
  /*! For license information please see serviceWorker.bundle.js.LICENSE.txt */
2
- var e={2:(e,t,n)=>{n.d(t,{s:()=>d});var o=n(8286),i=n(9581),r=n(1412),s=n(3518),c=n(1863),a=n(8562),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=a.Logger.logfunction("GetAllConnectionsOfComposition",t);var i=[];if(0==(i=yield o.d.GetConnectionsOfConcept(e)).length)i=yield u(e);else{var s=yield u(e);(0,r.e)(s,i),i=s}return a.Logger.logUpdate(n),i})}function u(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=a.Logger.logfunction("GetAllConnectionsOfCompositionOnline",t);var r=[];try{const t=new FormData;t.append("composition_id",e.toString());const d=yield(0,s.Xr)("","application/json"),u=yield fetch(i.B.GetAllConnectionsOfCompositionUrl(),{method:"POST",headers:d,body:t});if(console.log("this is getting connection from online",i.B.GetAllConnectionsOfCompositionUrl(),e),!u.ok)throw(0,c.ry)(u),new Error(`Error! status: ${u.status}`);const h=yield u.json();for(var l=0;l<h.length;l++)o.d.AddConnection(h[l]),r.push(h[l]);return a.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connection of composition error : ",e.message):console.log("Get all connection of composition error : ",e),(0,c.Mb)(e,i.B.GetAllConnectionsOfCompositionUrl()),(0,c.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}})}},38:e=>{class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},71:(e,t)=>{t.__esModule=!0,t.word=t.tilde=t.tab=t.str=t.space=t.slash=t.singleQuote=t.semicolon=t.plus=t.pipe=t.openSquare=t.openParenthesis=t.newline=t.greaterThan=t.feed=t.equals=t.doubleQuote=t.dollar=t.cr=t.comment=t.comma=t.combinator=t.colon=t.closeSquare=t.closeParenthesis=t.caret=t.bang=t.backslash=t.at=t.asterisk=t.ampersand=void 0,t.ampersand=38,t.asterisk=42,t.at=64,t.comma=44,t.colon=58,t.semicolon=59,t.openParenthesis=40,t.closeParenthesis=41,t.openSquare=91,t.closeSquare=93,t.dollar=36,t.tilde=126,t.caret=94,t.plus=43,t.equals=61,t.pipe=124,t.greaterThan=62,t.space=32,t.singleQuote=39,t.doubleQuote=34,t.slash=47,t.bang=33,t.backslash=92,t.cr=13,t.feed=12,t.newline=10,t.tab=9,t.str=39,t.comment=-1,t.word=-2,t.combinator=-3},145:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s},176:(e,t,n)=>{n.d(t,{F4:()=>s,P6:()=>a,dp:()=>c});var o=n(2155),i=n(7282),r=n(6416);function s(e){var t,n;const o=(0,r.u)();return o.id=e.id,o.ghostId=e.ghostId,o.userId=e.userId,o.accessId=e.accessId,o.categoryId=e.categoryId,o.characterValue=e.characterValue,o.entryTimeStamp=e.entryTimeStamp,o.typeId=e.typeId,o.type=e.type,o.isTemp=!1,o.typeCharacter=null!==(n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"",o}function c(e){const t=(0,i.o)();return t.id=e.id,t.ghostId=e.ghostId,t.userId=e.userId,t.accessId=e.accessId,t.entryTimeStamp=e.entryTimeStamp,t.typeId=e.typeId,t.categoryId=e.categoryId,t}function a(e){const t=new o.N(0,0,0,0,0,0,0);return t.id=e.id,t.ghostId=e.ghostId,t.accessId=e.accessId,t.ofTheConceptId=e.ofTheConceptId,t.toTheConceptId=e.toTheConceptId,t.entryTimeStamp=e.entryTimeStamp,t.typeId=e.typeId,t.isTemp=!1,t}},197:()=>{},205:(e,t,n)=>{n.d(t,{B:()=>o});class o{}o.isTypeLoaded=!1,o.isCharacterLoaded=!1,o.isDataLoaded=!1,o.isLocalDataLoaded=!1,o.isLocalCharacterLoaded=!1,o.isLocalTypeLoaded=!1,o.isConnectionLoaded=!1,o.isConnectionTypeLoaded=!1,o.isLocalConnectionLoaded=!1},263:(e,t)=>{t.__esModule=!0,t.default=function(e){return e.sort(function(e,t){return e-t})},e.exports=t.default},276:(e,t,n)=>{n.d(t,{y:()=>o});class o{constructor(){this.conceptId=0,this.connectionTypeId=0,this.connectionType="",this.count=0}}},339:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.SELECTOR,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},396:(e,t,n)=>{let o=n(7793);class i extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=i,i.default=i,o.registerAtRule(i)},425:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.COMMENT,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},442:(e,t,n)=>{n.d(t,{Y:()=>u});var o=n(1167),i=n(2155),r=n(9581),s=n(3518),c=n(1863),a=n(3026),l=n(8286),d=n(8562);class u{static CheckContains(e){for(var t=!1,n=0;n<this.conceptsSyncArray.length;n++)this.conceptsSyncArray[n].id==e.id&&(t=!0);return t}static SyncDataDelete(e){for(var t=0;t<this.conceptsSyncArray.length;t++)e==this.conceptsSyncArray[t].id&&this.conceptsSyncArray.splice(t,1);for(t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].ofTheConceptId!=e&&this.connectionSyncArray[t].toTheConceptId!=e&&this.connectionSyncArray[t].typeId!=e||this.connectionSyncArray.splice(t,1)}static CheckContainsConnection(e){for(var t=!1,n=0;n<this.connectionSyncArray.length;n++)this.connectionSyncArray[n].id==e.id&&(t=!0);return t}static AddConcept(e){this.conceptsSyncArray.push(e)}static RemoveConcept(e){for(var t=0;t<this.conceptsSyncArray.length;t++)this.conceptsSyncArray[t].id==e.id&&this.conceptsSyncArray.splice(t,1)}static AddConnection(e){this.connectionSyncArray.push(e)}static RemoveConnection(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e.id&&this.connectionSyncArray.splice(t,1)}static SyncDataOnline(){return e=this,t=void 0,u=function*(){if(d.serviceWorker)try{return(yield(0,d.sendMessage)("SyncData__SyncDataOnline",{})).data}catch(e){console.error("SyncData__SyncDataOnline sw error: ",e),(0,d.handleServiceWorkerException)(e)}for(let e=0;e<this.conceptsSyncArray.length;e++)a.I.AddConcept(this.conceptsSyncArray[e]);for(let e=0;e<this.connectionSyncArray.length;e++)l.d.AddConnection(this.connectionSyncArray[e]);if(this.conceptsSyncArray.length>0){let e=this.conceptsSyncArray.slice();this.conceptsSyncArray=[],(0,o.Y)(e)}if(this.connectionSyncArray.length>0){let e=this.connectionSyncArray.slice();this.connectionSyncArray=[],yield function(e){return t=this,n=void 0,a=function*(){let t=new i.N(0,0,0,0,0,0,0);try{var n=(0,s.Xr)(),o=JSON.stringify(e);const i=yield fetch(r.B.CreateTheConnectionUrl(),{method:"POST",headers:n,body:o});return i.ok?yield i.json():(console.log("Create the connection error message: ",i.status),(0,c.ry)(i)),t}catch(e){throw e instanceof Error?console.log("Create the connection error message: ",e.message):console.log(" Create the connection unexpected error: ",e),e}},new((o=void 0)||(o=Promise))(function(e,i){function r(e){try{c(a.next(e))}catch(e){i(e)}}function s(e){try{c(a.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(r,s)}c((a=a.apply(t,n||[])).next())});var t,n,o,a}(e)}return"done"},new((n=void 0)||(n=Promise))(function(o,i){function r(e){try{c(u.next(e))}catch(e){i(e)}}function s(e){try{c(u.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,s)}c((u=u.apply(e,t||[])).next())});var e,t,n,u}}u.conceptsSyncArray=[],u.connectionSyncArray=[]},490:(e,t,n)=>{function o(){var e,t,n,o;let i={entity:0,userConcept:0,userId:0,token:""};try{let r=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";if(r){const s=JSON.parse(r);i.entity=null!==(e=null==s?void 0:s.entityId)&&void 0!==e?e:0,i.userConcept=null!==(t=null==s?void 0:s.userConcept)&&void 0!==t?t:0,i.userId=null!==(n=null==s?void 0:s.userId)&&void 0!==n?n:0,i.token=null!==(o=null==s?void 0:s.token)&&void 0!==o?o:""}}catch(e){console.log("This is the exception in getting user details from local storage")}return i}n.d(t,{s:()=>o})},518:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.ROOT,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n);var i,a,l=o.prototype;return l.toString=function(){var e=this.reduce(function(e,t){return e.push(String(t)),e},[]).join(",");return this.trailingComma?e+",":e},l.error=function(e,t){return this._error?this._error(e,t):new Error(e)},i=o,(a=[{key:"errorGenerator",set:function(e){this._error=e}}])&&s(i.prototype,a),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=a,e.exports=t.default},628:(e,t,n)=>{n.d(t,{H:()=>v});var o=n(9581),i=n(3278),r=n(8562),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const a=(e,t,...n)=>c(void 0,[e,t,...n],void 0,function*(e,t,n=!0){let r={concepts:[],connections:[]};try{const c=new Headers;let a={concepts:e,connections:t};c.set("Content-Type","application/json"),c.set("Authorization","Bearer "+i.b.BearerAccessToken),c.set("Accept","application/json"),c.set("X-Session-Id",i.b.sessionId.toString()),c.set("Randomizer",o.B.getRandomizer().toString());const l=yield fetch(o.B.CreateGhostConceptApiUrl(n),{method:"POST",headers:c,body:JSON.stringify(a)});if(!l.ok)throw(0,s.ry)(l),new Error(`Error! status: ${l.status}`);const d=yield l.json();return r.concepts=d.concepts,r.connections=d.connections,r}catch(e){throw e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),e}});function l(e,t){const n=[];for(let o=0;o<e.length;o+=t){const i=e.slice(o,o+t);n.push(i)}return n}const d=(...e)=>c(void 0,[...e],void 0,function*(e=[]){return yield Promise.all(e.map(e=>{let t=JSON.parse(JSON.stringify(e));return delete t.type,delete t.ofConcept,delete t.toConcept,t}))});var u=n(9003),h=n(9736),p=n(4864),f=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class v{static CheckContains(e){for(var t=!1,n=0;n<this.conceptsSyncArray.length;n++)this.conceptsSyncArray[n].id==e.id&&(t=!0);return t}static SyncDataDelete(e){for(var t=0;t<this.conceptsSyncArray.length;t++)e==this.conceptsSyncArray[t].id&&this.conceptsSyncArray.splice(t,1);for(t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].ofTheConceptId!=e&&this.connectionSyncArray[t].toTheConceptId!=e&&this.connectionSyncArray[t].typeId!=e||this.connectionSyncArray.splice(t,1)}static CheckContainsConnection(e){for(var t=!1,n=0;n<this.connectionSyncArray.length;n++)this.connectionSyncArray[n].id==e.id&&(t=!0);return t}static AddConcept(e){try{let t=!1;0!=v.CheckIfTheConceptIdExists(e.id,this.conceptsSyncArray).id&&(t=!0),t||this.conceptsSyncArray.push(e)}catch(e){throw e}}static RemoveConcept(e){for(var t=0;t<this.conceptsSyncArray.length;t++)this.conceptsSyncArray[t].id==e.id&&this.conceptsSyncArray.splice(t,1)}static SyncDataOnlineWithoutAuth(e,t){return f(this,arguments,void 0,function*(e,t,n=!1){return v.SyncDataOnline(e,t,n)})}static SyncDataOnline(e,t){return f(this,arguments,void 0,function*(e,t,n=!0){let o=performance.now();console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker,n),setTimeout(()=>{console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker,n)},5e3);try{if(r.serviceWorker)try{return console.log("syncing in the service worker",e,n),(yield(0,r.sendMessage)("LocalSyncData__SyncDataOnline",{transactionId:e,withAuth:n})).data}catch(e){console.error("LocalSyncData__SyncDataOnline sw error: ",e),(0,r.handleServiceWorkerException)(e)}console.log("syncing in the without service worker syncing",e,n);let o=[],i=[];if(e&&this.transactionCollections.some(t=>t.id==e)){const t=this.transactionCollections.find(t=>t.id==e);if(this.transactionCollections=this.transactionCollections.filter(t=>t.id!=e),this.transactionCollections=this.transactionCollections.filter(e=>new Date(e.createdDate).getTime()>(new Date).getTime()-6048e5),!t)return;o=t.data.concepts.slice(),i=t.data.connections.slice()}else Array.isArray(null==t?void 0:t.concepts)&&Array.isArray(null==t?void 0:t.connections)?(console.log("this is the concepts and connections array",null==t?void 0:t.concepts,null==t?void 0:t.connections),o=t.concepts.slice(),i=t.connections.slice(),console.log("this is the concepts and connections array",o,i),this.conceptsSyncArray=this.conceptsSyncArray.filter(e=>{const n=t.concepts.some(t=>e.id==t.id||e.ghostId==t.ghostId);return n||console.warn(`Concept not found in sync array: ${e.id||e.ghostId}`),n}),this.connectionSyncArray=this.connectionSyncArray.filter(e=>{const n=t.connections.some(t=>e.id==t.id||e.ghostId==t.ghostId);return n||console.warn(`Connection not found in sync array: ${e.id||e.ghostId}`),n})):(console.warn("Syncing this way has been Depreceted in service worker."),console.info("Only if serive worker is not running"),o=this.conceptsSyncArray.slice()||[],i=this.connectionSyncArray.slice()||[],this.connectionSyncArray=[],this.conceptsSyncArray=[]);console.log("syncing... inside the syncer",n);let u=[];for(let e=0;e<o.length;e++)u.push(o[e]),yield h.v.UpdateConceptSyncStatus(o[e].id);console.log("syncing... inside the syncer 2",n,o),yield this.UpdateConceptListToIncludeRelatedConcepts(i,u);let f=yield function(e,t){return c(this,arguments,void 0,function*(e,t,n=!0){const o=r.Logger.logfunction("CreateTheGhostConceptApi",[e.length,t.length]);try{const i=1e3;let s={concepts:[],connections:[]};const c=yield d(e),u=yield d(t);if(e.length+t.length<=2*i){const e=yield a(c,u,n);return Array.isArray(null==e?void 0:e.concepts)&&(s.concepts=[...s.concepts,...e.concepts]),Array.isArray(null==e?void 0:e.connections)&&(s.connections=[...s.connections,...e.connections]),r.Logger.logUpdate(o),s}const h=l(c,i),p=l(u,i),f=[],v=[];console.log("This is the with auth in syncing",n);for(let e=0;e<h.length;e++){const t=h[e];f.push(a(t,[],n))}const y=yield Promise.all(f);for(let e=0;e<y.length;e++){const t=y[e];Array.isArray(null==t?void 0:t.concepts)&&(s.concepts=[...s.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(s.connections=[...s.connections,...t.connections])}for(let e=0;e<p.length;e++){const t=p[e];v.push(a([],t,n))}const g=yield Promise.all(v);for(let e=0;e<g.length;e++){const t=g[e];Array.isArray(null==t?void 0:t.concepts)&&(s.concepts=[...s.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(s.connections=[...s.connections,...t.connections])}return r.Logger.logUpdate(o),s}catch(e){throw console.log(e),(0,s.ey)(o,"CreateTheGhostConceptApi",e),e}})}(u,i,n);console.log("syncing... inside the syncer 3",n);let v=f.concepts,y=f.connections;for(let e=0;e<v.length;e++)h.v.AddPermanentConcept(v[e]);for(let e=0;e<y.length;e++)p.G.AddPermanentConnection(y[e]);return o}catch(e){throw r.Logger.logError(o,"unknown",void 0,"unknown",void 0,500,e,"SyncDataOnline",[],"unknown",void 0),e}})}static ConvertGhostIdsInConnections(e){var t,n,o;for(let i=0;i<e.length;i++){let r=e[i].ofTheConceptId,s=e[i].toTheConceptId,c=e[i].typeId,a=null!==(t=v.ghostIdMap.get(r))&&void 0!==t?t:r,l=null!==(n=v.ghostIdMap.get(s))&&void 0!==n?n:s,d=null!==(o=v.ghostIdMap.get(c))&&void 0!==o?o:c;e[i].ofTheConceptId=a,e[i].toTheConceptId=l,e[i].typeId=d}}static UpdateConceptListToIncludeRelatedConcepts(e,t){return f(this,void 0,void 0,function*(){for(let n=0;n<e.length;n++){let o=e[n].ofTheConceptId,i=e[n].toTheConceptId,r=e[n].typeId;if(o<0){let i=this.CheckIfTheConceptIdExists(o,t);0==i.id&&(i=yield h.v.GetConceptByGhostId(o),0!=i.id?i.id!=i.ghostId&&(e[n].ofTheConceptId=i.id):(i=yield h.v.GetConcept(o),this.AddConceptIfDoesNotExist(i,t)))}if(i<0){let o=this.CheckIfTheConceptIdExists(i,t);0==o.id&&(o=yield h.v.GetConceptByGhostId(i),0!=o.id?o.id!=o.ghostId&&(e[n].toTheConceptId=o.id):(o=yield h.v.GetConcept(i),this.AddConceptIfDoesNotExist(o,t)))}if(r<0){let o=this.CheckIfTheConceptIdExists(r,t);0==o.id&&(o=yield h.v.GetConceptByGhostId(r),0!=o.id?o.id!=o.ghostId&&(e[n].typeId=o.id):(o=yield h.v.GetConcept(r),this.AddConceptIfDoesNotExist(o,t)))}}})}static AddConceptIfDoesNotExist(e,t=[]){let n=!1;for(let o=0;o<t.length;o++)e.ghostId==t[o].ghostId&&(n=!0);n||t.push(e)}static CheckIfTheConceptIdExists(e,t=[]){let n=(0,r.CreateDefaultLConcept)();for(let o=0;o<t.length;o++)e!=t[o].ghostId&&e!=t[o].id||(n=t[o]);return n}static AddConnection(e){this.connectionSyncArray.push(e)}static RemoveConnection(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e.id&&this.connectionSyncArray.splice(t,1)}static RemoveConnectionById(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e&&this.connectionSyncArray.splice(t,1)}static syncDataLocalDb(){return f(this,void 0,void 0,function*(){if(this.conceptsSyncArray.length>0){for(let e=0;e<this.conceptsSyncArray.length;e++)(0,u.kH)("localconcept",this.conceptsSyncArray[e]);this.conceptsSyncArray=[]}if(this.connectionSyncArray.length>0){for(let e=0;e<this.connectionSyncArray.length;e++)(0,u.kH)("localconnection",this.connectionSyncArray[e]);this.connectionSyncArray=[]}return"done"})}static initializeTransaction(e){return f(this,void 0,void 0,function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__initializeTransaction",{transactionId:e})).data}catch(e){console.error("LocalSyncData__initializeTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some(t=>t.id==e))return;this.transactionCollections.push({id:e,data:{concepts:[],connections:[]},createdDate:(new Date).toISOString()})}catch(e){console.log("error in initializeTransaction",e)}})}static markTransactionActions(e,t){return f(this,void 0,void 0,function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__markTransactionActions",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__markTransactionActions sw error: ",e),(0,r.handleServiceWorkerException)(e)}this.transactionCollections=this.transactionCollections.map(n=>n.id==e?Object.assign(Object.assign({},n),{data:JSON.parse(JSON.stringify(t))}):n),this.conceptsSyncArray=this.conceptsSyncArray.filter(e=>!t.concepts.some(t=>t.id==e.id||t.ghostId==e.id)),this.connectionSyncArray=this.connectionSyncArray.filter(e=>!t.connections.some(t=>t.id==e.id||t.ghostId==e.id))}catch(e){console.log("error in markTransactionActions",e)}})}static rollbackTransaction(e,t){return f(this,void 0,void 0,function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__rollbackTransaction",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__rollbackTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some(t=>t.id==e))return;this.transactionCollections=this.transactionCollections.filter(t=>t.id!=e)}catch(e){console.log("LocalSyncData, roll",e)}})}}v.conceptsSyncArray=[],v.connectionSyncArray=[],v.ghostIdMap=new Map,v.transactionCollections=[]},680:(e,t,n)=>{t.__esModule=!0;var o=n(1581);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||(t[e]=o[e]))});var i=n(4451);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||(t[e]=i[e]))});var r=n(8500);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||(t[e]=r[e]))})},843:(e,t,n)=>{n.d(t,{Az:()=>p,Hi:()=>f});var o=n(8146),i=n(3026),r=n(9581),s=n(3518),c=n(8562),a=n(1863),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function p(e){return h(this,void 0,void 0,function*(){const t=c.Logger.logfunction("GetConceptByCharacterAndCategory",e);let n=(0,c.CreateDefaultConcept)();if("the"==e)return n.id=1,n.typeId=5,n.characterValue="the",n;let u=(0,c.SplitStrings)(e);if(u.length>1){let t=1,o=yield p(u[0]);0!=o.id&&(t=o.id),n=yield function(e,t){var n=arguments;return h(this,void 0,void 0,function*(){const o=c.Logger.logfunction("GetConceptByCharacterAndCategoryFromMemory",n);let u=yield c.ConceptsData.GetConceptByCharacterAndCategoryLocal(e,t);return 0==u.id&&(u=yield function(e,t){var n=arguments;return d(this,void 0,void 0,function*(){const o=c.Logger.logfunction("GetConceptByCharacterAndCategoryDirectApi",n);let d=(0,c.CreateDefaultConcept)();try{var u=(0,s.Xr)("application/x-www-form-urlencoded");const n=yield fetch(r.B.GetConceptByCharacterAndCategoryDirectUrl(),{method:"POST",headers:u,body:`character_value=${e}&category_id=${t}`});if(n.ok){let e=yield n.json();d=e,(0,l.K)(d).then(()=>{i.I.AddConcept(d)})}else console.log("This is the concept by category and character error",n.status),(0,a.ry)(n);c.Logger.logUpdate(o)}catch(e){e instanceof Error?console.log(" This is the concept by category and character error message: ",e.message):console.log(" This is the concept by category and character unexpected error: ",e),(0,a.Mb)(e,r.B.GetConceptByCharacterAndCategoryDirectUrl()),(0,a.ey)(o,"GetConceptByCharacterAndCategoryDirectApi",e)}return d})}(e,t)),c.Logger.logUpdate(o),u})}(e,t)}else u[0]==e&&(n=yield function(e){var t=arguments;return h(this,void 0,void 0,function*(){const n=c.Logger.logfunction("GetConceptByCharacter",t);let i=yield c.ConceptsData.GetConceptByCharacterAndTypeLocal(e,51);return 0==i.id&&(i=yield(0,o.Y)(e)),c.Logger.logUpdate(n),i})}(e));return c.Logger.logUpdate(t),n})}function f(e){return h(this,void 0,void 0,function*(){let t=[];try{t=yield function(e){return u(this,void 0,void 0,function*(){let t=[];try{let n=JSON.stringify(e),o=(0,s.Xr)();const i=yield fetch(c.BaseUrl.GetTypeConceptBulk(),{method:"POST",headers:o,body:n});if(i.ok){let e=yield i.json();t=yield(0,c.GetConceptBulk)(e)}else console.log("This is the GetTypeConceptByBulk error",i.status),(0,a.ry)(i)}catch(e){e instanceof Error?console.log(" This is the GetTypeConceptByBulk error message: ",e.message):console.log(" This is the GetTypeConceptByBulk unexpected error: ",e),(0,a.Mb)(e,c.BaseUrl.GetConceptByCharacterAndCategoryDirectUrl())}return t})}(e)}catch(e){console.log(" This is the GetTypeConceptsByCharacterAndCategoryBulk error message: ",e)}return t})}},991:(e,t,n)=>{n.d(t,{H:()=>c});var o=n(8562),i=n(3996);class r extends i.i{constructor(e,t,n,o){super(e,t,n,o),this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(this.getBalanceFactor(t.leftNode)>=0)return this.rightRotate(t);if(this.getBalanceFactor(t.leftNode)<0)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(this.getBalanceFactor(t.rightNode)<=0)return this.leftRotate(t);if(this.getBalanceFactor(t.rightNode)>0)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}}var s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class c{static CreateCompositionKey(e,t){return e}static GetConnectionByOfTheConceptAndTypeId(e,t){let n=this.CreateCompositionKey(e,t);if(this.node){let e=this.node.getFromNode(n,this.node);if(e)return e.value}return null}static addConnection(e){if(e.id>0){let t=this.CreateCompositionKey(e.ofTheConceptId,e.typeId);if(this.node){let n=this.node.getFromNode(t,this.node);if(n){let t=null==n?void 0:n.value;0==t.length&&(n.value=[]),t.includes(e.id)||t.push(e.id)}else{let n=[];n.push(e.id);let o=new r(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new r(t,n,null,null);this.addNodeToTree(o)}new Event(`${t}`)}else console.log("cannot insert key id with n 0 to the connection tree",e)}static addNodeToTree(e){return s(this,void 0,void 0,function*(){return null==this.node?(this.node=e,console.log("this is type dispatch in connection",e),(0,o.dispatchIdEvent)(e.key),this.node):(this.node=this.node.addNode(e,this.node,this.node.height),this.node)})}static removeNodeFromTree(e){return s(this,void 0,void 0,function*(){this.node&&(this.node=this.node.removeNode(this.node,e))})}}c.node=null},999:(e,t,n)=>{n.d(t,{R:()=>l});var o=n(8562),i=n(1863),r=n(6416),s=n(4711),c=n(5868),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e){return a(this,arguments,void 0,function*(e,t=null,n=null,a=null,d=null,u=null,h=null,p=!1,f={concepts:[],connections:[]}){var v,y,g,m;const C=o.Logger.logfunction("CreateTheCompositionLocal")||{};if(o.serviceWorker){C.serviceWorker=!0;try{const i=yield(0,o.sendMessage)("CreateTheCompositionLocal",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:a,userId:d,accessId:u,sessionInformationId:h,actions:f});return(null===(y=null===(v=null==i?void 0:i.actions)||void 0===v?void 0:v.concepts)||void 0===y?void 0:y.length)&&(f.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(m=null===(g=null==i?void 0:i.actions)||void 0===g?void 0:g.connections)||void 0===m?void 0:m.length)&&(f.connections=JSON.parse(JSON.stringify(i.actions.connections))),o.Logger.logUpdate(C),i.data}catch(e){console.error("CreateTheCompositionLocal error sw: ",e),(0,i.ey)(C,"CreateTheCompositionLocal",e),(0,o.handleServiceWorkerException)(e)}}let w=null!=d?d:999,I=null!=u?u:999,T=null!=h?h:999,k=null!=a?a:0,A=(0,r.u)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=k,n=yield(0,c.k)(o,"",!0,w,I,T,void 0,f);A=n,t=n.id,k=n.id,yield l(e[o],n.id,n.userId,t,d,u,h,void 0,f)}else{let n=null!=t?t:999,i=k,r=yield(0,c.k)(o,"",!0,w,I,T,void 0,f);yield(0,s.F)(n,r.id,i,void 0,void 0,void 0,f),yield l(e[o],r.id,r.userId,i,d,u,h,void 0,f)}else{let n=null!=t?t:999,i=k,r=yield(0,c.k)(o,e[o].toString(),!1,w,I,T,void 0,f);yield(0,s.F)(n,r.id,i,void 0,void 0,void 0,f)}return o.Logger.logUpdate(C),A})}},1106:(e,t,n)=>{let{nanoid:o}=n(5042),{isAbsolute:i,resolve:r}=n(197),{SourceMapConsumer:s,SourceMapGenerator:c}=n(1866),{fileURLToPath:a,pathToFileURL:l}=n(2739),d=n(3614),u=n(3878),h=n(9746),p=Symbol("lineToIndexCache"),f=Boolean(s&&c),v=Boolean(r&&i);function y(e){if(e[p])return e[p];let t=e.css.split("\n"),n=new Array(t.length),o=0;for(let e=0,i=t.length;e<i;e++)n[e]=o,o+=t[e].length+1;return e[p]=n,n}class g{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!v||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=r(t.from)),v&&f){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let i,r,s,c,a;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){c=e.offset;let o=this.fromOffset(c);t=o.line,n=o.col}else t=e.line,n=e.column,c=this.fromLineAndColumn(t,n);if("number"==typeof o.offset){s=o.offset;let e=this.fromOffset(s);r=e.line,i=e.col}else r=o.line,i=o.column,s=this.fromLineAndColumn(o.line,o.column)}else if(n)c=this.fromLineAndColumn(t,n);else{c=t;let e=this.fromOffset(c);t=e.line,n=e.col}let u=this.origin(t,n,r,i);return a=u?new d(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,o.plugin):new d(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,o.plugin),a.input={column:n,endColumn:i,endLine:r,endOffset:s,line:t,offset:c,source:this.css},this.file&&(l&&(a.input.url=l(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return y(this)[e-1]+t-1}fromOffset(e){let t=y(this),n=0;if(e>=t[t.length-1])n=t.length-1;else{let o,i=t.length-2;for(;n<i;)if(o=n+(i-n>>1),e<t[o])i=o-1;else{if(!(e>=t[o+1])){n=o;break}n=o+1}}return{col:e-t[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let r,s,c=this.map.consumer(),d=c.originalPositionFor({column:t,line:e});if(!d.source)return!1;"number"==typeof n&&(r=c.originalPositionFor({column:o,line:n})),s=i(d.source)?l(d.source):new URL(d.source,this.map.consumer().sourceRoot||l(this.map.mapFile));let u={column:d.column,endColumn:r&&r.column,endLine:r&&r.line,line:d.line,url:s.toString()};if("file:"===s.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");u.file=a(s)}let h=c.sourceContentFor(d.source);return h&&(u.source=h),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}e.exports=g,g.default=g,h&&h.registerInput&&h.registerInput(g)},1167:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(9581),i=n(3518),r=n(8562),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){return c(this,void 0,void 0,function*(){const t=r.Logger.logfunction("CreateTheConceptApi",e);let n=(0,r.CreateDefaultConcept)();try{var c=(0,i.Xr)();const a=yield fetch(o.B.CreateTheConceptUrl(),{method:"POST",headers:c,body:JSON.stringify(e)});if(!a.ok)throw(0,s.ry)(a),new Error(`Error! status: ${a.status}`);return n=yield a.json(),r.Logger.logUpdate(t),n}catch(e){e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),(0,s.Mb)(e,o.B.CreateTheConceptUrl()),(0,s.ey)(t,"CreateTheConceptApi",e)}})}},1213:(e,t,n)=>{n.d(t,{f:()=>a});var o=n(9736),i=n(7820),r=n(8562),s=n(176),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){return c(this,void 0,void 0,function*(){let t=performance.now();try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConceptLocal",{id:e})).data}catch(e){console.error("GetTheConceptLocal error sw: ",e),(0,r.handleServiceWorkerException)(e)}let t=(0,r.CreateDefaultLConcept)();if(e<0){if(t=yield o.v.GetConcept(e),0==t.id){let n=yield i.G.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}}}else{let n=yield(0,r.GetTheConcept)(e);t=(0,s.F4)(n)}return t}catch(n){throw r.Logger.logError(t,"unknown","read","unknown",void 0,200,void 0,"GetTheConceptLocal",[e],"unknown",void 0),n}})}},1218:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(8562),i=n(7282),r=n(1666),s=n(8407),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){return c(this,arguments,void 0,function*(e,t=null,n=null,c=null,l=null,d=null,u=null){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("CreateTheComposition",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:c,userId:l,accessId:d,sessionInformationId:u})).data}catch(e){console.error("CreateTheComposition sw error: ",e),(0,o.handleServiceWorkerException)(e)}let h=null!=l?l:999,p=null!=d?d:4,f=null!=u?u:999,v=null!=c?c:0,y=(0,i.o)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=v,n=yield(0,s.A)(o,"",!0,h,p,f);y=n,t=n.id,v=n.id,yield a(e[o],n.id,n.userId,t,l,d,u)}else{let i=null!=t?t:999,c=null!=n?n:999,g=v,m=yield(0,s.A)(o,"",!0,h,p,f);y=m,yield(0,r.q)(i,c,m.id,g),yield a(e[o],m.id,m.userId,g,l,d,u)}else{let i=null!=t?t:999,c=null!=n?n:10267,a=v,l=yield(0,s.A)(o,e[o].toString(),!1,h,p,f);yield(0,r.q)(i,c,l.id,a)}return y})}},1239:(e,t,n)=>{n.d(t,{I:()=>u,r:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(8562),a=n(1596),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){return l(this,void 0,void 0,function*(){const t=c.Logger.logfunction("GetConceptBulk",[e.length])||{};let n=[],d=((new Date).getTime(),performance.now()),u=Array.from(new Set(e));try{if(c.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("GetConceptBulk",{passedConcepts:e});return c.Logger.logUpdate(t),n.data}catch(e){console.error("GetConceptBulk sw error: ",e),(0,s.ey)(t,"GetConceptBulk",e),(0,c.handleServiceWorkerException)(e)}}if(u.length>0){let h=[];for(let e=0;e<u.length;e++)if(!o.I.GetNpc(u[e])){let t=yield o.I.GetConcept(u[e]);0==t.id?h.push(u[e]):n.push(t)}if(0==h.length)return c.Logger.logfunction(t),n;{let u;const p={method:"POST",headers:(0,r.Xr)("application/json"),body:JSON.stringify(h)};try{u=yield fetch(i.B.GetConceptBulkUrl(),p)}catch(e){u=yield(0,a.g)(p,"/api/get_concept_bulk")}yield function(e,t,n,i,r){return l(this,void 0,void 0,function*(){if(e.ok){let t=yield e.json();if(t.length>0)for(let e=0;e<t.length;e++){let i=t[e];o.I.AddConcept(i),n.push(i)}c.Logger.logUpdate(i)}else console.log("Get Concept Bulk error",e.status),c.Logger.logError(r,"unknown","read","unknown",void 0,e.status,e,"GetConceptBulk",[t],"unknown",void 0),(0,s.ry)(e)})}(u,e,n,t,d)}}}catch(n){n instanceof Error?console.log("Get Concept Bulk error message: ",n.message):console.log("Get Concept Bulk unexpected error: ",n),c.Logger.logError(d,"unknown","read","unknown",void 0,500,n,"GetConceptBulk",[e],"unknown",void 0),(0,s.Mb)(n,i.B.GetConceptBulkUrl()),(0,s.ey)(t,"GetConceptBulk",n)}return n})}function u(e){return l(this,void 0,void 0,function*(){const t=[];if(e.length>0){const n=(0,r.Xr)("application/json");try{const r=yield fetch(i.B.GetConceptBulkUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(r.ok){const e=yield r.json();if(e.length>0)for(let n=0;n<e.length;n++){const i=e[n];t.push(i),o.I.AddConcept(i)}}else console.log("bulk concept getter api error: ",r.status),(0,s.ry)(r)}catch(e){e instanceof Error?console.log("bulk concept getter api error: ",e.message):console.log("bulk concept getter api error: ",e),(0,s.Mb)(e,i.B.GetConceptBulkUrl())}}return t})}},1320:(e,t,n)=>{n.d(t,{zl:()=>g,b6:()=>w,e$:()=>T,y6:()=>I,rq:()=>k,yV:()=>m,_W:()=>C});var o=n(8562),i=n(6687);function r(e){return e.startsWith("the_")?e.slice(4):e}var s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e,t,n){return s(this,void 0,void 0,function*(){var i,r,s,c,a,l,d,u;let h=[];for(let t=0;t<e.length;t++)h.push(e[t].toTheConceptId),h.push(e[t].ofTheConceptId),h.push(e[t].typeId);for(let h=0;h<e.length;h++){let p=!1;n.includes(e[h].id)&&(p=!0);let f=yield(0,o.GetTheConcept)(e[h].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[h].toTheConceptId);if(1==p&&0!=f.id&&0!=v.id){let n,a=null!==(r=null===(i=v.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self";e[h].toTheConceptId in t?n=t[e[h].toTheConceptId]:(n={},n[a]={},t[e[h].toTheConceptId]=n);let l=yield(0,o.GetTheConcept)(e[h].typeId);try{let e=null!==(c=null===(s=null==f?void 0:f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",n=f.characterValue;l.characterValue,l.characterValue.includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[v.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=v.id){let n,i=null!==(l=null===(a=f.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[h].ofTheConceptId in t?n=t[e[h].ofTheConceptId]:(n={},n[i]={},t[e[h].ofTheConceptId]=n);let r=yield(0,o.GetTheConcept)(e[h].typeId);try{let e=null!==(u=null===(d=null==v?void 0:v.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",n=v.characterValue;r.characterValue.includes("_s_")&&(v.id in t||(t[v.id]={}),t[v.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}return t})}var a=n(5312),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function u(e,t,n){if(e in t){let o=t[e];o&&(n[o.connectionType+"_count"]=o.count)}}var h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},p=n(4698),f=n(6915),v=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},y=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function g(e,t){return y(this,arguments,void 0,function*(e,t,n=""){let r=yield(0,o.SearchWithTypeAndLinkerApi)(e,t,n),s=r.compositionIds,c=r.internalConnections,l=r.linkers,d=r.reverse,u=r.mainCompositionIds,h=yield(0,i.QL)(l),p=yield(0,i.MT)(s,c);return yield(0,a.NK)(h,p,u,d)})}function m(e,t,n,o,r){return y(this,void 0,void 0,function*(){let s=yield(0,i.QL)(e),c=yield(0,i.rv)(t,n);return yield(0,a.Ve)(s,c,t,o,r)})}function C(e,t,n,o,r){return y(this,void 0,void 0,function*(){let s=yield(0,i.QL)(e),c=yield(0,i.D)(t,n);return yield(0,a.NK)(s,c,o,r)})}function w(e,t,n,a,l){return y(this,void 0,void 0,function*(){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnections",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:a,countInfos:l})).data}catch(e){console.error("formatConnections error sw: ",e),(0,o.handleServiceWorkerException)(e)}let d=yield(0,i.QL)(e);d=(0,f.X)(d);let u=[];u=yield c(d,u,a),u=yield function(e,t,n){return s(this,void 0,void 0,function*(){var i,s,c,a,l,d,u,h;let p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let p=0;p<e.length;p++){let f=!1;n.includes(e[p].id)&&(f=!0);let v=yield(0,o.GetTheConcept)(e[p].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[p].toTheConceptId);if(1==f&&0!=v.id&&0!=y.id){let n,l=null!==(s=null===(i=y.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],l in n||(n[l]={})):(n={},n[l]={},t[e[p].toTheConceptId]=n);let d=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(a=null===(c=null==v?void 0:v.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",t=v.characterValue,o=d.characterValue;""==o&&(o=e,o=r(o));let i={[e]:t},s=o+"_reverse";d.characterValue.includes("_s_")||("string"==typeof n[l]&&(n[l]={}),n[l][s]=i)}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id){let n,i=null!==(d=null===(l=v.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);let s=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(h=null===(u=null==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",t=y.characterValue,o=s.characterValue,c=(s.characterValue,!1);""==o&&(o=e,o=r(o),c=!0);let a={[e]:t};isNaN(Number(o))?s.characterValue.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][o]=c?t:a):(Array.isArray(n[i])||(n[i]=[]),n[i].push(t))}catch(e){console.log("this is error",e)}}}return t})}(d,u,a);let h=yield function(e,t,n,i){return s(this,arguments,void 0,function*(e,t,n,i,r=[]){var s,c,a,l,d,u;let h=[],p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;r.includes(e[n].id)&&(i=!0);let h=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),p=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(1==i&&0!=h.id&&0!=p.id&&p.id in t){let i,r=null!==(c=null===(s=p.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[r]={},t[e[n].toTheConceptId]=i);let a=yield(0,o.GetTheConcept)(e[n].typeId);try{let o=a.characterValue+"_reverse",s=t[e[n].ofTheConceptId];s&&(Array.isArray(i[r][o])?i[r][o].push(s):a.characterValue.includes("_s_")?(i[r][o]=[],i[r][o].push(s)):i[r][o]=s)}catch(e){console.log("this is error",e)}}if(0!=h.id&&0!=p.id&&h.id in t){let i,r=null!==(l=null===(a=h.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[r]&&(i[r]={})):(i={},i[r]={},t[e[n].ofTheConceptId]=i);let s=!1,c=(yield(0,o.GetTheConcept)(e[n].typeId)).characterValue;""==c&&(c=p.characterValue,s=!0),""==c&&(c=null!==(u=null===(d=null==p?void 0:p.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"");try{let o=t[e[n].toTheConceptId];o&&(Array.isArray(i[r])?s?i[r].push(o[c]):i[r].push(o):Array.isArray(i[r][c])?i[r][c].push(o):c.includes("_s_")?(i[r][c]=[],s?i[r][c].push(o[c]):i[r][c].push(o)):i[r][c]=s?o[c]:o)}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i=t[n[e]];i?(i.id=n[e],h.push(i)):0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e],h.push(i))}return h})}(d,u,n,[],a);return h})}function I(e,t,n,s,a){return y(this,arguments,void 0,function*(e,t,n,s,a,h="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsJustId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:a,order:h})).data}catch(e){console.error("formatConnectionsJustId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let v=yield(0,i.QL)(e),y=yield(0,p.V)(a);v=(0,f.X)(v,h);let g=[];g=yield c(v,g,s),g=yield function(e,t){return d(this,arguments,void 0,function*(e,t,n=[]){var o,i,s,c,a,d,u,h;let p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);for(let p=0;p<e.length;p++){let f=!1,v=yield(0,l.A)(e[p].ofTheConceptId),y=yield(0,l.A)(e[p].toTheConceptId);if(n.includes(e[p].id)&&(f=!0),1==f&&0!=v.id&&0!=y.id){let n,a=yield(0,l.A)(e[p].typeId),d=null!==(i=null===(o=y.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],d in n||(n[d]={})):(n={},n[d]={},t[e[p].toTheConceptId]=n);try{let t=null!==(c=null===(s=null==v?void 0:v.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",o=v.characterValue,i=a.characterValue;""==i&&(i=t,i=r(i));let l={id:v.id,[t]:o,created_on:e[p].entryTimeStamp},u=i+"_reverse";u.includes("_s_")||("string"==typeof n[d]&&(n[d]={}),n[d][u]=l)}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id){let n,o=yield(0,l.A)(e[p].typeId),i=null!==(d=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);try{let t=null!==(h=null===(u=null==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",s=y.characterValue,c=o.characterValue,a=!1;""==c&&(c=t,c=r(c),a=!0);let l={};l[t]={id:y.id,data:s,created_on:e[p].entryTimeStamp},isNaN(Number(c))?c.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][c]=a?l[t]:l):(Array.isArray(n[i])||(n[i]=[]),n[i].push(l[t]))}catch(e){console.log("this is error",e)}}}return t})}(v,g,s);let m=yield function(e,t,n){return d(this,arguments,void 0,function*(e,t,n,i=[],r){var s,c,a,d,h,p,f;(new Date).getTime();let v=[],y=[];for(let t=0;t<e.length;t++)y.push(e[t].toTheConceptId),y.push(e[t].ofTheConceptId),y.push(e[t].typeId);for(let n=0;n<e.length;n++){let o=!1,v=yield(0,l.A)(e[n].ofTheConceptId),y=yield(0,l.A)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(o=!0),1==o&&0!=v.id&&0!=y.id&&y.id in t){let o,i=yield(0,l.A)(e[n].typeId),r=null!==(c=null===(s=y.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",a=!1;e[n].toTheConceptId in t&&(a=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[r]&&(o[r]={})):(o={},o[r]={},t[e[n].toTheConceptId]=o);try{if(t[e[n].ofTheConceptId]){let s=t[e[n].ofTheConceptId];s&&(s.id=v.id,s.created_on=v.entryTimeStamp);let c=i.characterValue+"_reverse";Array.isArray(o[r][c])?o[r][c].push(s):c.includes("_s_")?(o[r][c]=[],o[r][c].push(s)):o[r][c]=s}}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id&&v.id in t){let o,i=yield(0,l.A)(e[n].typeId),s=null!==(d=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self",c=!1;e[n].toTheConceptId in t&&(c=!0),e[n].ofTheConceptId in t?(o=t[e[n].ofTheConceptId],"string"==typeof o[s]&&(o[s]={})):(o={},o[s]={},t[e[n].ofTheConceptId]=o),u(v.id,r,o);let g=!1,m=i.characterValue;""==m&&(m=y.characterValue,g=!0),""==m&&(m=(null===(h=null==y?void 0:y.type)||void 0===h?void 0:h.characterValue)||"");try{let i=null!==(f=null===(p=null==y?void 0:y.type)||void 0===p?void 0:p.characterValue)&&void 0!==f?f:"none",c=t[e[n].toTheConceptId];if(c){let t={};t[i]={data:c[i],id:y.id,created_on:e[n].entryTimeStamp},Array.isArray(o[s])?g?o[s].push(c[m]):o[s].push(c):Array.isArray(o[s][m])?o[s][m].push(t):m.includes("_s_")?(o[s][m]=[],g?o[s][m].push(t[i]):o[s][m].push(t)):o[s][m]=g?t[i]:t,u(y.id,r,t)}}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i={};i=t[n[e]],i?i.id=n[e]:0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e]),v.push(i)}return v})}(v,g,n,s,y);return m})}function T(e,t,n,s,c){return y(this,arguments,void 0,function*(e,t,n,s,c,a="DESC"){try{if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsDataId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:c,order:a})).data}catch(e){console.error("formatConnectionsDataId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l,d;try{l=yield(0,i.QL)(e)}catch(e){throw console.error("Error in GetConnectionDataPrefetch:",e),new Error(`Failed to prefetch connections: ${e instanceof Error?e.message:String(e)}`)}try{d=yield(0,p.V)(c)}catch(e){throw console.error("Error in GetConnectionTypeForCount:",e),new Error(`Failed to get connection type for count: ${e instanceof Error?e.message:String(e)}`)}try{l=(0,f.X)(l,a)}catch(e){throw console.error("Error in orderTheConnections:",e),new Error(`Failed to order connections: ${e instanceof Error?e.message:String(e)}`)}let v,y=[],g=[];try{y=yield function(e,t){var n=arguments;return h(this,arguments,void 0,function*(e,t,i=[]){var r,s,c,a,l,d,u,h;try{const p=o.Logger.logfunction("FormatFunctionData",n);let f=[];for(let t=0;t<e.length;t++)f.push(e[t].toTheConceptId),f.push(e[t].ofTheConceptId),f.push(e[t].typeId);for(let n=0;n<e.length;n++)try{let p=!1,f=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(p=!0),1==p&&0!=f.id&&0!=v.id){let i,l=yield(0,o.GetTheConcept)(e[n].typeId),d=null!==(s=null===(r=v.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[d]={},t[e[n].toTheConceptId]=i);try{let e=null!==(a=null===(c=null==f?void 0:f.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",n=f.characterValue;(l.characterValue+"_reverse").includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[v.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=v.id){let i,r=yield(0,o.GetTheConcept)(e[n].typeId),s=null!==(d=null===(l=f.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[n].ofTheConceptId in t?i=t[e[n].ofTheConceptId]:(i={},i[s]={},t[e[n].ofTheConceptId]=i);try{let e=null!==(h=null===(u=null==v?void 0:v.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",n=v.characterValue;r.characterValue.includes("_s_")&&(v.id in t||(t[v.id]={}),t[v.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}catch(e){console.log("Error processing connection at index",n,e)}return o.Logger.logUpdate(p),t}catch(e){throw console.log("Error in FormatFunctionData",e),e}})}(l,y,s)}catch(e){throw console.error("Error in FormatFunctionData:",e),new Error(`Failed to format function data: ${e instanceof Error?e.message:String(e)}`)}try{y=yield function(e){var t=arguments;return h(this,arguments,void 0,function*(e,n=[],i=[]){var s,c,a,l,d,u,h,p;try{const f=o.Logger.logfunction("FormatFunctionDataForData",t);let v=[];for(let t=0;t<e.length;t++)v.push(e[t].toTheConceptId),v.push(e[t].ofTheConceptId),v.push(e[t].typeId);for(let t=0;t<e.length;t++)try{let f=!1,v=yield(0,o.GetTheConcept)(e[t].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[t].toTheConceptId);if(i.includes(e[t].id)&&(f=!0),1==f&&0!=v.id&&0!=y.id){let i,d=yield(0,o.GetTheConcept)(e[t].typeId),u=null!==(c=null===(s=y.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self";e[t].toTheConceptId in n?(i=n[e[t].toTheConceptId],u in i||(i[u]={})):(i={},i[u]={},n[e[t].toTheConceptId]=i);try{let e=null!==(l=null===(a=null==v?void 0:v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",t=v.characterValue,n=d.characterValue;""==n&&(n=e,n=r(n));let o={id:v.id,data:{[e]:t}},s=n+"_reverse";s.includes("_s_")||("string"==typeof i[u]&&(i[u]={}),i[u][s]=o)}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id){let i,s=yield(0,o.GetTheConcept)(e[t].typeId),c=null!==(u=null===(d=v.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"self";e[t].ofTheConceptId in n?(i=n[e[t].ofTheConceptId],c in i||(i[c]={})):(i={},i[c]={},n[e[t].ofTheConceptId]=i);try{let e=null!==(p=null===(h=null==y?void 0:y.type)||void 0===h?void 0:h.characterValue)&&void 0!==p?p:"none",t=y.characterValue,n=s.characterValue,o=!1;""==n&&(n=e,n=r(n),o=!0);let a={id:y.id,data:{[e]:t}};isNaN(Number(n))?n.includes("_s_")||("string"==typeof i[c]&&(i[c]={}),i[c][n]=a):(Array.isArray(i[c])||(i[c]=[]),i[c].push(a))}catch(e){console.log("this is error",e)}}}catch(e){console.log("Error processing connection at index",t,e)}return o.Logger.logUpdate(f),n}catch(e){throw console.log("Error in FormatFunctionDataForData",e),e}})}(l,y,s)}catch(e){throw console.error("Error in FormatFunctionDataForData:",e),new Error(`Failed to format function data for data: ${e instanceof Error?e.message:String(e)}`)}try{v=yield function(e,t,n,i){var r=arguments;return h(this,arguments,void 0,function*(e,t,n,i,s=[],c){var a,l,d,h,p,f;try{const n=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",r);let v=[],y=[];for(let t=0;t<e.length;t++)y.push(e[t].toTheConceptId),y.push(e[t].ofTheConceptId),y.push(e[t].typeId);for(let n=0;n<e.length;n++)try{let i=!1,r=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(s.includes(e[n].id)&&(i=!0),1==i&&0!=r.id&&0!=v.id&&v.id in t){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),d=null!==(l=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self",h=!1;e[n].toTheConceptId in t&&(h=!0),e[n].toTheConceptId in t?(i=t[e[n].toTheConceptId],"string"==typeof i[d]&&(i[d]={})):(i={},i[d]={},t[e[n].toTheConceptId]=i),u(v.id,c,i);try{if(t[e[n].ofTheConceptId]){let o={id:r.id,data:t[e[n].ofTheConceptId],created_on:e[n].entryTimeStamp},c=s.characterValue+"_reverse";Array.isArray(i[d][c])?i[d][c].push(o):c.includes("_s_")?(i[d][c]=[],i[d][c].push(o)):i[d][c]=o}}catch(e){console.log("this is error",e)}}if(0!=r.id&&0!=v.id&&r.id in t){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),a=null!==(h=null===(d=r.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"self",l=!1;e[n].toTheConceptId in t&&(l=!0),e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[a]&&(i[a]={})):(i={},i[a]={},t[e[n].ofTheConceptId]=i),u(r.id,c,i);let y=!0,g=s.characterValue;""==g&&(g=v.characterValue,y=!0),""==g&&(g=(null===(p=null==v?void 0:v.type)||void 0===p?void 0:p.characterValue)||"");try{null===(f=null==v?void 0:v.type)||void 0===f||f.characterValue;let o=t[e[n].toTheConceptId];if(o){let r={id:v.id,data:t[e[n].toTheConceptId],created_on:e[n].entryTimeStamp};Array.isArray(i[a])?i[a].push(o):Array.isArray(i[a][g])?i[a][s.characterValue].push(r):g.includes("_s_")?(i[a][g]=[],i[a][g].push(r)):i[a][g]=r,u(v.id,c,r)}}catch(e){console.log("this is error",e)}}}catch(e){console.log("Error processing connection at index",n,e)}for(let e=0;e<i.length;e++)try{let n={};n.id=i[e];let r=yield(0,o.GetTheConcept)(n.id);n.data=t[i[e]],n.created_on=r.entryTimeStamp,v.push(n)}catch(t){console.log("Error processing main composition at index",e,t)}return o.Logger.logUpdate(n),v}catch(e){throw console.log("Error in FormatFromConnectionsAlteredArrayExternal",e),e}})}(l,y,g,n,s,d)}catch(e){throw console.error("Error in FormatFromConnectionsAlteredArrayExternal:",e),new Error(`Failed to format from connections altered array external: ${e instanceof Error?e.message:String(e)}`)}return v}catch(e){throw console.error("Error in formatConnectionsDataId:",e),e}})}function k(e,t,n,s,c){return y(this,arguments,void 0,function*(e,t,n,s,c,a="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsV2",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:c,order:a})).data}catch(e){console.error("formatConnectionsV2 error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l=yield(0,i.QL)(e),d=yield(0,p.V)(c);l=(0,f.X)(l,a);let h={};h=yield function(e){var t=arguments;return v(this,arguments,void 0,function*(e,n={},i=[]){var r,s,c,a,l;const d=o.Logger.logfunction("FormatFunctionDataV2",t);for(const t of e){const e=i.includes(t.id),d=yield(0,o.GetTheConcept)(t.ofTheConceptId),u=yield(0,o.GetTheConcept)(t.toTheConceptId),h=yield(0,o.GetTheConcept)(t.typeId);if(0===d.id||0===u.id)continue;const p=e?u:d,f=e?d:u,v=null!==(s=null===(r=p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self",y=null!==(a=null===(c=f.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",g=f.characterValue;null===(l=h.characterValue)||void 0===l||l.includes("_s_"),n[p.id]||(n[p.id]={}),n[p.id][v]||(n[p.id][v]={}),n[f.id]||(n[f.id]={}),n[f.id][y]=g}return o.Logger.logUpdate(d),n})}(l,h,s),h=yield function(e){var t=arguments;return v(this,arguments,void 0,function*(e,n={},i=[]){var s,c,a,l,d;const u=o.Logger.logfunction("FormatFunctionDataForDataV2",t);for(const t of e){const e=i.includes(t.id),u=yield(0,o.GetTheConcept)(t.ofTheConceptId),h=yield(0,o.GetTheConcept)(t.toTheConceptId),p=yield(0,o.GetTheConcept)(t.typeId);if(0===u.id||0===h.id)continue;const f=e?h:u,v=e?u:h,y=null!==(c=null===(s=f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",g=null!==(l=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",m=v.characterValue,C=null!==(d=p.characterValue)&&void 0!==d?d:"";let w=""===C?r(g):C;const I=w.includes("_s_"),T=!isNaN(Number(w)),k={id:v.id,data:{[g]:m}};n[f.id]||(n[f.id]={}),y in n[f.id]&&"string"!=typeof n[f.id][y]||(n[f.id][y]=T?[]:{});try{if(I)continue;T?n[f.id][y].push(k):n[f.id][y][e?`${w}_reverse`:w]=k}catch(e){console.error("Error formatting concept data:",e)}}return o.Logger.logUpdate(u),n})}(l,h,s);let y=yield function(e,t,n){var i=arguments;return v(this,arguments,void 0,function*(e,t,n,r=[],s){var c,a,l;const d=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",i),h=[];for(const n of e){const e=r.includes(n.id),i=yield(0,o.GetTheConcept)(n.ofTheConceptId),d=yield(0,o.GetTheConcept)(n.toTheConceptId),h=yield(0,o.GetTheConcept)(n.typeId);if(0===i.id||0===d.id)continue;const p=e?d:i,f=e?i:d,v=p.id,y=f.id,g=null!==(a=null===(c=p.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"self",m=h.characterValue+"_reverse",C=h.characterValue||f.characterValue||(null===(l=f.type)||void 0===l?void 0:l.characterValue)||"";if(t[v]){const o=t[v][g],i=t[y],r={id:f.id,data:i,created_on:n.entryTimeStamp};u(v,s,t[v]);try{e?Array.isArray(o[m])?o[m].push(r):o[m]=[r]:Array.isArray(o)?o.push(i):Array.isArray(o[C])?o[C].push(r):C.includes("_s_")?(o[C]=[],o[C].push(r)):o[C]=[r],u(y,s,r)}catch(e){console.error("Error processing connection:",e)}}else console.log("This is the error in the source")}for(const e of n){const n=yield(0,o.GetTheConcept)(e);h.push({id:e,data:t[e],created_on:n.entryTimeStamp})}return o.Logger.logUpdate(d),h})}(l,h,n,s,d);return y})}},1412:(e,t,n)=>{function o(e=[],t=[]){}n.d(t,{e:()=>o})},1534:(e,t,n)=>{let o=n(7793),i=n(1752);class r extends o{get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=r,r.default=r,o.registerRule(r)},1557:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();e[i]||(e[i]={}),e=e[i]}},e.exports=t.default},1581:(e,t)=>{t.__esModule=!0,t.UNIVERSAL=t.TAG=t.STRING=t.SELECTOR=t.ROOT=t.PSEUDO=t.NESTING=t.ID=t.COMMENT=t.COMBINATOR=t.CLASS=t.ATTRIBUTE=void 0,t.TAG="tag",t.STRING="string",t.SELECTOR="selector",t.ROOT="root",t.PSEUDO="pseudo",t.NESTING="nesting",t.ID="id",t.COMMENT="comment",t.COMBINATOR="combinator",t.CLASS="class",t.ATTRIBUTE="attribute",t.UNIVERSAL="universal"},1596:(e,t,n)=>{n.d(t,{g:()=>s});var o=n(8562),i=n(3278),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(e,t){return r(this,void 0,void 0,function*(){if("undefined"!=typeof self&&"undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope)throw new Error("Cannot switch server from service worker");try{!function(){const e=o.BaseUrl.NODE_CACHE_URL;let t=o.BaseUrl.BASE_APPLICATION+"_cacheServers";if(e===o.BaseUrl.BASE_URL)throw new Error("Base Server Down");let n=sessionStorage.getItem(t);n=JSON.parse(n);const r=n.indexOf(e);if(o.BaseUrl.isNearestCache=!1,n.includes(e)&&-1!==r&&n.splice(r,1),sessionStorage.setItem(t,JSON.stringify(n)),n.length){const e=n[0];o.BaseUrl.NODE_CACHE_URL=e}else o.BaseUrl.NODE_CACHE_URL=o.BaseUrl.BASE_URL;console.log("before the payload",i.b.sessionId),navigator.serviceWorker&&navigator.serviceWorker.controller&&(0,o.sendMessage)("SESSION_DATA",{type:"SESSION_DATA",data:o.BaseUrl.NODE_CACHE_URL,session:i.b.sessionId})}();try{return yield fetch(`${o.BaseUrl.NODE_CACHE_URL}${t}`,e)}catch(n){return yield s(e,t)}}catch(e){throw e}})}},1666:(e,t,n)=>{n.d(t,{q:()=>s});var o=n(2155),i=n(442),r=n(1863);function s(e,t,n,s){var c=t,a=new o.N(0,e,n,c,s,1,4);if(e==n)return a.ofTheConceptId=0,a.toTheConceptId=1,a;try{a.isTemp=!0,a.id=Math.floor(1e8*Math.random()),i.Y.AddConnection(a)}catch(e){(0,r.Mb)(e)}return a}},1669:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3295))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.UNIVERSAL,n.value="*",n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},1704:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.COMBINATOR,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},1735:(e,t,n)=>{n.d(t,{J:()=>c});var o,i=n(8562),r=n(3278),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class c{static incrementConcept(e){try{e&&(this.conceptsData[e]=(this.conceptsData[e]||0)+1)}catch(e){console.error("Failed on increment concept")}}static incrementConnection(e){try{e&&(this.connectionsData[e]=(this.connectionsData[e]||0)+1)}catch(e){console.error("Failed on increment connection")}}static getTopConcepts(e){return Object.entries(this.conceptsData).map(([e,t])=>[parseInt(e),t]).sort((e,t)=>t[1]-e[1]).slice(0,e)}static getTopConnections(e){return Object.entries(this.connectionsData).map(([e,t])=>[parseInt(e),t]).sort((e,t)=>t[1]-e[1]).slice(0,e)}static saveDataToLocalStorage(){const e={concepts:this.conceptsData,connections:this.connectionsData};null===localStorage||void 0===localStorage||localStorage.setItem(this.accessData,JSON.stringify(e))}static loadDataFromLocalStorage(){const e=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(this.accessData);if(e){const t=JSON.parse(e);this.conceptsData=t.concepts||{},this.connectionsData=t.connections||{}}}static sendToServer(){return s(this,void 0,void 0,function*(){try{yield this.syncToServer()}catch(e){console.error("Failed to process Access Tracker Sync with Server")}})}static syncToServer(){return s(this,void 0,void 0,function*(){try{if(!Object.keys(this.conceptsData).length&&!Object.keys(this.connectionsData).length)return;const e=r.b.BearerAccessToken;if(!e)return;const t=this.conceptsData&&Object.keys(this.conceptsData).length>0?this.conceptsData:{},n=this.connectionsData&&Object.keys(this.connectionsData).length>0?this.connectionsData:{},o=yield fetch(i.BaseUrl.PostPrefetchConceptConnections(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({concepts:t,connections:n})});if(!o.ok)throw new Error("Failed to sync data to the server.");yield o.json(),this.conceptsData={},this.connectionsData={},this.setNextSyncTime()}catch(e){console.error("Sync error:",e)}})}static setNextSyncTime(){this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS}static startAutoSync(){setInterval(()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&this.syncNow().catch(console.error)},6e4)}static syncNow(){return s(this,void 0,void 0,function*(){try{this.activateStatus?yield this.syncToServer():console.warn("Access Tracker inactive.")}catch(e){console.error("Error on sync access tracker")}})}static GetSuggestedConcepts(e){return s(this,void 0,void 0,function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConcepts());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load concepts: ${o.status} ${o.statusText}. Details: ${e}`)}const s=(yield o.json())||[];return yield this.addConceptToBinaryTree(s.data),s}catch(e){throw e instanceof Error?(console.error("Error fetching suggested concepts:",e.message),new Error("Unable to fetch suggested concepts. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested concepts."))}})}static GetSuggestedConnections(e){return s(this,void 0,void 0,function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConnections());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load connections: ${o.status} ${o.statusText}. Details: ${e}`)}const s=(yield o.json())||[];return yield this.addConnectionToBinaryTree(s.data),s}catch(e){throw e instanceof Error?(console.error("Error fetching suggested Connections:",e.message),new Error("Unable to fetch suggested connections. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested Connections."))}})}static addConceptToBinaryTree(e){return s(this,void 0,void 0,function*(){try{e.forEach(e=>{i.ConceptsData.AddConcept(e)})}catch(e){console.error("Error on adding Concepts Data into tree")}})}static addConnectionToBinaryTree(e){return s(this,void 0,void 0,function*(){try{e.forEach(e=>{i.ConnectionData.AddConnection(e)})}catch(e){console.error("Error on adding Connections Data into tree")}})}}o=c,c.conceptsData={},c.connectionsData={},c.SYNC_INTERVAL_MS=12e4,c.nextSyncTime=Date.now(),c.activateStatus=!1,c.accessData="Access Data",o.startAutoSync()},1752:e=>{let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let o=[],i="",r=!1,s=0,c=!1,a="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:c?n===a&&(c=!1):'"'===n||"'"===n?(c=!0,a=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(r=!0),r?(""!==i&&o.push(i.trim()),i="",r=!1):i+=n;return(n||""!==i)&&o.push(i.trim()),o}};e.exports=t,t.default=t},1863:(e,t,n)=>{n.d(t,{ER:()=>s,Mb:()=>c,ey:()=>a,ry:()=>r});var o=n(8562),i=n(7273);function r(e){if(o.Logger.log("ERROR",e.statusText,{code:e.status,data:e.statusText}),401==e.status||406==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}if(500==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}}function s(e,t={}){if(o.Logger.log("ERROR",t.statusText,{code:e.status,data:e.status}),401==e.status||406==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}if(500==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}}function c(e,t=""){if(o.Logger.log("ERROR",e.message,{code:e.status,data:e.stack}),e.status){let n=new i.z(e.message,!1,e.status,e.stack);throw n.setUrl(t),n}{let n=new i.z(e.message,!1,500,e.stack);throw n.setUrl(t),n}}function a(e,t,n){var o;try{if(!e)return void console.error(`Error in ${t}: logData is undefined`);const i=Date.now();e.startTime=null!==(o=e.startTime)&&void 0!==o?o:i,e.responseTime=i-e.startTime+" ms",e.level="ERROR",e.errorMessage=(null==n?void 0:n.message)||"Unknown error occurred",console.error(`Error in function ${t}:`,n)}catch(e){console.error("Failed to handle package function error:",e)}}},1866:()=>{},2013:(e,t,n)=>{n.d(t,{A:()=>a,w:()=>l});var o=n(8146),i=n(8562),r=n(3026),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){var t=arguments;return c(this,void 0,void 0,function*(){const n=i.Logger.logfunction("GetConceptByCharacter",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacter",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacter sw error: ",e),(0,s.ey)(n,"GetConceptByCharacter",e),(0,i.handleServiceWorkerException)(e)}}let c=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=c&&0!=(null==c?void 0:c.id)||!a||(yield(0,o.Y)(e),c=yield r.I.GetConceptByCharacterAndTypeLocal(e,51),0==c.id&&(c=yield r.I.GetConceptByCharacter(e))),i.Logger.logUpdate(n),c})}function l(e){var t=arguments;return c(this,void 0,void 0,function*(){const n=i.Logger.logfunction("GetConceptByCharacterUpdated",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacterUpdated",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacterUpdated error sw: ",e),(0,s.ey)(n,"GetConceptByCharacterUpdated",e),(0,i.handleServiceWorkerException)(e)}}let c=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=c&&0!=(null==c?void 0:c.id)||!a||(yield(0,o.Y)(e),c=yield r.I.GetConceptByCharacter(e)),i.Logger.logUpdate(n),c})}},2110:(e,t,n)=>{const{AtRule:o,Rule:i}=n(2895);let r=n(7149);function s(e,t){let n;try{r(e=>{n=e}).processSync(e)}catch(n){throw e.includes(":")?t?t.error("Missed semicolon"):n:t?t.error(n.message):n}return n.at(0)}function c(e,t){let n=!1;return e.each(e=>{if("nesting"===e.type){let o=t.clone({});"&"!==e.value?e.replaceWith(s(e.value.replace("&",o.toString()))):e.replaceWith(o),n=!0}else"nodes"in e&&e.nodes&&c(e,t)&&(n=!0)}),n}function a(e,t){let n=[];for(let o of e.selectors){let i=s(o,e);for(let e of t.selectors){if(!e)continue;let o=s(e,t);c(o,i)||(o.prepend(r.combinator({value:" "})),o.prepend(i.clone({}))),n.push(o.toString())}}return n}function l(e,t){if("comment"!==e.prev()?.type)return t.after(e),e;let n=e.prev();return e.parent.toString().match(/[*]\/ *\n.*{/)?t.after(e).after(n):t.after(e),e}function d(e,t,n,o=!0){return t.length?(n=function(e,t,n){let o=new i({nodes:[],selector:e});return o.append(t),n.after(o),o}(e,t,n),o&&(t=[]),[n,t]):[n,t]}function u(e,t=""){let n=e.concat(t),o={};for(let e of n)o[e.replace(/^@/,"")]=!0;return o}function h(e){let t=e[f];if(t){let n,i,r,s,c=e.nodes,a=-1,l=function(e){let t=[],n=e.parent;for(;n&&n instanceof o;)t.push(n),n=n.parent;return t}(e);if(l.forEach((e,o)=>{if(t(e.name))n=e,a=o,r=s;else{let t=s;s=e.clone({nodes:[]}),t&&s.append(t),i=i||s}}),n?r?(i.append(c),n.after(r)):n.after(c):e.after(c),e.next()&&n){let t;l.slice(0,a+1).forEach((n,o,i)=>{let r=t;t=n.clone({nodes:[]}),r&&t.append(r);let s=[],c=(i[o-1]||e).next();for(;c;)s.push(c),c=c.next();t.append(s)}),t&&(r||c[c.length-1]).after(t)}}else e.after(e.nodes);e.remove()}const p=Symbol("rootRuleMergeSel"),f=Symbol("rootRuleEscapes");const v=Symbol("hasRootRule");e.exports=(e={})=>{let t=u(["media","supports","layer","container","starting-style"],e.bubble),n=function(e){return function t(n,o,i,r=i){let s=[];if(o.each(c=>{"rule"===c.type&&i?r&&(c.selectors=a(n,c)):"atrule"===c.type&&c.nodes?e[c.name]?t(n,c,r):!1!==o[p]&&s.push(c):s.push(c)}),i&&s.length){let e=n.clone({nodes:[]});for(let t of s)e.append(t);o.prepend(e)}}}(t),o=u(["document","font-face","keyframes","-webkit-keyframes","-moz-keyframes"],e.unwrap),r=(e.rootRuleName||"at-root").replace(/^@/,""),s=e.preserveEmpty;return{Once(e){e.walkAtRules(r,t=>{(function(e){let{params:t}=e,{escapes:n,selector:o,type:r}=function(e){let t=(e=e.trim()).match(/^\((.*)\)$/);if(!t)return{selector:e,type:"basic"};let n=t[1].match(/^(with(?:out)?):(.+)$/);if(n){let e="with"===n[1],t=Object.fromEntries(n[2].trim().split(/\s+/).map(e=>[e,!0]));if(e&&t.all)return{type:"noop"};let o=e=>!!t[e];return t.all?o=()=>!0:e&&(o=e=>"all"!==e&&!t[e]),{escapes:o,type:"withrules"}}return{type:"unknown"}}(t);if("unknown"===r)throw e.error(`Unknown @${e.name} parameter ${JSON.stringify(t)}`);if("basic"===r&&o){let t=new i({nodes:e.nodes,selector:o});e.removeAll(),e.append(t)}e[f]=n,e[p]=n?!n("all"):"noop"===r})(t),e[v]=!0})},postcssPlugin:"postcss-nested",RootExit(e){e[v]&&(e.walkAtRules(r,h),e[v]=!1)},Rule(e){let i=!1,c=e,u=!1,h=[];e.each(s=>{switch(s.type){case"atrule":[c,h]=d(e.selector,h,c),s.name===r?(i=!0,n(e,s,!0,s[p]),c=l(s,c)):t[s.name]?(u=!0,i=!0,n(e,s,!0),c=l(s,c)):o[s.name]?(u=!0,i=!0,n(e,s,!1),c=l(s,c)):u&&h.push(s);break;case"decl":u&&h.push(s);break;case"rule":[c,h]=d(e.selector,h,c),u=!0,i=!0,s.selectors=a(e,s),c=l(s,c)}}),d(e.selector,h,c,!1),i&&!0!==s&&(e.raws.semicolon=!0,0===e.nodes.length&&e.remove())}}},e.exports.postcss=!0},2155:(e,t,n)=>{n.d(t,{N:()=>r});var o=n(7282),i=n(9581);class r{constructor(e=0,t,n,r,s,c,a){this.count=0,this.isTemp=!1,this.toUpdate=!1,this.applicationId=i.B.getRandomizer(),this.type=(0,o.o)(),this.ofConcept=(0,o.o)(),this.toConcept=(0,o.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.userId=r,this.typeId=s,this.ghostId=e,this.orderId=c,this.accessId=a,this.entryTimeStamp=(0,o.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date,this.typeCharacter=""}}},2202:(e,t,n)=>{n.d(t,{W:()=>a});var o=n(6963),i=n(6731),r=n(205),s=n(8562),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addConceptToTree(e){let t=new i.b(e.id,e,null,null),n=new i.b(e.characterValue,e,null,null);o.f.addNodeToTree(n),this.addNodeToTree(t)}static getNodeFromTree(e){return c(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return c(this,void 0,void 0,function*(){if(this.root){let t=new Event(`${e}`);console.log("this is the fired event after delete",t),(0,s.dispatchIdEvent)(e),this.root=this.root.removeNode(this.root,e)}})}static getConceptListFromIds(e,t,n){return c(this,void 0,void 0,function*(){this.root&&this.root.checkIfIdsInNode(this.root,e,t,n)})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}a.root=null},2212:(e,t,n)=>{n.d(t,{Ay:()=>l,N:()=>d});var o=n(1167),i=n(2615),r=n(5976),s=n(442),c=n(8562),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n,o,c,l,d){return a(this,void 0,void 0,function*(){let a=yield r.B.getId(),u=new Date,h=new Date,p=new i.j(a,t,o,n,c,e,l,!0,u,h,d);return p.isTemp=!1,s.Y.AddConcept(p),p})}function d(e,t,n,s,l,d,u){return a(this,void 0,void 0,function*(){let a=yield r.B.getId(),h=new Date,p=new Date,f=new i.j(a,t,s,n,l,e,d,!1,h,p,u);return c.ConceptsData.AddConcept(f),(0,o.Y)([f]),f})}},2289:(e,t,n)=>{n.d(t,{$S:()=>d,L0:()=>u,WC:()=>h});var o=n(8675),i=n(6058),r=n(8562),s=n(1863);n(3518);var c=n(843),a=n(4818),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e,t){var n=arguments;return l(this,void 0,void 0,function*(){const i=r.Logger.logfunction("DeleteConnectionByType",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByType",{id:e,linker:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByType sw error: ",e),(0,s.ey)(i,"DeleteConnectionByType",e),(0,r.handleServiceWorkerException)(e)}}let c=yield(0,o.l)(e);for(let e=0;e<c.length;e++)r.ConnectionData.AddConnection(c[e]);let a=yield r.ConnectionData.GetConnectionsOfConcept(e),l=yield(0,r.GetConceptByCharacter)(t),d=[];for(let e=0;e<a.length;e++)a[e].typeId==l.id&&d.push(a[e]);let u=!1;for(let e=0;e<d.length;e++)u=yield(0,r.DeleteConnectionById)(d[e].id);return r.Logger.logUpdate(i),u})}function u(e,t){var n=arguments;return l(this,void 0,void 0,function*(){const i=r.Logger.logfunction("DeleteConnectionByTypeBulk",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByTypeBulk",{id:e,linkers:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByTypeBulk sw error: ",e),(0,s.ey)(i,"DeleteConnectionByTypeBulk",e),(0,r.handleServiceWorkerException)(e)}}let l=yield(0,o.l)(e);for(let e=0;e<l.length;e++)r.ConnectionData.AddConnection(l[e]);let d=yield r.ConnectionData.GetConnectionsOfConcept(e),u=[];u=yield(0,c.Hi)(t);let h=[];console.log("this is all the connections for deleting taken",d,u,t);for(let e=0;e<d.length;e++)for(let t=0;t<u.length;t++)d[e].typeId==u[t].id&&h.push(d[e].id);return console.log("these are the to delete",h),r.Logger.logUpdate(i),yield(0,a.E)(h)})}function h(e,t){return l(this,arguments,void 0,function*(e,t,n=!1){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetAllTheConnectionsByTypeAndOfTheConcept",{id:e,linker:t,reverse:n})).data}catch(e){console.error("GetAllTheConnectionsByTypeAndOfTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let s=[];if(n){let n=yield(0,i.W)(e),o=yield(0,r.MakeTheTypeConceptApi)(t,999);for(let e=0;e<n.length;e++)n[e].typeId==o.id&&s.push(n[e])}else{let n=yield(0,o.l)(e);for(let e=0;e<n.length;e++)r.ConnectionData.AddConnection(n[e]);let i=yield r.ConnectionData.GetConnectionsOfConcept(e),c=yield(0,r.GetConceptByCharacter)(t);for(let e=0;e<i.length;e++)i[e].typeId==c.id&&s.push(i[e])}return s})}},2299:(e,t,n)=>{n.d(t,{B:()=>o});class o{constructor(e){this.id=1,this.isOnlineSync=!1,this.isOnlineSync=e}}},2515:(e,t,n)=>{n.d(t,{x:()=>o});class o{constructor(e,t,n,o){this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return e;var n=!1;for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}addNode(e,t,n){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}addCharacterNode(e,t,n){if(""!=e.value.characterValue){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addCharacterNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&""!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addCharacterNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}updateNodeSyncStatus(e,t,n){if(n){if(e==n.key){let e=n.value;return e.isSynced=t,n.value=e,n}return e<n.key?this.updateNodeSyncStatus(e,t,n.leftNode):e>n.key?this.updateNodeSyncStatus(e,t,n.rightNode):n}return n}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getFromNodeWithCharacterAndType(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.typeId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.typeId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndType(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndType(e,t,n.rightNode)}return null}return n}getFromNodeWithCharacterAndCategory(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.categoryId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.categoryId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.rightNode)}return null}return n}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var n=this.inOrderSuccessor(e.rightNode);return e.value=n.value,e.key=n.key,e.variants=n.variants,e.currentNode=n.currentNode,e.rightNode=this.removeNode(e.rightNode,n.key),e}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){var o=e.variants[0];if(o)return e.value=o.value,e.key=o.key,e.currentNode=o.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var i=this.inOrderSuccessor(e.rightNode);return e.value=i.value,e.key=i.key,e.variants=i.variants,e.currentNode=i.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,i.key,n),e}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}},2615:(e,t,n)=>{n.d(t,{j:()=>i});var o=n(8562);class i{constructor(e,t,n,i,r,s,c,a=!1,l,d,u){this.count=0,this.typeCharacter="",this.referent=null,this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=o.BaseUrl.getRandomizer(),this.x=0,this.y=0,this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=i,this.referentId=r,this.characterValue=`${s}`,this.accessId=c,this.typeCharacter=u,this.type=null,this.isNew=a,this.entryTimeStamp=l,this.updatedTimeStamp=d}getType(){console.log(this.typeId)}}},2648:(e,t,n)=>{t.__esModule=!0,t.FIELDS=void 0,t.default=function(e){var t,n,o,i,s,c,a,l,d,h,p,f,v=[],y=e.css.valueOf(),g=y.length,m=-1,C=1,w=0,I=0;function T(t,n){if(!e.safe)throw e.error("Unclosed "+t,C,w-m,w);l=(y+=n).length-1}for(;w<g;){switch((t=y.charCodeAt(w))===r.newline&&(m=w,C+=1),t){case r.space:case r.tab:case r.newline:case r.cr:case r.feed:l=w;do{l+=1,(t=y.charCodeAt(l))===r.newline&&(m=l,C+=1)}while(t===r.space||t===r.newline||t===r.tab||t===r.cr||t===r.feed);f=r.space,o=C,n=l-m-1,I=l;break;case r.plus:case r.greaterThan:case r.tilde:case r.pipe:l=w;do{l+=1,t=y.charCodeAt(l)}while(t===r.plus||t===r.greaterThan||t===r.tilde||t===r.pipe);f=r.combinator,o=C,n=w-m,I=l;break;case r.asterisk:case r.ampersand:case r.bang:case r.comma:case r.equals:case r.dollar:case r.caret:case r.openSquare:case r.closeSquare:case r.colon:case r.semicolon:case r.openParenthesis:case r.closeParenthesis:f=t,o=C,n=w-m,I=(l=w)+1;break;case r.singleQuote:case r.doubleQuote:p=t===r.singleQuote?"'":'"',l=w;do{for(i=!1,-1===(l=y.indexOf(p,l+1))&&T("quote",p),s=l;y.charCodeAt(s-1)===r.backslash;)s-=1,i=!i}while(i);f=r.str,o=C,n=w-m,I=l+1;break;default:t===r.slash&&y.charCodeAt(w+1)===r.asterisk?(0===(l=y.indexOf("*/",w+2)+1)&&T("comment","*/"),(c=(a=y.slice(w,l+1).split("\n")).length-1)>0?(d=C+c,h=l-a[c].length):(d=C,h=m),f=r.comment,C=d,o=d,n=l-h):t===r.slash?(f=t,o=C,n=w-m,I=(l=w)+1):(l=u(y,w),f=r.word,o=C,n=l-m),I=l+1}v.push([f,C,w-m,o,n,w,I]),h&&(m=h,h=null),w=I}return v};var o,i,r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(71));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}for(var c=((o={})[r.tab]=!0,o[r.newline]=!0,o[r.cr]=!0,o[r.feed]=!0,o),a=((i={})[r.space]=!0,i[r.tab]=!0,i[r.newline]=!0,i[r.cr]=!0,i[r.feed]=!0,i[r.ampersand]=!0,i[r.asterisk]=!0,i[r.bang]=!0,i[r.comma]=!0,i[r.colon]=!0,i[r.semicolon]=!0,i[r.openParenthesis]=!0,i[r.closeParenthesis]=!0,i[r.openSquare]=!0,i[r.closeSquare]=!0,i[r.singleQuote]=!0,i[r.doubleQuote]=!0,i[r.plus]=!0,i[r.pipe]=!0,i[r.tilde]=!0,i[r.greaterThan]=!0,i[r.equals]=!0,i[r.dollar]=!0,i[r.caret]=!0,i[r.slash]=!0,i),l={},d=0;d<22;d++)l["0123456789abcdefABCDEF".charCodeAt(d)]=!0;function u(e,t){var n,o=t;do{if(n=e.charCodeAt(o),a[n])return o-1;n===r.backslash?o=h(e,o)+1:o++}while(o<e.length);return o-1}function h(e,t){var n=t,o=e.charCodeAt(n+1);if(c[o]);else if(l[o]){var i=0;do{n++,i++,o=e.charCodeAt(n+1)}while(l[o]&&i<6);i<6&&o===r.space&&n++}else n++;return n}t.FIELDS={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6}},2739:()=>{},2803:(e,t,n)=>{n.d(t,{x:()=>l});var o=n(8286),i=n(9581),r=n(3518),s=n(1863),c=n(8562),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n){var l=arguments;return a(this,void 0,void 0,function*(){const a=c.Logger.logfunction("GetCompositionConnectionsBetweenTwoConcepts",l)||{};var d=[];try{if(c.serviceWorker){a.serviceWorker=!0;try{const o=yield(0,c.sendMessage)("GetCompositionConnectionsBetweenTwoConcepts",{ofConceptId:e,toConcept:t,mainKey:n});return c.Logger.logUpdate(a),o.data}catch(e){console.error("GetCompositionConnectionsBetweenTwoConcepts sw error: ",e),(0,s.ey)(a,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,c.handleServiceWorkerException)(e)}}var u=new FormData;u.append("ofConceptId",e.toString()),u.append("mainKey",n.toString()),u.append("toConceptId",t.toString());const l=yield(0,r.Xr)("","application/json"),p=yield fetch(i.B.GetCompositionConnectionBetweenTwoConceptsUrl(),{method:"POST",headers:l,body:u,redirect:"follow"});if(p.ok){const e=yield p.json();for(var h=0;h<e.length;h++)o.d.AddConnection(e[h]),d.push(e[h]);c.Logger.logUpdate(a)}else console.log("Get composition connection between two concepts",p.status),(0,s.ry)(p)}catch(e){e instanceof Error?console.log("Get composition connection between two concepts error message: ",e.message):console.log("Get composition connection between two concepts unexpected error: ",e),(0,s.Mb)(e,i.B.GetCompositionConnectionBetweenTwoConceptsUrl()),(0,s.ey)(a,"GetCompositionConnectionsBetweenTwoConcepts",e)}return d})}},2832:(e,t,n)=>{n.d(t,{j:()=>a});var o=n(8562),i=n(9581),r=n(1863),s=n(3518),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){var t=arguments;return c(this,arguments,void 0,function*(e,n=""){const c=o.Logger.logfunction("SearchLinkMultipleApi",t);let a=performance.now();var l=(0,s.ab)("application/json",n);const d=i.B.SearchLinkMultipleAllApiUrl(),u=JSON.stringify(e);try{const t=yield fetch(d,{method:"POST",headers:l,body:u});if(t.ok){let e=yield t.json();return o.Logger.logUpdate(c),e}return(0,r.ry)(t),console.log("This is the searching multiple error",t.status),o.Logger.logError(a,"unknown","search","unknown",void 0,t.status,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),[]}catch(t){console.log("This is the searching multiple error",t),o.Logger.logError(a,"unknown","search","unknown",void 0,500,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),(0,r.Mb)(t,d),(0,r.ey)(c,"SearchLinkMultipleApi",t)}})}},2895:(e,t,n)=>{let o=n(396),i=n(9371),r=n(7793),s=n(3614),c=n(5238),a=n(145),l=n(3438),d=n(1106),u=n(6966),h=n(1752),p=n(3152),f=n(9577),v=n(6846),y=n(3717),g=n(5644),m=n(1534),C=n(3303),w=n(38);function I(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new v(e)}I.plugin=function(e,t){let n,o=!1;function i(...n){console&&console.warn&&!o&&(o=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new v).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return I([i(n)]).process(e,t)},i},I.stringify=C,I.parse=f,I.fromJSON=l,I.list=h,I.comment=e=>new i(e),I.atRule=e=>new o(e),I.decl=e=>new c(e),I.rule=e=>new m(e),I.root=e=>new g(e),I.document=e=>new a(e),I.CssSyntaxError=s,I.Declaration=c,I.Container=r,I.Processor=v,I.Document=a,I.Comment=i,I.Warning=w,I.AtRule=o,I.Result=y,I.Input=d,I.Rule=m,I.Root=g,I.Node=p,u.registerPostcss(I),e.exports=I,I.default=I},2918:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.NESTING,n.value="&",n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},3026:(e,t,n)=>{n.d(t,{I:()=>f});var o=n(3655),i=n(2202),r=n(6963),s=n(5457),c=n(7282),a=n(8562);class l{constructor(e,t,n,o){this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.rightNode=this.removeNode(e.rightNode,t.key),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class u{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addWidgetToTree(e){let t=new l(e.widgetId,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return d(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return d(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}u.root=null;class h{constructor(){this.widgetId=0,this.mainId=0,this.conceptIds=[],this.linkers=[],this.reverse=[],this.mainCompositionIds=[],this.countinfo=[]}}var p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class f{constructor(){this.name="conceptsArray"}static CheckContains(e){for(var t=!1,n=0;n<this.conceptsArray.length;n++)this.conceptsArray[n].id==e.id&&(t=!0);return t}static AddNpc(e){this.NPC.includes(e)||(this.NPC.length>10&&(this.NPC=[]),this.NPC.push(e))}static GetNpc(e){return!!this.NPC.includes(e)}static AddConceptToStorage(e){e.id>0&&(0,o.kH)("concept",e)}static GetConceptBulkData(e,t,n){return p(this,void 0,void 0,function*(){yield i.W.getConceptListFromIds(e,t,n)})}static AddWidget(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddWidget",{widgetDetails:e})}catch(e){console.error("Concept Data, Add Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.widgetId>0&&u.addWidgetToTree(e)}static AddConcept(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddConcept",{concept:e})}catch(e){console.error("Concept Data, Add Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.id>0&&(i.W.addConceptToTree(e),s.c.addConceptToTree(e))}static AddConceptToMemory(e){e.id>0&&(i.W.addConceptToTree(e),s.c.addConceptToTree(e))}static AddConceptTemporary(e){var t=this.CheckContains(e);this.conceptDictionary[e.id]=e,t&&this.RemoveConcept(e),this.conceptsArray.push(e)}static RemoveConcept(e){for(var t=0;t<this.conceptsArray.length;t++)this.conceptsArray[t].id==e.id&&this.conceptsArray.splice(t,1);(0,o.wh)("concept",e.id)}static GetWidget(e){return p(this,void 0,void 0,function*(){let t=new h;if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetWidget",{id:e})).data}catch(e){console.error("Concept Data, Get Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}let n=yield u.getNodeFromTree(e);return null!=n&&(t=n.value),t})}static RemoveWidget(e){return p(this,void 0,void 0,function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__RemoveWidget",{id:e})).data}catch(e){console.error("Concept Data, Remove Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}yield u.removeNodeFromTree(e)})}static GetConcept(e){return p(this,void 0,void 0,function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConcept",{id:e})).data}catch(e){console.error("Concept Data, Get Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}if(0==e||null==e||null==e)return(0,c.o)();var t=(0,c.o)(),n=yield i.W.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static GetConceptByCharacter(e){return p(this,void 0,void 0,function*(){var t=(0,c.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterUpdated(e){return p(this,void 0,void 0,function*(){var t=(0,c.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterAndTypeLocal(e,t){return p(this,void 0,void 0,function*(){return(0,c.o)(),yield s.c.getTypeVariantsWithCharacterValueNew(e,t)})}static GetConceptByCharacterAndCategoryLocal(e,t){return p(this,void 0,void 0,function*(){var n=(0,c.o)(),o=yield r.f.getCharacterAndCategoryFromTree(e,t);return o&&(n=o.value),n})}static GetConceptsByTypeId(e){let t=[];for(var n=0;n<this.conceptsArray.length;n++)this.conceptsArray[n].typeId==e&&t.push(this.conceptsArray[n]);return t}static GetConceptsByTypeIdAndUser(e,t){var n=arguments;return p(this,void 0,void 0,function*(){if(a.Logger.logfunction("ConceptsData.GetConceptsByTypeIdAndUser",n),a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConceptsByTypeIdAndUser",{typeId:e,userId:t})).data}catch(e){console.error("Concept Data, Get Concpet sw error:",e),(0,a.handleServiceWorkerException)(e)}let o=[];return o=yield s.c.getTypeVariantsFromTreeWithUserIdNew(e,t),o})}static GetBinaryCharacterTree(){return r.f.characterRoot}getName(){return this.name}}f.conceptsArray=[],f.NPC=[],f.conceptDictionary=[]},3075:(e,t,n)=>{n.d(t,{Ay:()=>d,EO:()=>u,xd:()=>h});var o=n(205),i=n(9736),r=n(5257),s=n(9003),c=n(8562),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(){return l(this,void 0,void 0,function*(){const e=c.Logger.logfunction("CreateLocalBinaryTreeFromIndexDb");try{let t=[];if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];i.v.AddConceptToMemory(n)}o.B.isLocalDataLoaded=!0,o.B.isLocalTypeLoaded=!0,o.B.isLocalCharacterLoaded=!0,c.Logger.logUpdate(e)}catch(t){yield(0,c.DelayFunctionExecution)(2e3,d());let n={message:"Cannot create local binary tree from index db",data:t,ok:!1,status:400};throw(0,a.ey)(e,"CreateLocalBinaryTreeFromIndexDb",t),n}})}function u(){return l(this,void 0,void 0,function*(){var e;const t=c.Logger.logfunction("PopulateTheLocalConceptsToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",e=>l(this,void 0,void 0,function*(){let e=yield(0,s.S5)("localid");if(Array.isArray(e)){if(e[0]){let t=e[0].value;if(t)r.R.AddConceptId(e[0]),yield(0,s.kH)("localid",{id:0,value:t-10});else{t=-Math.floor(1e8*Math.random());let e={id:0,value:t},n={id:0,value:t-10};r.R.AddConceptId(e),yield(0,s.kH)("localid",n)}}e[2]}})),c.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConceptsToMemory",e),n}})}function h(){return l(this,void 0,void 0,function*(){var e;const t=c.Logger.logfunction("PopulateTheLocalConnectionToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",e=>l(this,void 0,void 0,function*(){let e=yield(0,s.S5)("localid");if(Array.isArray(e)){if(e[1]){let t=e[1].value;if(t)r.R.AddConnectionId(e[1]),yield(0,s.kH)("localid",{id:1,value:t-10});else{t=-Math.floor(1e8*Math.random());let e={id:0,value:t},n={id:0,value:t-10};r.R.AddConnectionId(e),yield(0,s.kH)("localid",n)}}e[2]}})),c.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConnectionToMemory",e),n}})}},3077:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(8562),i=n(2615),r=n(9736),s=n(5257),c=n(9700),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n,l,d,u){return a(this,arguments,void 0,function*(e,t,n,a,l,d,u=!1,h=0,p={concepts:[],connections:[]}){var f,v,y,g;let m=performance.now();try{if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("CreateTheConceptLocal",{referent:e,typecharacter:t,userId:n,categoryId:a,typeId:l,accessId:d,isComposition:u,referentId:h});return(null===(v=null===(f=null==i?void 0:i.actions)||void 0===f?void 0:f.concepts)||void 0===v?void 0:v.length)&&(p.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(g=null===(y=null==i?void 0:i.actions)||void 0===y?void 0:y.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("CreateTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let c=yield s.R.getConceptId(),m=!0,C=new Date,w=new Date;if("the"==e)return new i.j(1,999,5,5,h,e,d,m,C,w,t);let I=new i.j(c,n,l,a,h,e,d,m,C,w,t);return I.isTemp=!0,I.isComposition=u,r.v.AddConcept(I),p.concepts.push(I),I}catch(o){throw c.V.logError(m,n,"create","unknown","unknown",500,void 0,"createTheConceptLocal",[e,t,n,a,l,d,u],void 0),o}})}},3130:(e,t,n)=>{n.d(t,{BG:()=>a,SL:()=>l,XZ:()=>c,ZJ:()=>r,iw:()=>s,pU:()=>d,y0:()=>i,yv:()=>o});const o=1,i=2,r=3,s=4,c=5,a=6,l=7,d=8},3152:(e,t,n)=>{let o=n(3614),i=n(7668),r=n(3303),{isClean:s,my:c}=n(4151);function a(e,t){let n=new e.constructor;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;if("proxyCache"===o)continue;let i=e[o],r=typeof i;"parent"===o&&"object"===r?t&&(n[o]=t):"source"===o?n[o]=i:Array.isArray(i)?n[o]=i.map(e=>a(e,n)):("object"===r&&null!==i&&(i=a(i)),n[o]=i)}return n}function l(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,o=1,i=0;for(let r=0;r<e.length;r++){if(o===t.line&&n===t.column){i=r;break}"\n"===e[r]?(n=1,o+=1):n+=1}return i}class d{get proxyOf(){return this}constructor(e={}){this.raws={},this[s]=!1,this[c]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:o}=this.rangeBy(t);return this.source.input.error(e,{column:o.column,line:o.line},{column:n.column,line:n.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,o=n.slice(l(n,this.source.start),l(n,this.source.end)).indexOf(e.word);-1!==o&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,i=l(o,this.source.start),r=i+e;for(let e=i;e<r;e++)"\n"===o[e]?(t=1,n+=1):t+=1;return{column:t,line:n,offset:r}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:l(t,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:l(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let i=t.slice(l(t,this.source.start),l(t,this.source.end)).indexOf(e.word);-1!==i&&(n=this.positionInside(i),o=this.positionInside(i+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:l(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line,offset:l(t,e.end)}:"number"==typeof e.endIndex?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<n.line||o.line===n.line&&o.column<=n.column)&&(o={column:n.column+1,line:n.line,offset:n.offset+1}),{end:o,start:n}}raw(e,t){return(new i).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},o=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){if(null==o)continue;let r=t.get(o.input);null==r&&(r=i,t.set(o.input,i),i++),n[e]={end:o.end,inputId:r,start:o.start}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=r){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n={}){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}}e.exports=d,d.default=d},3278:(e,t,n)=>{n.d(t,{b:()=>o});class o{static setSession(e){e&&(o.sessionId=e)}}o.BearerAccessToken="",o.sessionId=998},3295:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=r(n(8937)),i=n(9606);function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var a=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n);var a,l,d=r.prototype;return d.qualifiedName=function(e){return this.namespace?this.namespaceString+"|"+e:e},d.valueToString=function(){return this.qualifiedName(e.prototype.valueToString.call(this))},a=r,(l=[{key:"namespace",get:function(){return this._namespace},set:function(e){if(!0===e||"*"===e||"&"===e)return this._namespace=e,void(this.raws&&delete this.raws.namespace);var t=(0,o.default)(e,{isIdentifier:!0});this._namespace=e,t!==e?((0,i.ensureObject)(this,"raws"),this.raws.namespace=t):this.raws&&delete this.raws.namespace}},{key:"ns",get:function(){return this._namespace},set:function(e){this.namespace=e}},{key:"namespaceString",get:function(){if(this.namespace){var e=this.stringifyProperty("namespace");return!0===e?"":e}return""}}])&&s(a.prototype,l),Object.defineProperty(a,"prototype",{writable:!1}),r}(r(n(4646)).default);t.default=a,e.exports=t.default},3303:(e,t,n)=>{let o=n(7668);function i(e,t){new o(t).stringify(e)}e.exports=i,i.default=i},3438:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(1106),c=n(3878),a=n(5644),l=n(1534);function d(e,t){if(Array.isArray(e))return e.map(e=>d(e));let{inputs:n,...u}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:s.prototype};n.map&&(n.map={...n.map,__proto__:c.prototype}),t.push(n)}}if(u.nodes&&(u.nodes=e.nodes.map(e=>d(e,t))),u.source){let{inputId:e,...n}=u.source;u.source=n,null!=e&&(u.source.input=t[e])}if("root"===u.type)return new a(u);if("decl"===u.type)return new r(u);if("rule"===u.type)return new l(u);if("comment"===u.type)return new i(u);if("atrule"===u.type)return new o(u);throw new Error("Unknown node type: "+e.type)}e.exports=d,d.default=d},3518:(e,t,n)=>{n.d(t,{BZ:()=>c,Xr:()=>r,ab:()=>s});var o=n(3278),i=n(490);function r(e="application/json",t="application/json"){var n;const i={},r=o.b.BearerAccessToken,s=null===(n=o.b.sessionId)||void 0===n?void 0:n.toString();return r&&(i.Authorization=`Bearer ${r}`),e&&(i["Content-Type"]=e),t&&(i.Accept=t),i["X-Session-id"]=s,i}function s(e="application/json",t="",n="application/json"){var i;""==t&&(t=o.b.BearerAccessToken);let r={},s=null===(i=o.b.sessionId)||void 0===i?void 0:i.toString();return r=""!=t?{"Content-Type":e,Authorization:"Bearer "+t,Accept:n,"X-Session-id":s}:{"Content-Type":e,Accept:n,"X-Session-id":s},r}function c(){var e;let t=o.b.BearerAccessToken,n=null===(e=o.b.sessionId)||void 0===e?void 0:e.toString();if(""==t){let e=(0,i.s)();""!=e.token&&(o.b.BearerAccessToken=e.token,t=e.token)}let r=new Headers;return r.append("Authorization","Bearer "+t),r.append("X-Session-Id",n),r}},3604:(e,t,n)=>{let{dirname:o,relative:i,resolve:r,sep:s}=n(197),{SourceMapConsumer:c,SourceMapGenerator:a}=n(1866),{pathToFileURL:l}=n(2739),d=n(1106),u=Boolean(c&&a),h=Boolean(o&&r&&i&&s);e.exports=class{constructor(e,t,n,o){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),i=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new c(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),h&&u&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=a.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new a({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new a({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,o=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,c,a)=>{if(this.css+=s,c&&"end"!==a&&(r.generated.line=n,r.generated.column=o-1,c.source&&c.source.start?(r.source=this.sourcePath(c),r.original.line=c.source.start.line,r.original.column=c.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),o=s.length-e):o+=s.length,c&&"start"!==a){let e=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===e.last&&!e.raws.semicolon||(c.source&&c.source.end?(r.source=this.sourcePath(c),r.original.line=c.source.end.line,r.original.column=c.source.end.column-1,r.generated.line=n,r.generated.column=o-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=n,r.generated.column=o-1,this.map.addMapping(r)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(r(n,this.mapOpts.annotation)));let s=i(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new d(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let o=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(o,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(l){let t=l(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===s&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},3614:(e,t,n)=>{let o=n(8633),i=n(9746);class r extends Error{constructor(e,t,n,o,i,s){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),o&&(this.source=o),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported);let n=e=>e,r=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:c}=o.createColors(!0);r=t=>e(c(t)),n=e=>t(e),i&&(s=e=>i(e))}let c=t.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,c.length),d=String(l).length;return c.slice(a,l).map((e,t)=>{let o=a+1+t,i=" "+(" "+o).slice(-d)+" | ";if(o===this.line){if(e.length>160){let t=20,o=Math.max(0,this.column-t),c=Math.max(this.column+t,this.endColumn+t),a=e.slice(o,c),l=n(i.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return r(">")+n(i)+s(a)+"\n "+l+r("^")}let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+s(e)+"\n "+t+r("^")}return" "+n(i)+s(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=r,r.default=r},3631:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1581));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var d=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).nodes||(n.nodes=[]),n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n);var i,s,d=o.prototype;return d.append=function(e){return e.parent=this,this.nodes.push(e),this},d.prepend=function(e){for(var t in e.parent=this,this.nodes.unshift(e),this.indexes)this.indexes[t]++;return this},d.at=function(e){return this.nodes[e]},d.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},d.removeChild=function(e){var t;for(var n in e=this.index(e),this.at(e).parent=void 0,this.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this},d.removeAll=function(){for(var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.nodes);!(e=t()).done;)e.value.parent=void 0;return this.nodes=[],this},d.empty=function(){return this.removeAll()},d.insertAfter=function(e,t){var n;t.parent=this;for(var o,i=this.index(e),r=[],s=2;s<arguments.length;s++)r.push(arguments[s]);for(var c in(n=this.nodes).splice.apply(n,[i+1,0,t].concat(r)),t.parent=this,this.indexes)i<(o=this.indexes[c])&&(this.indexes[c]=o+arguments.length-1);return this},d.insertBefore=function(e,t){var n;t.parent=this;for(var o,i=this.index(e),r=[],s=2;s<arguments.length;s++)r.push(arguments[s]);for(var c in(n=this.nodes).splice.apply(n,[i,0,t].concat(r)),t.parent=this,this.indexes)(o=this.indexes[c])>=i&&(this.indexes[c]=o+arguments.length-1);return this},d._findChildAtPosition=function(e,t){var n=void 0;return this.each(function(o){if(o.atPosition){var i=o.atPosition(e,t);if(i)return n=i,!1}else if(o.isAtPosition(e,t))return n=o,!1}),n},d.atPosition=function(e,t){return this.isAtPosition(e,t)?this._findChildAtPosition(e,t)||this:void 0},d._inferEndPosition=function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},d.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var t=this.lastEach;if(this.indexes[t]=0,this.length){for(var n,o;this.indexes[t]<this.length&&(n=this.indexes[t],!1!==(o=e(this.at(n),n)));)this.indexes[t]+=1;return delete this.indexes[t],!1!==o&&void 0}},d.walk=function(e){return this.each(function(t,n){var o=e(t,n);if(!1!==o&&t.length&&(o=t.walk(e)),!1===o)return!1})},d.walkAttributes=function(e){var t=this;return this.walk(function(n){if(n.type===r.ATTRIBUTE)return e.call(t,n)})},d.walkClasses=function(e){var t=this;return this.walk(function(n){if(n.type===r.CLASS)return e.call(t,n)})},d.walkCombinators=function(e){var t=this;return this.walk(function(n){if(n.type===r.COMBINATOR)return e.call(t,n)})},d.walkComments=function(e){var t=this;return this.walk(function(n){if(n.type===r.COMMENT)return e.call(t,n)})},d.walkIds=function(e){var t=this;return this.walk(function(n){if(n.type===r.ID)return e.call(t,n)})},d.walkNesting=function(e){var t=this;return this.walk(function(n){if(n.type===r.NESTING)return e.call(t,n)})},d.walkPseudos=function(e){var t=this;return this.walk(function(n){if(n.type===r.PSEUDO)return e.call(t,n)})},d.walkTags=function(e){var t=this;return this.walk(function(n){if(n.type===r.TAG)return e.call(t,n)})},d.walkUniversals=function(e){var t=this;return this.walk(function(n){if(n.type===r.UNIVERSAL)return e.call(t,n)})},d.split=function(e){var t=this,n=[];return this.reduce(function(o,i,r){var s=e.call(t,i);return n.push(i),s?(o.push(n),n=[]):r===t.length-1&&o.push(n),o},[])},d.map=function(e){return this.nodes.map(e)},d.reduce=function(e,t){return this.nodes.reduce(e,t)},d.every=function(e){return this.nodes.every(e)},d.some=function(e){return this.nodes.some(e)},d.filter=function(e){return this.nodes.filter(e)},d.sort=function(e){return this.nodes.sort(e)},d.toString=function(){return this.map(String).join("")},i=o,(s=[{key:"first",get:function(){return this.at(0)}},{key:"last",get:function(){return this.at(this.length-1)}},{key:"length",get:function(){return this.nodes.length}}])&&a(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=d,e.exports=t.default},3655:(e,t,n)=>{n.d(t,{El:()=>h,b8:()=>u,kH:()=>d,qI:()=>l,wh:()=>p});var o=n(2299),i=n(9581),r=n(8562),s=n(1863);let c=10;class a{}function l(e){const t=r.Logger.logfunction("openDatabase",[e,"indexdb"]);return new Promise(function(n,o){a.db&&(r.Logger.logUpdate(t),n(a.db));let d=i.B.BASE_URL+"_FreeSchema"+i.B.BASE_APPLICATION;const u=indexedDB.open(d,c);console.log("this is the update version",c,u),u.onupgradeneeded=e=>{let o=e.target.result,i="concept",s="connection",a="settings";console.log("this is the version update for index",c),o.objectStoreNames.contains(i)&&o.deleteObjectStore(i),o.objectStoreNames.contains(s)&&o.deleteObjectStore(s),o.objectStoreNames.contains(a)&&o.deleteObjectStore(a),o.objectStoreNames.contains(i)||(o.createObjectStore(i,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(s)||(o.createObjectStore(s,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(a)||(o.createObjectStore(a,{keyPath:"id"}).transaction.oncomplete=e=>{}),r.Logger.logUpdate(t),n(o)},u.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(d),l(e),(0,s.ey)(t,"openDatabase",n),o(n)},u.onsuccess=function(e){let o=e.target;a.db=o.result,r.Logger.logUpdate(t),n(a.db)}})}function d(e,t){const n=r.Logger.logfunction("UpdateToDatabase",[e,"indexdb"]);return new Promise(function(o,i){l(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{r.Logger.logUpdate(n),o(t)},a.onerror=o=>{let r={status:400,ok:!1,message:"Cannot Update to the database"+e,data:o,body:t};(0,s.ey)(n,"UpdateToDatabase",r),i(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the database",data:e};(0,s.ey)(n,"UpdateToDatabase",t),i(t)})})}function u(){const e=r.Logger.logfunction("GetLastSettingsFromDatabase",["indexdb"]);return new Promise(function(t,n){let i="settings";l(i).then(c=>{let a=c.transaction(i,"readwrite").objectStore(i).getAll();a.onsuccess=()=>{let n=new o.B(!1),i=a.result;for(let e=0;e<i.length;e++)n=i[e];r.Logger.logUpdate(e),t(n)},a.onerror=t=>{(0,s.ey)(e,"GetLastSettingsFromDatabase",t),n(t)}}).catch(t=>{let o={status:400,ok:!1,message:"Cannot get last object from database because you cannot open the database",data:t};(0,s.ey)(e,"GetLastSettingsFromDatabase",o),n(o)})})}function h(e){const t=r.Logger.logfunction("AiUpdateFlag",["indexdb"]);return new Promise(function(n,o){let i="settings";l(i).then(c=>{const a=c.transaction(i,"readwrite").objectStore(i).put(e);a.onsuccess=o=>{r.Logger.logUpdate(t),n(e)},a.onerror=n=>{let i={status:400,ok:!1,message:"Cannot update AI flag",data:n,body:e};(0,s.ey)(t,"AiUpdateFlag",i),o(i)}}).catch(e=>{let n={status:400,ok:!1,message:"Cannot update AI flag because you cannot open the database",data:e};(0,s.ey)(t,"AiUpdateFlag",n),o(n)})})}function p(e,t){const n=r.Logger.logfunction("removeFromDatabase",[e,"indexdb"]);return new Promise(function(o,i){l(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).delete(Number(t));a.onsuccess=function(e){r.Logger.logUpdate(n),o(t)},a.onerror=t=>{let o={status:400,ok:!1,message:"Cannot remove from the database"+e,data:t};(0,s.ey)(n,"removeFromDatabase",o),i(o)}}).catch(e=>{let o={status:400,ok:!1,message:"Cannot remove from the database because you cannot open the database",data:e,body:t};(0,s.ey)(n,"removeFromDatabase",o),i(o)})})}},3717:(e,t,n)=>{let o=n(38);class i{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new o(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}e.exports=i,i.default=i},3729:(e,t,n)=>{n.d(t,{D:()=>p});var o=n(9934),i=n(4485),r=n(2),s=n(7876),c=n(4818),a=n(999),l=n(5868),d=n(8562),u=n(176),h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function p(e){return h(this,arguments,void 0,function*(e,t={concepts:[],connections:[]}){var n,h,p,f;if(performance.now(),d.serviceWorker)try{const o=yield(0,d.sendMessage)("UpdateCompositionLocal",{patcherStructure:e,actions:t});return(null===(h=null===(n=null==o?void 0:o.actions)||void 0===n?void 0:n.concepts)||void 0===h?void 0:h.length)&&(t.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.connections)||void 0===f?void 0:f.length)&&(t.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.error("UpdateCompositionLocal error sw: ",e),(0,d.handleServiceWorkerException)(e)}const v=e.userId,y=e.sessionId,g=e.accessId;let m=[];const C=[];let w=(0,d.CreateDefaultLConcept)(),I=(0,d.CreateDefaultLConcept)();const T=[],k=e.compositionId,A=e.ofTheCompositionId;let S=[],N=yield(0,r.s)(k);for(let e=0;e<N.length;e++)m.push((0,u.P6)(N[e]));const b=[],_=[];let L=[];for(let e=0;e<m.length;e++)(0,o.A)(_,m[e].ofTheConceptId),(0,o.A)(b,m[e].ofTheConceptId),(0,o.A)(b,m[e].toTheConceptId),L.push(m[e].ofTheConceptId);for(let e=0;e<b.length;e++){const t=yield(0,s.A)(b[e]);k==b[e]&&(w=(0,u.F4)(t)),A==b[e]&&(I=(0,u.F4)(t)),C.push((0,u.F4)(t))}const E=e.patchObject;for(const e in E){let n=(0,d.CreateDefaultLConcept)();const o=E[e];let r=w;I.id>0&&(r=I),Array.isArray(o)||"object"==typeof o?(n=yield(0,l.k)(e,"",!0,w.userId,4,999,void 0,t),yield(0,a.R)(E[e],n.id,n.userId,w.id,w.userId,4,999,void 0,t)):n=yield(0,l.k)(e,o,!1,v,g,y,void 0,t);const s=(0,i.nm)(C,n);for(let e=0;e<s.length;e++)if(s[e].id>0){const t=(0,i.gt)(m,s[e].id);S=S.concat(t),T.push(s[e])}yield(0,d.CreateTheConnectionLocal)(r.id,n.id,w.id,2,void 0,void 0,t),C.push(n)}for(let e=0;e<S.length;e++)yield(0,c.m)(S[e].id);yield d.LocalSyncData.SyncDataOnline(void 0,t)})}},3878:(e,t,n)=>{let{existsSync:o,readFileSync:i}=n(9977),{dirname:r,join:s}=n(197),{SourceMapConsumer:c,SourceMapGenerator:a}=n(1866);class l{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,o=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new c(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return o=e.substr(n[0].length),Buffer?Buffer.from(o,"base64").toString():window.atob(o);var o;let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),o=e.indexOf("*/",n);n>-1&&o>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,o)))}loadFile(e){if(this.root=r(e),o(e))return this.mapFile=e,i(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof c)return a.fromSourceMap(t).toString();if(t instanceof a)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=s(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=l,l.default=l},3996:(e,t,n)=>{n.d(t,{i:()=>o});class o{constructor(e,t,n,o){this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}},4151:e=>{e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},4195:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=c(n(8937)),i=n(9606),r=c(n(4646)),s=n(1581);function c(e){return e&&e.__esModule?e:{default:e}}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var d=function(e){var t,n,r,c;function d(t){var n;return(n=e.call(this,t)||this).type=s.CLASS,n._constructed=!0,n}return n=e,(t=d).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n),d.prototype.valueToString=function(){return"."+e.prototype.valueToString.call(this)},r=d,(c=[{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=(0,o.default)(e,{isIdentifier:!0});t!==e?((0,i.ensureObject)(this,"raws"),this.raws.value=t):this.raws&&delete this.raws.value}this._value=e}}])&&a(r.prototype,c),Object.defineProperty(r,"prototype",{writable:!1}),d}(r.default);t.default=d,e.exports=t.default},4211:(e,t,n)=>{let o=n(3604),i=n(9577);const r=n(3717);let s=n(3303);n(6156);class c{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=i;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){let i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let c=s;this.result=new r(this._processor,i,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new o(c,i,this._opts,t);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}e.exports=c,c.default=c},4287:(e,t,n)=>{n.d(t,{w:()=>s});var o=n(8562),i=n(3130),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{constructor(){this.subscribers=[],this.mainConcept=0,this.compositionIds=[],this.conceptIds=[],this.internalConnections=[],this.reverse=[],this.linkers=[],this.newIds=[],this.dependency=[],this.isDataLoaded=!1,this.isUpdating=!1,this.fetched=!1,this.format=i.yv,this.eventHandlers={}}listenToEventType(e){if(this.eventHandlers[e])return;const t=e=>r(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return r(this,void 0,void 0,function*(){try{let n=e;if(!t.compositionIds.includes(null==n?void 0:n.detail)){t.compositionIds.unshift(null==n?void 0:n.detail),t.listenToEvent(null==n?void 0:n.detail);let e=null==n?void 0:n.detail,i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)yield o.ConnectionData.GetConnection(i[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||t.compositionIds.push(e.ofTheConceptId)})}t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw console.error("Error in typeHandler event listener:",e),t.isUpdating=!1,e}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}listenToEvent(e){if(this.eventHandlers[e])return;const t=t=>r(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return r(this,void 0,void 0,function*(){try{let n=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield o.ConnectionData.GetConnection(n[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||(t.compositionIds.push(e.ofTheConceptId),t.newIds.includes(e.ofTheConceptId)||t.newIds.push(e.ofTheConceptId))});t.isUpdating=!1,yield t.bind(),t.notify()}catch(n){throw console.error("Error in event listener for concept",e,":",n),t.isUpdating=!1,n}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}removeListenToEvent(e){const t=this.eventHandlers[e];t&&(window.removeEventListener(`${e}`,t),delete this.eventHandlers[e])}listenToEventConnectionType(e,t){const n=`${e}_type_${t}`;if(this.eventHandlers[n])return;const i=n=>r(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let n=this;setTimeout(function(){return r(this,void 0,void 0,function*(){try{let i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)i[e].typeId==t&&(yield o.ConnectionData.GetConnection(i[e]).then(e=>{e.typeId==n.mainConcept?n.internalConnections.includes(e.id)||n.internalConnections.push(e.id):n.linkers.includes(e.id)||n.linkers.push(e.id),n.conceptIds.includes(e.toTheConceptId)||n.conceptIds.push(e.toTheConceptId),n.compositionIds.includes(e.ofTheConceptId)||n.compositionIds.push(e.ofTheConceptId)}));n.isUpdating=!1,yield n.bind(),n.notify()}catch(e){throw console.error("Error in connectionType handler:",e),n.isUpdating=!1,e}})},200)}});this.eventHandlers[n]=i,window.addEventListener(`${e}`,i)}bind(){return r(this,void 0,void 0,function*(){console.log("this is the old execute data")})}run(){return r(this,void 0,void 0,function*(){console.log("this is non subscriber data")})}update(){return r(this,void 0,void 0,function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()})}subscribe(e,t){return r(this,void 0,void 0,function*(){this.subscribers.push(e);try{return yield this.bind(),e(this.data,this)}catch(e){throw console.error("Error in subscribe:",e),t&&t(e),e}})}execute(){return r(this,void 0,void 0,function*(){return yield this.run()})}unsubscribe(e){return this.subscribers.filter(t=>t!=e),this.subscribers.length}notify(){this.subscribers.map(e=>{e(this.data,this)})}}},4310:(e,t,n)=>{n.d(t,{Cp:()=>p,ix:()=>g,ml:()=>y,qj:()=>v,xJ:()=>f});var o=n(8562),i=n(1596),r=n(4698),s=n(1863),c=n(1320),a=n(3518),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const d=new Map,u=new Map,h=new Map;function p(e){var t=arguments;return l(this,void 0,void 0,function*(){o.Logger.logfunction("BuildWidgetFromId",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromId",{id:e})).data}catch(e){console.error("BuildWidgetFromId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(d.has(e))return d.get(e)||n;const i=(()=>l(this,void 0,void 0,function*(){try{let t=[],i=[],l=[],d=[],u="DESC",h=[],p={},f=(0,a.Xr)("application/json"),v=o.BaseUrl.getWidgetData()+"?id="+e;const y=yield fetch(v,{method:"GET",headers:f});if(!y.ok)return(0,s.ry)(y),console.log("This is the BuildWidgetFromId error",y.status),[];p=yield y.json(),t=p.conceptIds,i=p.linkers,l=p.reverse,d=p.mainCompositionIds,h=p.countinfo;let g=(0,r.w)(h);return n=yield(0,c.e$)(i,t,d,l,g,u),n}catch(e){throw console.log("this is the error in the build widget",e),e}finally{d.delete(e)}}))();return d.set(e,i),i})}function f(e){return l(this,void 0,void 0,function*(){try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromCache",{id:e})).data}catch(e){console.error("BuildWidgetFromCache error sw: ",e),(0,o.handleServiceWorkerException)(e)}let t={data:null,mainId:0},n=yield o.ConceptsData.GetWidget(e);if(n.widgetId>0){let e="DESC",o=n.conceptIds,i=n.linkers,s=n.reverse,a=n.mainCompositionIds,l=n.countinfo,d=(0,r.w)(l);t={data:yield(0,c.e$)(i,o,a,s,d,e),mainId:n.mainId}}return t})}function v(e){var t=arguments;return l(this,void 0,void 0,function*(){o.Logger.logfunction("BuildWidgetFromIdForLatest",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromIdForLatest",{id:e})).data}catch(e){console.error("BuildWidgetFromIdForLatest error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(u.has(e))return u.get(e)||n;const d=(()=>l(this,void 0,void 0,function*(){try{let t,l=[],d=[],u=[],h=[],p="DESC",f=[],v={},y=(0,a.Xr)("application/json");try{let n=o.BaseUrl.getLatestWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:y})}catch(n){t=yield(0,i.g)({method:"GET",headers:y},"?id="+e)}if(!t.ok)return(0,s.ry)(t),console.log("This is the BuildWidgetFromId error",t.status),[];v=yield t.json(),l=v.conceptIds,d=v.linkers,u=v.reverse,h=v.mainCompositionIds,f=v.countinfo;let g=(0,r.w)(f);return n=yield(0,c.e$)(d,l,h,u,g,p),{data:n,mainId:v.mainId}}catch(e){throw console.log("this is the error in the build widget",e),e}finally{u.delete(e)}}))();return u.set(e,d),d})}function y(e){var t=arguments;return l(this,void 0,void 0,function*(){o.Logger.logfunction("BuildWidgetFromIdForRecent",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromIdForRecent",{id:e})).data}catch(e){console.error("BuildWidgetFromIdForRecent error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(h.has(e))return h.get(e)||n;const d=(()=>l(this,void 0,void 0,function*(){try{let t,l=[],d=[],u=[],h=[],p="DESC",f=[],v={},y=(0,a.Xr)("application/json");try{let n=o.BaseUrl.getRecentWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:y})}catch(n){t=yield(0,i.g)({method:"GET",headers:y},"?id="+e)}if(!t.ok)return(0,s.ry)(t),console.log("This is the BuildWidgetFromId error",t.status),[];v=yield t.json(),l=v.conceptIds,d=v.linkers,u=v.reverse,h=v.mainCompositionIds,f=v.countinfo;let g=(0,r.w)(f);return n=yield(0,c.e$)(d,l,h,u,g,p),{data:n,mainId:v.mainId}}catch(e){throw console.log("this is the error in the build widget",e),e}finally{h.delete(e)}}))();return h.set(e,d),d})}function g(e,t){for(let n=0;n<e.length;n++)if(e[n].id==t)return e[n]}},4364:(e,t,n)=>{n.d(t,{s:()=>s});var o=n(1239),i=n(8562),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(){return r(this,arguments,void 0,function*(e=[]){const t=i.Logger.logfunction("FindConceptsFromConnections",[e.length]);let n=[];if(e.length>0){for(let t=0;t<e.length;t++)n.includes(e[t].ofTheConceptId)||n.push(e[t].ofTheConceptId),n.includes(e[t].toTheConceptId)||n.push(e[t].toTheConceptId),n.includes(e[t].typeId)||n.push(e[t].typeId);yield(0,o.r)(n)}i.Logger.logUpdate(t)})}},4402:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(8562),a=n(7876),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e,t){var n=arguments;return l(this,void 0,void 0,function*(){const l=c.Logger.logfunction("GetConceptByCharacterAndType",n);try{if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetConceptByCharacterAndType",{characterValue:e,typeId:t})).data}catch(e){console.error("GetConceptByCharacterAndType sw error: ",e),(0,c.handleServiceWorkerException)(e)}let n=yield o.I.GetConceptByCharacterAndTypeLocal(e,t);if(null==n||0==n.id){var d={character_value:`${e}`,type_id:t},u=JSON.stringify(d),h=(0,r.Xr)("application/json");const c=yield fetch(i.B.GetConceptByCharacterAndTypeUrl(),{method:"POST",headers:h,body:u});if(c.ok){let e=yield c.json();n=e,(0,a.K)(n).then(e=>{o.I.AddConcept(n)})}else(0,s.ry)(c),console.log("This is the concept by type and character error",c.status)}return c.Logger.logUpdate(l),n}catch(e){e instanceof Error?console.log(" This is the concept by type and character error message: ",e.message):console.log(" This is the concept by type and character unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptByCharacterAndTypeUrl()),(0,s.ey)(l,"GetConceptByCharacterAndType",e)}})}},4451:(e,t,n)=>{t.__esModule=!0,t.universal=t.tag=t.string=t.selector=t.root=t.pseudo=t.nesting=t.id=t.comment=t.combinator=t.className=t.attribute=void 0;var o=v(n(5588)),i=v(n(4195)),r=v(n(1704)),s=v(n(425)),c=v(n(7071)),a=v(n(2918)),l=v(n(7324)),d=v(n(518)),u=v(n(339)),h=v(n(5799)),p=v(n(9720)),f=v(n(1669));function v(e){return e&&e.__esModule?e:{default:e}}t.attribute=function(e){return new o.default(e)},t.className=function(e){return new i.default(e)},t.combinator=function(e){return new r.default(e)},t.comment=function(e){return new s.default(e)},t.id=function(e){return new c.default(e)},t.nesting=function(e){return new a.default(e)},t.pseudo=function(e){return new l.default(e)},t.root=function(e){return new d.default(e)},t.selector=function(e){return new u.default(e)},t.string=function(e){return new h.default(e)},t.tag=function(e){return new p.default(e)},t.universal=function(e){return new f.default(e)}},4485:(e,t,n)=>{function o(e=[],t){var n,o;let i=[],r=null===(n=t.type)||void 0===n?void 0:n.characterValue;if((null==r?void 0:r.startsWith("the_"))||(r="the_"+r),Array.isArray(e))for(let n=0;n<e.length;n++){let s=null===(o=e[n].type)||void 0===o?void 0:o.characterValue;(null==s?void 0:s.startsWith("the_"))||(s="the_"+s),t.typeId!=e[n].typeId&&r!=s||i.push(e[n])}return i}function i(e=[],t){let n=[],o=t.typeCharacter;if((null==o?void 0:o.startsWith("the_"))||(o="the_"+o),Array.isArray(e))for(let i=0;i<e.length;i++){let r=e[i].typeCharacter;(null==r?void 0:r.startsWith("the_"))||(r="the_"+r),t.typeId!=e[i].typeId&&o!=r||n.push(e[i])}return n}function r(e=[],t){let n=[];if(Array.isArray(e)){const o=e.find(e=>e.toTheConceptId==t);o&&n.push(o);const i=e.find(e=>e.ofTheConceptId==t);i&&n.push(i)}return n}function s(e=[],t){let n=[];if(Array.isArray(e)){const o=e.find(e=>e.toTheConceptId==t);o&&n.push(o);const i=e.find(e=>e.ofTheConceptId==t);i&&n.push(i)}return n}n.d(t,{gt:()=>s,nm:()=>i,vo:()=>o,wS:()=>r}),n(2155),n(7282)},4643:(e,t,n)=>{function o(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(o("noDeprecation"))return e;var n=!1;return function(){if(!n){if(o("throwDeprecation"))throw new Error(t);o("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},4646:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=n(9606);function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var r=function e(t,n){if("object"!=typeof t||null===t)return t;var o=new t.constructor;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];"parent"===i&&"object"==typeof r?n&&(o[i]=n):o[i]=r instanceof Array?r.map(function(t){return e(t,o)}):e(r,o)}return o},s=function(){function e(e){void 0===e&&(e={}),Object.assign(this,e),this.spaces=this.spaces||{},this.spaces.before=this.spaces.before||"",this.spaces.after=this.spaces.after||""}var t,n,s=e.prototype;return s.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},s.replaceWith=function(){if(this.parent){for(var e in arguments)this.parent.insertBefore(this,arguments[e]);this.remove()}return this},s.next=function(){return this.parent.at(this.parent.index(this)+1)},s.prev=function(){return this.parent.at(this.parent.index(this)-1)},s.clone=function(e){void 0===e&&(e={});var t=r(this);for(var n in e)t[n]=e[n];return t},s.appendToPropertyAndEscape=function(e,t,n){this.raws||(this.raws={});var o=this[e],i=this.raws[e];this[e]=o+t,i||n!==t?this.raws[e]=(i||o)+n:delete this.raws[e]},s.setPropertyAndEscape=function(e,t,n){this.raws||(this.raws={}),this[e]=t,this.raws[e]=n},s.setPropertyWithoutEscape=function(e,t){this[e]=t,this.raws&&delete this.raws[e]},s.isAtPosition=function(e,t){if(this.source&&this.source.start&&this.source.end)return!(this.source.start.line>e||this.source.end.line<e||this.source.start.line===e&&this.source.start.column>t||this.source.end.line===e&&this.source.end.column<t)},s.stringifyProperty=function(e){return this.raws&&this.raws[e]||this[e]},s.valueToString=function(){return String(this.stringifyProperty("value"))},s.toString=function(){return[this.rawSpaceBefore,this.valueToString(),this.rawSpaceAfter].join("")},t=e,(n=[{key:"rawSpaceBefore",get:function(){var e=this.raws&&this.raws.spaces&&this.raws.spaces.before;return void 0===e&&(e=this.spaces&&this.spaces.before),e||""},set:function(e){(0,o.ensureObject)(this,"raws","spaces"),this.raws.spaces.before=e}},{key:"rawSpaceAfter",get:function(){var e=this.raws&&this.raws.spaces&&this.raws.spaces.after;return void 0===e&&(e=this.spaces.after),e||""},set:function(e){(0,o.ensureObject)(this,"raws","spaces"),this.raws.spaces.after=e}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s,e.exports=t.default},4698:(e,t,n)=>{n.d(t,{V:()=>a,w:()=>c});var o=n(7139),i=n(8562),r=n(276),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e=[]){let t=[];if(e.length>0)for(let n=0;n<e.length;n++){let o=l(e[n]);t.push(o)}return t}function a(e){var t=arguments;return s(this,void 0,void 0,function*(){const n=i.Logger.logfunction("GetConnectionTypeForCount",t);let r={};for(let t=0;t<e.length;t++){let n=yield(0,o.r)(e[t].connectionTypeId);e[t].connectionType=n.characterValue,r[e[t].conceptId]=e[t]}return i.Logger.logUpdate(n),r})}function l(e){const t=e.split("_");if(3===t.length){let e=new r.y;return e.conceptId=Number(t[0]),e.connectionTypeId=Number(t[1]),e.count=Number(t[2]),e}throw new Error("Input string must contain exactly three parts separated by underscores.")}},4711:(e,t,n)=>{n.d(t,{F:()=>l,d:()=>d});var o=n(2155),i=n(4864),r=n(5257),s=n(9700),c=n(8562),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n){return a(this,arguments,void 0,function*(e,t,n,a=1,l="",d=999,u={concepts:[],connections:[]}){var h,p,f,v;let y=performance.now();if(c.serviceWorker)try{const o=yield(0,c.sendMessage)("CreateTheConnectionLocal",{ofTheConceptId:e,toTheConceptId:t,typeId:n,orderId:a,typeString:l,userId:d,actions:u});return(null===(p=null===(h=null==o?void 0:o.actions)||void 0===h?void 0:h.concepts)||void 0===p?void 0:p.length)&&(u.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(v=null===(f=null==o?void 0:o.actions)||void 0===f?void 0:f.connections)||void 0===v?void 0:v.length)&&(u.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.log("CreateTheConnectionLocal error sw: ",e),(0,c.handleServiceWorkerException)(e)}try{let s=4,h=yield r.R.getConnectionId(),p=0,f=0,v=0;p=e,f=t,v=n;let y=new o.N(0,0,0,0,0,0,0);return e!=t&&(y=new o.N(h,p,f,d,n,a,s),y.isTemp=!0,y.typeCharacter=l,c.LocalSyncData.AddConnection(y),i.G.AddConnection(y),u.connections.push(y)),y}catch(o){throw s.V.logError(y,d,"create","Unknown","Unknown",500,void 0,"CreateTheConnectionLocal",[e,t,n,a,l,d],"UnknownUserAgent",[]),o}})}function d(e,t,n){return a(this,arguments,void 0,function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,a;if(c.serviceWorker)try{const l=yield(0,c.sendMessage)("CreateConnection",{ofTheConcept:e,toTheConcept:t,connectionTypeString:n,actions:o});return(null===(r=null===(i=null==l?void 0:l.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(l.actions.concepts))),(null===(a=null===(s=null==l?void 0:l.actions)||void 0===s?void 0:s.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(l.actions.connections))),l.data}catch(e){console.log("CreateConnection error sw: ",e),(0,c.handleServiceWorkerException)(e)}let d=yield(0,c.MakeTheTypeConceptLocal)(n,999,999,999),u=e.userId;return yield l(e.id,t.id,d.id,1e3,n,u,o)})}},4818:(e,t,n)=>{n.d(t,{m:()=>h,E:()=>p});var o=n(8562),i=n(1863),r=n(3518),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},c=n(9581),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},l=n(5239),d=n(4864),u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function h(e){var t=arguments;return u(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteConnectionById",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionById",{id:e})).data}catch(e){console.error("DeleteConnectionById sw error: ",e),(0,o.handleServiceWorkerException)(e)}let s=!0;return e>0?(s=yield function(e){var t=arguments;return a(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteTheConnection",t);let s=!1;try{const t=new FormData;t.append("id",e.toString());let a=(0,r.BZ)();const l=yield fetch(c.B.DeleteTheConnectionUrl(),{method:"POST",headers:a,body:t,redirect:"follow"});o.Logger.logUpdate(n),l.ok?s=(yield l.json()).success:(console.log("Delete connection error status: ",l.status),(0,i.ry)(l)),s&&o.ConnectionData.AddNpConn(e)}catch(e){e instanceof Error?console.log("Delete connection error message: ",e.message):console.log("Delete connection unexpected error: ",e),(0,i.Mb)(e,c.B.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnection",e)}return s})}(e),l.O.removeNodeFromTree(e)):d.G.RemoveConnectionById(e),o.Logger.logUpdate(n),s})}function p(e){var t=arguments;return u(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteConnectionByIdBulk",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionByIdBulk",{ids:e})).data}catch(e){console.error("DeleteConnectionByIdBulk sw error: ",e),(0,o.handleServiceWorkerException)(e)}let c=yield function(e){var t=arguments;return s(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteTheConnectionBulkApi",t);let s=!1;try{let t=(0,r.BZ)();t.append("Content-Type","application/json");const c=yield fetch(o.BaseUrl.DeleteTheConnectionBulkUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(o.Logger.logUpdate(n),c.ok?s=(yield c.json()).success:(console.log("Delete connection Bulk Api error status: ",c.status),(0,i.ry)(c)),s)for(let t=0;t<e.length;t++){let n=e[t];o.ConnectionData.AddNpConn(n)}}catch(e){e instanceof Error?console.log("Delete connection Bulk Api error message: ",e.message):console.log("Delete connection Bulk Api unexpected error: ",e),(0,i.Mb)(e,o.BaseUrl.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnectionBulkApi",e)}return s})}(e);if(c)for(let t=0;t<e.length;t++){let n=e[t];n>0?l.O.removeNodeFromTree(n):d.G.RemoveConnectionById(n)}return o.Logger.logUpdate(n),c})}},4864:(e,t,n)=>{n.d(t,{G:()=>a});var o=n(2155),i=n(8286),r=n(205),s=n(628),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{constructor(){this.name="Connection Array"}static CheckContains(e){for(var t=!1,n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e.id&&(t=!0);return t}static AddConnection(e){this.CheckContains(e)&&this.RemoveConnection(e),e.id,this.connectionArray.push(e)}static AddConnectionToMemory(e){this.CheckContains(e)&&this.RemoveConnection(e),this.connectionArray.push(e)}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){for(var t=0;t<this.connectionArray.length;t++)this.connectionArray[t].id==e.id&&this.connectionArray.splice(t,1);e.id}static RemoveConnectionById(e){for(var t=0;t<this.connectionArray.length;t++)this.connectionArray[t].id==e&&this.connectionArray.splice(t,1);s.H.RemoveConnectionById(e)}static AddPermanentConnection(e){e.id>0&&i.d.AddConnection(function(e){let t=new o.N(0,0,0,0,0,0,0);return t.ofTheConceptId=e.ofTheConceptId,t.toTheConceptId=e.toTheConceptId,t.typeId=e.typeId,t.orderId=e.orderId,t.id=e.id,t}(e))}static GetConnection(e){var t;t=null;for(var n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e&&(t=this.connectionArray[n]);return t}static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isLocalConnectionLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static GetConnectionsOfCompositionLocal(e){return c(this,void 0,void 0,function*(){var t=[];try{for(var n=0;n<this.connectionArray.length;n++)this.connectionArray[n].typeId==e&&t.push(this.connectionArray[n]);return t}catch(e){return t}})}static GetConnectionOfCompositionAndTypeLocal(e,t){return c(this,void 0,void 0,function*(){var n=[];try{for(var o=0;o<this.connectionArray.length;o++)this.connectionArray[o].typeId==e&&this.connectionArray[o].ofTheConceptId==t&&n.push(this.connectionArray[o]);return n}catch(e){return n}})}getName(){return this.name}}a.connectionArray=[],a.connectionDictionary=[]},5020:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(8562),i=n(3026),r=n(205),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(){return s(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++){let n=e[t];i.I.AddConceptToMemory(n)}r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0}catch(e){throw yield(0,o.DelayFunctionExecution)(2e3,c()),{message:"Cannot create Binary Tree Concept",ok:!1,status:400,data:e}}})}},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",i=0|n;for(;i--;)o+=e[Math.random()*e.length|0];return o}}},5170:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i,r=A(n(518)),s=A(n(339)),c=A(n(4195)),a=A(n(425)),l=A(n(7071)),d=A(n(9720)),u=A(n(5799)),h=A(n(7324)),p=k(n(5588)),f=A(n(1669)),v=A(n(1704)),y=A(n(2918)),g=A(n(263)),m=k(n(2648)),C=k(n(71)),w=k(n(1581)),I=n(9606);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function k(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function A(e){return e&&e.__esModule?e:{default:e}}function S(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var N=((o={})[C.space]=!0,o[C.cr]=!0,o[C.feed]=!0,o[C.newline]=!0,o[C.tab]=!0,o),b=Object.assign({},N,((i={})[C.comment]=!0,i));function _(e){return{line:e[m.FIELDS.START_LINE],column:e[m.FIELDS.START_COL]}}function L(e){return{line:e[m.FIELDS.END_LINE],column:e[m.FIELDS.END_COL]}}function E(e,t,n,o){return{start:{line:e,column:t},end:{line:n,column:o}}}function x(e){return E(e[m.FIELDS.START_LINE],e[m.FIELDS.START_COL],e[m.FIELDS.END_LINE],e[m.FIELDS.END_COL])}function B(e,t){if(e)return E(e[m.FIELDS.START_LINE],e[m.FIELDS.START_COL],t[m.FIELDS.END_LINE],t[m.FIELDS.END_COL])}function O(e,t){var n=e[t];if("string"==typeof n)return-1!==n.indexOf("\\")&&((0,I.ensureObject)(e,"raws"),e[t]=(0,I.unesc)(n),void 0===e.raws[t]&&(e.raws[t]=n)),e}function R(e,t){for(var n=-1,o=[];-1!==(n=e.indexOf(t,n+1));)o.push(n);return o}var D=function(){function e(e,t){void 0===t&&(t={}),this.rule=e,this.options=Object.assign({lossy:!1,safe:!1},t),this.position=0,this.css="string"==typeof this.rule?this.rule:this.rule.selector,this.tokens=(0,m.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var n=B(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new r.default({source:n}),this.root.errorGenerator=this._errorGenerator();var o=new s.default({source:{start:{line:1,column:1}},sourceIndex:0});this.root.append(o),this.current=o,this.loop()}var t,n,o=e.prototype;return o._errorGenerator=function(){var e=this;return function(t,n){return"string"==typeof e.rule?new Error(t):e.rule.error(t,n)}},o.attribute=function(){var e=[],t=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[m.FIELDS.TYPE]!==C.closeSquare;)e.push(this.currToken),this.position++;if(this.currToken[m.FIELDS.TYPE]!==C.closeSquare)return this.expected("closing square bracket",this.currToken[m.FIELDS.START_POS]);var n=e.length,o={source:E(t[1],t[2],this.currToken[3],this.currToken[4]),sourceIndex:t[m.FIELDS.START_POS]};if(1===n&&!~[C.word].indexOf(e[0][m.FIELDS.TYPE]))return this.expected("attribute",e[0][m.FIELDS.START_POS]);for(var i=0,r="",s="",c=null,a=!1;i<n;){var l=e[i],d=this.content(l),u=e[i+1];switch(l[m.FIELDS.TYPE]){case C.space:if(a=!0,this.options.lossy)break;if(c){(0,I.ensureObject)(o,"spaces",c);var h=o.spaces[c].after||"";o.spaces[c].after=h+d;var f=(0,I.getProp)(o,"raws","spaces",c,"after")||null;f&&(o.raws.spaces[c].after=f+d)}else r+=d,s+=d;break;case C.asterisk:u[m.FIELDS.TYPE]===C.equals?(o.operator=d,c="operator"):o.namespace&&("namespace"!==c||a)||!u||(r&&((0,I.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=r,s=""),o.namespace=(o.namespace||"")+d,(0,I.getProp)(o,"raws","namespace")&&(o.raws.namespace+=d),c="namespace"),a=!1;break;case C.dollar:if("value"===c){var v=(0,I.getProp)(o,"raws","value");o.value+="$",v&&(o.raws.value=v+"$");break}case C.caret:u[m.FIELDS.TYPE]===C.equals&&(o.operator=d,c="operator"),a=!1;break;case C.combinator:if("~"===d&&u[m.FIELDS.TYPE]===C.equals&&(o.operator=d,c="operator"),"|"!==d){a=!1;break}u[m.FIELDS.TYPE]===C.equals?(o.operator=d,c="operator"):o.namespace||o.attribute||(o.namespace=!0),a=!1;break;case C.word:if(u&&"|"===this.content(u)&&e[i+2]&&e[i+2][m.FIELDS.TYPE]!==C.equals&&!o.operator&&!o.namespace)o.namespace=d,c="namespace";else if(!o.attribute||"attribute"===c&&!a)r&&((0,I.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=s,s=""),o.attribute=(o.attribute||"")+d,(0,I.getProp)(o,"raws","attribute")&&(o.raws.attribute+=d),c="attribute";else if(!o.value&&""!==o.value||"value"===c&&!a&&!o.quoteMark){var y=(0,I.unesc)(d),g=(0,I.getProp)(o,"raws","value")||"",w=o.value||"";o.value=w+y,o.quoteMark=null,(y!==d||g)&&((0,I.ensureObject)(o,"raws"),o.raws.value=(g||w)+d),c="value"}else{var T="i"===d||"I"===d;!o.value&&""!==o.value||!o.quoteMark&&!a?(o.value||""===o.value)&&(c="value",o.value+=d,o.raws.value&&(o.raws.value+=d)):(o.insensitive=T,T&&"I"!==d||((0,I.ensureObject)(o,"raws"),o.raws.insensitiveFlag=d),c="insensitive",r&&((0,I.ensureObject)(o,"spaces","insensitive"),o.spaces.insensitive.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","insensitive"),o.raws.spaces.insensitive.before=s,s=""))}a=!1;break;case C.str:if(!o.attribute||!o.operator)return this.error("Expected an attribute followed by an operator preceding the string.",{index:l[m.FIELDS.START_POS]});var k=(0,p.unescapeValue)(d),A=k.unescaped,S=k.quoteMark;o.value=A,o.quoteMark=S,c="value",(0,I.ensureObject)(o,"raws"),o.raws.value=d,a=!1;break;case C.equals:if(!o.attribute)return this.expected("attribute",l[m.FIELDS.START_POS],d);if(o.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:l[m.FIELDS.START_POS]});o.operator=o.operator?o.operator+d:d,c="operator",a=!1;break;case C.comment:if(c)if(a||u&&u[m.FIELDS.TYPE]===C.space||"insensitive"===c){var N=(0,I.getProp)(o,"spaces",c,"after")||"",b=(0,I.getProp)(o,"raws","spaces",c,"after")||N;(0,I.ensureObject)(o,"raws","spaces",c),o.raws.spaces[c].after=b+d}else{var _=o[c]||"",L=(0,I.getProp)(o,"raws",c)||_;(0,I.ensureObject)(o,"raws"),o.raws[c]=L+d}else s+=d;break;default:return this.error('Unexpected "'+d+'" found.',{index:l[m.FIELDS.START_POS]})}i++}O(o,"attribute"),O(o,"namespace"),this.newNode(new p.default(o)),this.position++},o.parseWhitespaceEquivalentTokens=function(e){e<0&&(e=this.tokens.length);var t=this.position,n=[],o="",i=void 0;do{if(N[this.currToken[m.FIELDS.TYPE]])this.options.lossy||(o+=this.content());else if(this.currToken[m.FIELDS.TYPE]===C.comment){var r={};o&&(r.before=o,o=""),i=new a.default({value:this.content(),source:x(this.currToken),sourceIndex:this.currToken[m.FIELDS.START_POS],spaces:r}),n.push(i)}}while(++this.position<e);if(o)if(i)i.spaces.after=o;else if(!this.options.lossy){var s=this.tokens[t],c=this.tokens[this.position-1];n.push(new u.default({value:"",source:E(s[m.FIELDS.START_LINE],s[m.FIELDS.START_COL],c[m.FIELDS.END_LINE],c[m.FIELDS.END_COL]),sourceIndex:s[m.FIELDS.START_POS],spaces:{before:o,after:""}}))}return n},o.convertWhitespaceNodesToSpace=function(e,t){var n=this;void 0===t&&(t=!1);var o="",i="";return e.forEach(function(e){var r=n.lossySpace(e.spaces.before,t),s=n.lossySpace(e.rawSpaceBefore,t);o+=r+n.lossySpace(e.spaces.after,t&&0===r.length),i+=r+e.value+n.lossySpace(e.rawSpaceAfter,t&&0===s.length)}),i===o&&(i=void 0),{space:o,rawSpace:i}},o.isNamedCombinator=function(e){return void 0===e&&(e=this.position),this.tokens[e+0]&&this.tokens[e+0][m.FIELDS.TYPE]===C.slash&&this.tokens[e+1]&&this.tokens[e+1][m.FIELDS.TYPE]===C.word&&this.tokens[e+2]&&this.tokens[e+2][m.FIELDS.TYPE]===C.slash},o.namedCombinator=function(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]),t=(0,I.unesc)(e).toLowerCase(),n={};t!==e&&(n.value="/"+e+"/");var o=new v.default({value:"/"+t+"/",source:E(this.currToken[m.FIELDS.START_LINE],this.currToken[m.FIELDS.START_COL],this.tokens[this.position+2][m.FIELDS.END_LINE],this.tokens[this.position+2][m.FIELDS.END_COL]),sourceIndex:this.currToken[m.FIELDS.START_POS],raws:n});return this.position=this.position+3,o}this.unexpected()},o.combinator=function(){var e=this;if("|"===this.content())return this.namespace();var t=this.locateNextMeaningfulToken(this.position);if(!(t<0||this.tokens[t][m.FIELDS.TYPE]===C.comma||this.tokens[t][m.FIELDS.TYPE]===C.closeParenthesis)){var n,o=this.currToken,i=void 0;if(t>this.position&&(i=this.parseWhitespaceEquivalentTokens(t)),this.isNamedCombinator()?n=this.namedCombinator():this.currToken[m.FIELDS.TYPE]===C.combinator?(n=new v.default({value:this.content(),source:x(this.currToken),sourceIndex:this.currToken[m.FIELDS.START_POS]}),this.position++):N[this.currToken[m.FIELDS.TYPE]]||i||this.unexpected(),n){if(i){var r=this.convertWhitespaceNodesToSpace(i),s=r.space,c=r.rawSpace;n.spaces.before=s,n.rawSpaceBefore=c}}else{var a=this.convertWhitespaceNodesToSpace(i,!0),l=a.space,d=a.rawSpace;d||(d=l);var u={},h={spaces:{}};l.endsWith(" ")&&d.endsWith(" ")?(u.before=l.slice(0,l.length-1),h.spaces.before=d.slice(0,d.length-1)):l.startsWith(" ")&&d.startsWith(" ")?(u.after=l.slice(1),h.spaces.after=d.slice(1)):h.value=d,n=new v.default({value:" ",source:B(o,this.tokens[this.position-1]),sourceIndex:o[m.FIELDS.START_POS],spaces:u,raws:h})}return this.currToken&&this.currToken[m.FIELDS.TYPE]===C.space&&(n.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(n)}var p=this.parseWhitespaceEquivalentTokens(t);if(p.length>0){var f=this.current.last;if(f){var y=this.convertWhitespaceNodesToSpace(p),g=y.space,w=y.rawSpace;void 0!==w&&(f.rawSpaceAfter+=w),f.spaces.after+=g}else p.forEach(function(t){return e.newNode(t)})}},o.comma=function(){if(this.position===this.tokens.length-1)return this.root.trailingComma=!0,void this.position++;this.current._inferEndPosition();var e=new s.default({source:{start:_(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][m.FIELDS.START_POS]});this.current.parent.append(e),this.current=e,this.position++},o.comment=function(){var e=this.currToken;this.newNode(new a.default({value:this.content(),source:x(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++},o.error=function(e,t){throw this.root.error(e,t)},o.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[m.FIELDS.START_POS]})},o.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[m.FIELDS.START_POS])},o.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[m.FIELDS.START_POS])},o.unexpected=function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[m.FIELDS.START_POS])},o.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[m.FIELDS.START_POS])},o.namespace=function(){var e=this.prevToken&&this.content(this.prevToken)||!0;return this.nextToken[m.FIELDS.TYPE]===C.word?(this.position++,this.word(e)):this.nextToken[m.FIELDS.TYPE]===C.asterisk?(this.position++,this.universal(e)):void this.unexpectedPipe()},o.nesting=function(){if(this.nextToken&&"|"===this.content(this.nextToken))this.position++;else{var e=this.currToken;this.newNode(new y.default({value:this.content(),source:x(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++}},o.parentheses=function(){var e=this.current.last,t=1;if(this.position++,e&&e.type===w.PSEUDO){var n=new s.default({source:{start:_(this.tokens[this.position])},sourceIndex:this.tokens[this.position][m.FIELDS.START_POS]}),o=this.current;for(e.append(n),this.current=n;this.position<this.tokens.length&&t;)this.currToken[m.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[m.FIELDS.TYPE]===C.closeParenthesis&&t--,t?this.parse():(this.current.source.end=L(this.currToken),this.current.parent.source.end=L(this.currToken),this.position++);this.current=o}else{for(var i,r=this.currToken,c="(";this.position<this.tokens.length&&t;)this.currToken[m.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[m.FIELDS.TYPE]===C.closeParenthesis&&t--,i=this.currToken,c+=this.parseParenthesisToken(this.currToken),this.position++;e?e.appendToPropertyAndEscape("value",c,c):this.newNode(new u.default({value:c,source:E(r[m.FIELDS.START_LINE],r[m.FIELDS.START_COL],i[m.FIELDS.END_LINE],i[m.FIELDS.END_COL]),sourceIndex:r[m.FIELDS.START_POS]}))}if(t)return this.expected("closing parenthesis",this.currToken[m.FIELDS.START_POS])},o.pseudo=function(){for(var e=this,t="",n=this.currToken;this.currToken&&this.currToken[m.FIELDS.TYPE]===C.colon;)t+=this.content(),this.position++;return this.currToken?this.currToken[m.FIELDS.TYPE]!==C.word?this.expected(["pseudo-class","pseudo-element"],this.currToken[m.FIELDS.START_POS]):void this.splitWord(!1,function(o,i){t+=o,e.newNode(new h.default({value:t,source:B(n,e.currToken),sourceIndex:n[m.FIELDS.START_POS]})),i>1&&e.nextToken&&e.nextToken[m.FIELDS.TYPE]===C.openParenthesis&&e.error("Misplaced parenthesis.",{index:e.nextToken[m.FIELDS.START_POS]})}):this.expected(["pseudo-class","pseudo-element"],this.position-1)},o.space=function(){var e=this.content();0===this.position||this.prevToken[m.FIELDS.TYPE]===C.comma||this.prevToken[m.FIELDS.TYPE]===C.openParenthesis||this.current.nodes.every(function(e){return"comment"===e.type})?(this.spaces=this.optionalSpace(e),this.position++):this.position===this.tokens.length-1||this.nextToken[m.FIELDS.TYPE]===C.comma||this.nextToken[m.FIELDS.TYPE]===C.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(e),this.position++):this.combinator()},o.string=function(){var e=this.currToken;this.newNode(new u.default({value:this.content(),source:x(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++},o.universal=function(e){var t=this.nextToken;if(t&&"|"===this.content(t))return this.position++,this.namespace();var n=this.currToken;this.newNode(new f.default({value:this.content(),source:x(n),sourceIndex:n[m.FIELDS.START_POS]}),e),this.position++},o.splitWord=function(e,t){for(var n=this,o=this.nextToken,i=this.content();o&&~[C.dollar,C.caret,C.equals,C.word].indexOf(o[m.FIELDS.TYPE]);){this.position++;var r=this.content();if(i+=r,r.lastIndexOf("\\")===r.length-1){var s=this.nextToken;s&&s[m.FIELDS.TYPE]===C.space&&(i+=this.requiredSpace(this.content(s)),this.position++)}o=this.nextToken}var a=R(i,".").filter(function(e){var t="\\"===i[e-1],n=/^\d+\.\d+%$/.test(i);return!t&&!n}),u=R(i,"#").filter(function(e){return"\\"!==i[e-1]}),h=R(i,"#{");h.length&&(u=u.filter(function(e){return!~h.indexOf(e)}));var p=(0,g.default)(function(){var e=Array.prototype.concat.apply([],arguments);return e.filter(function(t,n){return n===e.indexOf(t)})}([0].concat(a,u)));p.forEach(function(o,r){var s,h=p[r+1]||i.length,f=i.slice(o,h);if(0===r&&t)return t.call(n,f,p.length);var v=n.currToken,y=v[m.FIELDS.START_POS]+p[r],g=E(v[1],v[2]+o,v[3],v[2]+(h-1));if(~a.indexOf(o)){var C={value:f.slice(1),source:g,sourceIndex:y};s=new c.default(O(C,"value"))}else if(~u.indexOf(o)){var w={value:f.slice(1),source:g,sourceIndex:y};s=new l.default(O(w,"value"))}else{var I={value:f,source:g,sourceIndex:y};O(I,"value"),s=new d.default(I)}n.newNode(s,e),e=null}),this.position++},o.word=function(e){var t=this.nextToken;return t&&"|"===this.content(t)?(this.position++,this.namespace()):this.splitWord(e)},o.loop=function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},o.parse=function(e){switch(this.currToken[m.FIELDS.TYPE]){case C.space:this.space();break;case C.comment:this.comment();break;case C.openParenthesis:this.parentheses();break;case C.closeParenthesis:e&&this.missingParenthesis();break;case C.openSquare:this.attribute();break;case C.dollar:case C.caret:case C.equals:case C.word:this.word();break;case C.colon:this.pseudo();break;case C.comma:this.comma();break;case C.asterisk:this.universal();break;case C.ampersand:this.nesting();break;case C.slash:case C.combinator:this.combinator();break;case C.str:this.string();break;case C.closeSquare:this.missingSquareBracket();case C.semicolon:this.missingBackslash();default:this.unexpected()}},o.expected=function(e,t,n){if(Array.isArray(e)){var o=e.pop();e=e.join(", ")+" or "+o}var i=/^[aeiou]/.test(e[0])?"an":"a";return n?this.error("Expected "+i+" "+e+', found "'+n+'" instead.',{index:t}):this.error("Expected "+i+" "+e+".",{index:t})},o.requiredSpace=function(e){return this.options.lossy?" ":e},o.optionalSpace=function(e){return this.options.lossy?"":e},o.lossySpace=function(e,t){return this.options.lossy?t?" ":"":e},o.parseParenthesisToken=function(e){var t=this.content(e);return e[m.FIELDS.TYPE]===C.space?this.requiredSpace(t):t},o.newNode=function(e,t){return t&&(/^ +$/.test(t)&&(this.options.lossy||(this.spaces=(this.spaces||"")+t),t=!0),e.namespace=t,O(e,"namespace")),this.spaces&&(e.spaces.before=this.spaces,this.spaces=""),this.current.append(e)},o.content=function(e){return void 0===e&&(e=this.currToken),this.css.slice(e[m.FIELDS.START_POS],e[m.FIELDS.END_POS])},o.locateNextMeaningfulToken=function(e){void 0===e&&(e=this.position+1);for(var t=e;t<this.tokens.length;){if(!b[this.tokens[t][m.FIELDS.TYPE]])return t;t++}return-1},t=e,(n=[{key:"currToken",get:function(){return this.tokens[this.position]}},{key:"nextToken",get:function(){return this.tokens[this.position+1]}},{key:"prevToken",get:function(){return this.tokens[this.position-1]}}])&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=D,e.exports=t.default},5238:(e,t,n)=>{let o=n(3152);class i extends o{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=i,i.default=i},5239:(e,t,n)=>{n.d(t,{O:()=>c});var o=n(205),i=n(8562);class r{constructor(e,t,n,o){this.leftNode=null,this.rightNode=null,this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return e;let n=!1;e.value.id==t.value.id&&(n=!0);for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}getMax(e,t){return e>t?e:t}addNode(e,t,n){if(null==t)return(0,i.dispatchIdEvent)(e.value.ofTheConceptId),e;let o=t.leftNode,r=t.rightNode;if(e.key<t.key)t.leftNode=this.addNode(e,o,n);else{if(!(e.key>t.key))return t;t.rightNode=this.addNode(e,r,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let s=this.getBalanceFactor(t);if(s>1&&t.leftNode){if(this.getBalanceFactor(t.leftNode)>=0)return this.rightRotate(t);if(this.getBalanceFactor(t.leftNode)<0)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(s<-1&&t.rightNode){if(this.getBalanceFactor(t.rightNode)<=0)return this.leftRotate(t);if(this.getBalanceFactor(t.rightNode)>0)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=this.getMax(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}throw console.log("this is the error in right rotation",e,t),new Error("Cannot perform right rotation: left node is null.")}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=this.getMax(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=this.getMax(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}throw console.log("this is the error in left rotation",e,t),new Error("Cannot perform left rotation: right node is null.")}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){try{if(t)return e==t.key?(t.value.count?t.value.count++:t.value.count=1,t):e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t}catch(n){console.log("this is the exception",e,t,null==t?void 0:t.leftNode,null==t?void 0:t.rightNode)}return t}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}checkIfIdsInNode(e,t,n,o){if(e){if(t.includes(e.key)){n.push(e.value);let o=t.indexOf(e.key);t.splice(o,1)}e.leftNode&&this.checkIfIdsInNode(e.leftNode,t,n,o),e.rightNode&&this.checkIfIdsInNode(e.rightNode,t,n,o)}}traverse(e){let t=0;return e&&(t+=1,(null==e?void 0:e.leftNode)&&(t+=this.traverse(e.leftNode)),e.rightNode&&(t+=this.traverse(e.rightNode))),t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(new Event(`${e.value.ofTheConceptId}`),(0,i.dispatchIdEvent)(e.value.ofTheConceptId),null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){let t=e.variants[0];if(t)return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class c{static addNodeToTree(e){try{if(null==this.connectionroot)return this.connectionroot=e,this.connectionroot;this.connectionroot=this.connectionroot.addNode(e,this.connectionroot,this.connectionroot.height)}catch(e){throw console.log("This is the error in making the tree",e),e}}static addConnectionToTree(e){let t=new r(e.id,e,null,null);this.addNodeToTree(t)}static traverse(){var e;return null===(e=this.connectionroot)||void 0===e?void 0:e.traverse(this.connectionroot)}static waitForDataToLoad(){return s(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isConnectionLoaded)return e("done");setTimeout(c.checkFlag,1e3,e)}static removeNodeFromTree(e){return s(this,void 0,void 0,function*(){this.connectionroot&&(this.connectionroot=this.connectionroot.removeNode(this.connectionroot,e))})}static getNodeFromTree(e){return s(this,void 0,void 0,function*(){try{return this.connectionroot?this.connectionroot.getFromNode(e,this.connectionroot):this.connectionroot}catch(t){console.log("this is the getNodeFromTree",e,this.connectionroot)}})}static getConnectionListFromIds(e,t,n){return s(this,void 0,void 0,function*(){this.connectionroot&&this.connectionroot.checkIfIdsInNode(this.connectionroot,e,t,n)})}}c.connectionroot=null},5257:(e,t,n)=>{n.d(t,{R:()=>s});var o=n(9003),i=n(3075),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static AddConceptId(e){this.localId=e.value,(0,o.kH)("localid",e)}static getConceptId(){return r(this,void 0,void 0,function*(){try{if(this.localId){if(this.ReservedLocalId.length<5){yield(0,i.EO)().then(()=>{let e=this.localId;for(let t=1;t<10;t++){let n=this.localId-t;this.ReservedLocalId.push(n),e=n}this.AddConceptId({id:0,value:e})}).catch(e=>(console.log(" getid: cannot get the id from indexdb"),-Math.floor(1e8*Math.random())));let e=this.ReservedLocalId[0];return this.ReservedLocalId.shift(),e}{let e=this.ReservedLocalId[0];return this.ReservedLocalId.shift(),e}}return yield(0,i.EO)().then(()=>{let e=this.localId;for(let t=1;t<10;t++){let n=this.localId-t;this.ReservedLocalId.push(n),e=n}this.AddConceptId({id:0,value:e})}),this.getConceptId()}catch(e){return console.log(" getid: this is the eror in concept",e),-Math.floor(1e8*Math.random())}})}static AddConnectionId(e){this.localConnectionId=e.value}static getConnectionId(){return r(this,void 0,void 0,function*(){try{if(this.localConnectionId){if(this.ReservedConnectionId.length<5){yield(0,i.xd)().then(()=>{let e=this.localConnectionId;for(let t=1;t<10;t++){let n=this.localConnectionId-t;this.ReservedConnectionId.push(n),e=n}}).catch(e=>(console.log("this is the new event",e),-Math.floor(1e8*Math.random())));let e=this.ReservedConnectionId[0];return this.ReservedConnectionId.shift(),e}{let e=this.ReservedConnectionId[0];return this.ReservedConnectionId.shift(),e}}return yield(0,i.xd)().then(()=>{let e=this.localConnectionId;for(let t=1;t<10;t++){let n=this.localConnectionId-t;this.ReservedConnectionId.push(n),e=n}this.AddConnectionId({id:1,value:e})}),this.getConnectionId()}catch(e){return-Math.floor(1e8*Math.random())}})}}s.ReservedLocalId=[],s.ReservedConnectionId=[]},5284:(e,t,n)=>{n.d(t,{B:()=>c});var o=n(8562),i=n(8286),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(){return s(this,arguments,void 0,function*(e=[]){const t=o.Logger.logfunction("FindConnectionsOfCompositionsBulkInMemory",[e.length])||{};let n=[];try{if(o.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,o.sendMessage)("FindConnectionsOfCompositionsBulkInMemory",{composition_ids:e});return o.Logger.logUpdate(t),n.data}catch(e){console.error("FindConnectionsOfCompositionsBulkInMemory sw error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),(0,o.handleServiceWorkerException)(e)}}for(let t=0;t<e.length;t++){let o=yield i.d.GetConnectionsOfConcept(e[t]);n.push(...o)}return o.Logger.logUpdate(t),n}catch(e){return console.error("FindConnectionsOfCompositionsBulkInMemory error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),n}})}},5286:(e,t)=>{function n(e){for(var t=e.toLowerCase(),n="",o=!1,i=0;i<6&&void 0!==t[i];i++){var r=t.charCodeAt(i);if(o=32===r,!(r>=97&&r<=102||r>=48&&r<=57))break;n+=t[i]}if(0!==n.length){var s=parseInt(n,16);return s>=55296&&s<=57343||0===s||s>1114111?["�",n.length+(o?1:0)]:[String.fromCodePoint(s),n.length+(o?1:0)]}}t.__esModule=!0,t.default=function(e){if(!o.test(e))return e;for(var t="",i=0;i<e.length;i++)if("\\"!==e[i])t+=e[i];else{var r=n(e.slice(i+1,i+7));if(void 0!==r){t+=r[0],i+=r[1];continue}if("\\"===e[i+1]){t+="\\",i++;continue}e.length===i+1&&(t+=e[i])}return t};var o=/\\/;e.exports=t.default},5312:(e,t,n)=>{n.d(t,{NK:()=>h,Ve:()=>p,cf:()=>d,vw:()=>f,y8:()=>u});var o=n(2832),i=n(3130),r=n(8562),s=n(1863),c=n(6687),a=n(1320),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,arguments,void 0,function*(e,n="",d=null,h=i.y0){var p,v,y,g,m,C,w,I;const T=r.Logger.logfunction("SearchLinkMultipleAll",t)||{};try{try{if(r.serviceWorker){T.serviceWorker=!0;const t=yield(0,r.sendMessage)("SearchLinkMultipleAll",{searchQuery:e,token:n,caller:d,format:h});return r.Logger.logUpdate(T),t.data}}catch(e){console.error("SearchLinkMultipleAll error sw: ",e),(0,s.ey)(T,"SearchLinkMultipleAll",e),(0,r.handleServiceWorkerException)(e)}let t=[],k=[],A=[],S=[],N=e[0].composition,b={},_={};(null==d?void 0:d.isDataLoaded)?(b.compositionIds=null===(p=d.conceptIds)||void 0===p?void 0:p.slice(),b.internalConnections=null===(v=d.internalConnections)||void 0===v?void 0:v.slice(),b.linkers=null===(y=d.linkers)||void 0===y?void 0:y.slice(),b.reverse=null===(g=d.reverse)||void 0===g?void 0:g.slice(),_=b,t=_.compositionIds,A=_.internalConnections,k=_.linkers,S=_.reverse):(b=yield(0,o.j)(e,n),d&&(d.conceptIds=null===(m=b.compositionIds)||void 0===m?void 0:m.slice(),d.internalConnections=null===(C=b.internalConnections)||void 0===C?void 0:C.slice(),d.linkers=null===(w=b.linkers)||void 0===w?void 0:w.slice(),d.reverse=null===(I=b.reverse)||void 0===I?void 0:I.slice(),d.isDataLoaded=!0),_=b,t=_.compositionIds,A=_.internalConnections,k=_.linkers,S=_.reverse);let L=yield function(e,t,n,o,r,s){return l(this,arguments,void 0,function*(e,t,n,o,r,s,l=i.y0){try{let d,h,p=yield(0,c.QL)(e);return l==i.ZJ?(d=yield(0,c.MT)(t,n),h=yield f(e,d,r,o)):l==i.yv?(d=yield(0,c.D)(t,n),h=yield f(e,d,r,o)):100==l?(d=yield(0,c.nr)(t,n),h=yield u(p,d,r,o)):l==i.SL?h=yield(0,a._W)(e,t,n,s.ofCompositions,o):(d=yield(0,c.rv)(t,n),h=yield u(p,d,r,o)),h}catch(e){return void console.log("Error Occured in build layer",e)}})}(k,t,A,S,N,e[0],h);return r.Logger.logUpdate(T),L}catch(e){throw console.log("this is the error in the search link multiple",e),(0,s.ey)(T,"SearchLinkMultipleAll",e),e}})}function u(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){(new Date).getTime();let i={},s=[];for(let t=0;t<e.length;t++)s.push(e[t].toTheConceptId),s.push(e[t].ofTheConceptId),s.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;if(o.includes(e[n].id)&&(i=!0),1==i){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{let o=i.characterValue+"_reverse";"string"==typeof s&&(s={}),Array.isArray(s[c][o])||("string"==typeof s[c]&&(s[c]={}),s[c][o]=[]),s[c][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{"string"==typeof s&&(s={}),Array.isArray(s[c][i.characterValue])||("string"==typeof s[c]&&(s[c]={}),s[c][i.characterValue]=[]),s[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i})}function h(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){let i=[],s=[];for(let t=0;t<e.length;t++)s.push(e[t].toTheConceptId),s.push(e[t].ofTheConceptId),s.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;if(o.includes(e[n].id)&&(i=!0),1==i){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=Object.keys(o)[0];try{let r=i.characterValue+"_reverse";"string"==typeof o&&(o={}),Array.isArray(o[s][r])||("string"==typeof o[s]&&(o[s]={}),o[s][r]=[]),o[s][r].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=Object.keys(o)[0];try{"string"==typeof o&&(o={}),Array.isArray(o[s][i.characterValue])||("string"==typeof o[s]&&(o[s]={}),o[s][i.characterValue]=[]),o[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let o=t[n[e]];o&&i.push(o)}return i})}function p(e,t,n,o){return l(this,arguments,void 0,function*(e,t,n,o,i=[]){(new Date).getTime();let s=[],c=[];for(let t=0;t<e.length;t++)c.push(e[t].toTheConceptId),c.push(e[t].ofTheConceptId),c.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let o=!1;if(i.includes(e[n].id)&&(o=!0),1==o){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{let o=i.characterValue+"_reverse";"string"==typeof s&&(s={}),Array.isArray(s[c][o])||("string"==typeof s[c]&&(s[c]={}),s[c][o]=[]),s[c][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{"string"==typeof s&&(s={}),Array.isArray(s[c][i.characterValue])||("string"==typeof s[c]&&(s[c]={}),s[c][i.characterValue]=[]),s[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<o.length;e++){let n=t[o[e]];n&&s.push(n)}return s})}function f(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){let i={},s=yield(0,r.GetConnectionBulk)(e),c=[];for(let e=0;e<s.length;e++)c.push(s[e].toTheConceptId),c.push(s[e].ofTheConceptId),c.push(s[e].typeId);yield(0,r.GetConceptBulk)(c),s.sort(function(e,t){return t.id-e.id});for(let e=0;e<s.length;e++){let n=!1;if(o.includes(s[e].id)&&(n=!0),1==n){if(t[s[e].ofTheConceptId]&&t[s[e].toTheConceptId]){let n=t[s[e].toTheConceptId],o=yield(0,r.GetTheConcept)(s[e].typeId),i=n,c=Object.keys(i)[0];try{let n=o.characterValue+"_reverse";"string"==typeof i&&(i={}),Array.isArray(i[c][n])||("string"==typeof i[c]&&(i[c]={}),i[c][n]=[]),i[c][n].push(t[s[e].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[s[e].ofTheConceptId]&&t[s[e].toTheConceptId]){let n=t[s[e].ofTheConceptId],o=yield(0,r.GetTheConcept)(s[e].typeId),i=n,c=Object.keys(i)[0];try{"string"==typeof i&&(i={}),Array.isArray(i[c][o.characterValue])||("string"==typeof i[c]&&(i[c]={}),i[c][o.characterValue]=[]),i[c][o.characterValue].push(t[s[e].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i})}},5328:(e,t,n)=>{n.d(t,{d:()=>l});var o=n(8562),i=n(3130),r=n(8939),s=n(4287),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a extends s.w{constructor(e,t,n,o,i){super(),this.connections=[],this.data=[],this.mainConcept=e,this.linker=t,this.inpage=n,this.page=o,this.format=i}bind(){return c(this,void 0,void 0,function*(){var e;if(!this.isDataLoaded){let i=yield(0,o.GetTheConcept)(this.mainConcept),r=(null===(e=i.type)||void 0===e?void 0:e.characterValue)+"_s_"+this.linker,s=yield(0,o.GetConceptByCharacterAndType)(r,16);if(s.id>0){let e=yield(0,o.GetConnectionOfTheConcept)(s.id,i.id,i.userId,this.inpage,this.page);this.connections=e;for(var t=[],n=0;n<this.connections.length;n++)t.push(this.connections[n].toTheConceptId),this.linkers.push(this.connections[n].id),this.listenToEvent(this.connections[n].toTheConceptId);yield(0,o.GetAllConnectionsOfCompositionBulk)(t)}this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return c(this,void 0,void 0,function*(){this.data=[],this.connections=yield(0,o.GetConnectionBulk)(this.linkers);for(var e=0;e<this.connections.length;e++){let t=this.connections[e].toTheConceptId,n=yield(0,o.GetTheConcept)(t);if(console.log("this is the format",this.format),this.format==i.yv){let e=yield(0,r.RW)(n.id);this.data.push(e)}else if(this.format==i.ZJ){let e=yield(0,r.kx)(n.id);this.data.push(e)}else if(this.format==i.iw){let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}else{let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}}return this.data})}}function l(e,t,n,o,r=i.yv){return new a(e,t,n,o,r)}},5457:(e,t,n)=>{n.d(t,{c:()=>a});var o=n(8562),i=n(7282),r=n(205);class s{constructor(e,t){this.value=[],this.height=1,this.key=e,this.value.push(t),this.leftNode=null,this.rightNode=null,this.currentNode=null}addType(e,t,n){var i,r,c,a;if(null==e)return(0,o.dispatchIdEvent)(t,{detail:n}),new s(t,n);if(t<e.key)e.leftNode=this.addType(e.leftNode,t,n);else{if(!(t>e.key))return e.value.includes(n)||((0,o.dispatchIdEvent)(t,{detail:n}),e.value.push(n)),e;e.rightNode=this.addType(e.rightNode,t,n)}e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1;const l=this.getBalanceFactor(e);return l>1&&t<(null===(i=e.leftNode)||void 0===i?void 0:i.key)?this.rightRotate(e):l<-1&&t>(null===(r=e.rightNode)||void 0===r?void 0:r.key)?this.leftRotate(e):l>1&&t>(null===(c=e.leftNode)||void 0===c?void 0:c.key)?(e.leftNode=this.leftRotate(e.leftNode),this.rightRotate(e)):l<-1&&t<(null===(a=e.rightNode)||void 0===a?void 0:a.key)?(e.rightNode=this.rightRotate(e.rightNode),this.leftRotate(e)):e}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.value.length>0)for(let t=0;t<e.value.length;t++)if(n==e.value[t])return e.value.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static addType(e){return c(this,void 0,void 0,function*(){return null==this.root?(this.root=e,new CustomEvent(`${e.key}`,{detail:e.value[0]}),(0,o.dispatchIdEvent)(e.key,{detail:e.value[0]}),this.root):(this.root=this.root.addType(this.root,e.key,e.value[0]),this.root)})}static addConceptToTree(e){if(0!=e.typeId){let t=new s(e.typeId,e.id);this.addType(t)}}static removeTypeConcept(e,t){this.root&&(this.root=this.root.removeNodeWithVariants(this.root,e,t))}static getNodeFromTreeNew(e){return this.root?this.root.getFromNode(e,this.root):this.root}static getTypeVariantsFromTreeNew(e){return c(this,void 0,void 0,function*(){let t=this.getNodeFromTreeNew(e),n=[],i=[];if(t){n=t.value;for(let e=0;e<n.length;e++){let t=!1;for(let o=0;o<i.length;o++)i[o].id==n[e]&&(t=!0);t||i.push(yield(0,o.GetTheConcept)(n[e]))}}return i})}static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isTypeLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserIdNew(e,t){return c(this,void 0,void 0,function*(){let n=[],o=yield this.getTypeVariantsFromTreeNew(e);console.log("these are all the concepts",o);for(let e=0;e<o.length;e++)o[e].userId==t&&n.push(o[e]);return n})}static getTypeVariantsWithCharacterValueNew(e,t){return c(this,void 0,void 0,function*(){let n=yield this.getTypeVariantsFromTreeNew(t);console.log("this is all the concepts for character",n);let o=(0,i.o)();for(let t=0;t<n.length;t++)n[t].characterValue==e&&(o=n[t]);return o})}static countNumberOfNodes(){return this.typeRoot?this.typeRoot.countNodeBelow(this.typeRoot):0}}a.typeRoot=null,a.root=null},5588:(e,t,n)=>{t.__esModule=!0,t.default=void 0,t.unescapeValue=y;var o,i=a(n(8937)),r=a(n(5286)),s=a(n(3295)),c=n(1581);function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var u=n(4643),h=/^('|")([^]*)\1$/,p=u(function(){},"Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."),f=u(function(){},"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."),v=u(function(){},"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");function y(e){var t=!1,n=null,o=e,i=o.match(h);return i&&(n=i[1],o=i[2]),(o=(0,r.default)(o))!==e&&(t=!0),{deprecatedUsage:t,unescaped:o,quoteMark:n}}var g=function(e){var t,n;function o(t){var n;return void 0===t&&(t={}),n=e.call(this,function(e){if(void 0!==e.quoteMark)return e;if(void 0===e.value)return e;v();var t=y(e.value),n=t.quoteMark,o=t.unescaped;return e.raws||(e.raws={}),void 0===e.raws.value&&(e.raws.value=e.value),e.value=o,e.quoteMark=n,e}(t))||this,n.type=c.ATTRIBUTE,n.raws=n.raws||{},Object.defineProperty(n.raws,"unquoted",{get:u(function(){return n.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:u(function(){return n.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")}),n._constructed=!0,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,d(t,n);var r,s,a=o.prototype;return a.getQuotedValue=function(e){void 0===e&&(e={});var t=this._determineQuoteMark(e),n=m[t];return(0,i.default)(this._value,n)},a._determineQuoteMark=function(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)},a.setValue=function(e,t){void 0===t&&(t={}),this._value=e,this._quoteMark=this._determineQuoteMark(t),this._syncRawValue()},a.smartQuoteMark=function(e){var t=this.value,n=t.replace(/[^']/g,"").length,r=t.replace(/[^"]/g,"").length;if(n+r===0){var s=(0,i.default)(t,{isIdentifier:!0});if(s===t)return o.NO_QUOTE;var c=this.preferredQuoteMark(e);if(c===o.NO_QUOTE){var a=this.quoteMark||e.quoteMark||o.DOUBLE_QUOTE,l=m[a];if((0,i.default)(t,l).length<s.length)return a}return c}return r===n?this.preferredQuoteMark(e):r<n?o.DOUBLE_QUOTE:o.SINGLE_QUOTE},a.preferredQuoteMark=function(e){var t=e.preferCurrentQuoteMark?this.quoteMark:e.quoteMark;return void 0===t&&(t=e.preferCurrentQuoteMark?e.quoteMark:this.quoteMark),void 0===t&&(t=o.DOUBLE_QUOTE),t},a._syncRawValue=function(){var e=(0,i.default)(this._value,m[this.quoteMark]);e===this._value?this.raws&&delete this.raws.value:this.raws.value=e},a._handleEscapes=function(e,t){if(this._constructed){var n=(0,i.default)(t,{isIdentifier:!0});n!==t?this.raws[e]=n:delete this.raws[e]}},a._spacesFor=function(e){var t=this.spaces[e]||{},n=this.raws.spaces&&this.raws.spaces[e]||{};return Object.assign({before:"",after:""},t,n)},a._stringFor=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=C);var o=this._spacesFor(t);return n(this.stringifyProperty(e),o)},a.offsetOf=function(e){var t=1,n=this._spacesFor("attribute");if(t+=n.before.length,"namespace"===e||"ns"===e)return this.namespace?t:-1;if("attributeNS"===e)return t;if(t+=this.namespaceString.length,this.namespace&&(t+=1),"attribute"===e)return t;t+=this.stringifyProperty("attribute").length,t+=n.after.length;var o=this._spacesFor("operator");t+=o.before.length;var i=this.stringifyProperty("operator");if("operator"===e)return i?t:-1;t+=i.length,t+=o.after.length;var r=this._spacesFor("value");t+=r.before.length;var s=this.stringifyProperty("value");return"value"===e?s?t:-1:(t+=s.length,t+=r.after.length,t+=this._spacesFor("insensitive").before.length,"insensitive"===e&&this.insensitive?t:-1)},a.toString=function(){var e=this,t=[this.rawSpaceBefore,"["];return t.push(this._stringFor("qualifiedAttribute","attribute")),this.operator&&(this.value||""===this.value)&&(t.push(this._stringFor("operator")),t.push(this._stringFor("value")),t.push(this._stringFor("insensitiveFlag","insensitive",function(t,n){return!(t.length>0)||e.quoted||0!==n.before.length||e.spaces.value&&e.spaces.value.after||(n.before=" "),C(t,n)}))),t.push("]"),t.push(this.rawSpaceAfter),t.join("")},r=o,(s=[{key:"quoted",get:function(){var e=this.quoteMark;return"'"===e||'"'===e},set:function(e){f()}},{key:"quoteMark",get:function(){return this._quoteMark},set:function(e){this._constructed?this._quoteMark!==e&&(this._quoteMark=e,this._syncRawValue()):this._quoteMark=e}},{key:"qualifiedAttribute",get:function(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function(){return this.insensitive?"i":""}},{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=y(e),n=t.deprecatedUsage,o=t.unescaped,i=t.quoteMark;if(n&&p(),o===this._value&&i===this._quoteMark)return;this._value=o,this._quoteMark=i,this._syncRawValue()}else this._value=e}},{key:"insensitive",get:function(){return this._insensitive},set:function(e){e||(this._insensitive=!1,!this.raws||"I"!==this.raws.insensitiveFlag&&"i"!==this.raws.insensitiveFlag||(this.raws.insensitiveFlag=void 0)),this._insensitive=e}},{key:"attribute",get:function(){return this._attribute},set:function(e){this._handleEscapes("attribute",e),this._attribute=e}}])&&l(r.prototype,s),Object.defineProperty(r,"prototype",{writable:!1}),o}(s.default);t.default=g,g.NO_QUOTE=null,g.SINGLE_QUOTE="'",g.DOUBLE_QUOTE='"';var m=((o={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}}).null={isIdentifier:!0},o);function C(e,t){return""+t.before+e+t.after}},5644:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s,r.registerRoot(s)},5781:e=>{const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),i="/".charCodeAt(0),r="\n".charCodeAt(0),s=" ".charCodeAt(0),c="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),d="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),v="}".charCodeAt(0),y=";".charCodeAt(0),g="*".charCodeAt(0),m=":".charCodeAt(0),C="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,I=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,T=/.[\r\n"'(/\\]/,k=/[\da-f]/i;e.exports=function(e,A={}){let S,N,b,_,L,E,x,B,O,R,D=e.css.valueOf(),G=A.ignoreErrors,P=D.length,F=0,U=[],M=[];function W(t){throw e.error("Unclosed "+t,F)}return{back:function(e){M.push(e)},endOfFile:function(){return 0===M.length&&F>=P},nextToken:function(e){if(M.length)return M.pop();if(F>=P)return;let A=!!e&&e.ignoreUnclosed;switch(S=D.charCodeAt(F),S){case r:case s:case a:case l:case c:_=F;do{_+=1,S=D.charCodeAt(_)}while(S===s||S===r||S===a||S===l||S===c);E=["space",D.slice(F,_)],F=_-1;break;case d:case u:case f:case v:case m:case y:case p:{let e=String.fromCharCode(S);E=[e,e,F];break}case h:if(R=U.length?U.pop()[1]:"",O=D.charCodeAt(F+1),"url"===R&&O!==t&&O!==n&&O!==s&&O!==r&&O!==a&&O!==c&&O!==l){_=F;do{if(x=!1,_=D.indexOf(")",_+1),-1===_){if(G||A){_=F;break}W("bracket")}for(B=_;D.charCodeAt(B-1)===o;)B-=1,x=!x}while(x);E=["brackets",D.slice(F,_+1),F,_],F=_}else _=D.indexOf(")",F+1),N=D.slice(F,_+1),-1===_||T.test(N)?E=["(","(",F]:(E=["brackets",N,F,_],F=_);break;case t:case n:L=S===t?"'":'"',_=F;do{if(x=!1,_=D.indexOf(L,_+1),-1===_){if(G||A){_=F+1;break}W("string")}for(B=_;D.charCodeAt(B-1)===o;)B-=1,x=!x}while(x);E=["string",D.slice(F,_+1),F,_],F=_;break;case C:w.lastIndex=F+1,w.test(D),_=0===w.lastIndex?D.length-1:w.lastIndex-2,E=["at-word",D.slice(F,_+1),F,_],F=_;break;case o:for(_=F,b=!0;D.charCodeAt(_+1)===o;)_+=1,b=!b;if(S=D.charCodeAt(_+1),b&&S!==i&&S!==s&&S!==r&&S!==a&&S!==l&&S!==c&&(_+=1,k.test(D.charAt(_)))){for(;k.test(D.charAt(_+1));)_+=1;D.charCodeAt(_+1)===s&&(_+=1)}E=["word",D.slice(F,_+1),F,_],F=_;break;default:S===i&&D.charCodeAt(F+1)===g?(_=D.indexOf("*/",F+2)+1,0===_&&(G||A?_=D.length:W("comment")),E=["comment",D.slice(F,_+1),F,_],F=_):(I.lastIndex=F+1,I.test(D),_=0===I.lastIndex?D.length-1:I.lastIndex-2,E=["word",D.slice(F,_+1),F,_],U.push(E),F=_)}return F++,E},position:function(){return F}}}},5799:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.STRING,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},5868:(e,t,n)=>{n.d(t,{k:()=>l});var o=n(3077),i=n(8357),r=n(9736),s=n(8562),c=n(1863),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t){var n=arguments;return a(this,arguments,void 0,function*(e,t,a=!1,l,d,u=999,h=0,p={concepts:[],connections:[]}){var f,v,y,g;0==a&&(l=999);const m=s.Logger.logfunction("MakeTheInstanceConceptLocal",n)||{};if(s.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,s.sendMessage)("MakeTheInstanceConceptLocal",{type:e,referent:t,composition:a,userId:l,accessId:d,sessionInformationId:u,referentId:h,actions:p});return(null===(v=null===(f=null==n?void 0:n.actions)||void 0===f?void 0:f.concepts)||void 0===v?void 0:v.length)&&(p.concepts=JSON.parse(JSON.stringify(n.actions.concepts))),(null===(g=null===(y=null==n?void 0:n.actions)||void 0===y?void 0:y.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(n.actions.connections))),s.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConceptLocal error sw: ",e),(0,c.ey)(m,"MakeTheInstanceConceptLocal",e),(0,s.handleServiceWorkerException)(e)}}try{let n,c,d=999,u=4,f=l,v=4,y="",g=t.length;if(y=e.startsWith("the_")?e:"the_"+e,a)n=yield(0,i.$)(e,d,l,l,p),c=yield(0,o.A)(t,e,l,u,n.id,v,!0,h,p);else if(g>255)n=yield(0,i.$)(y,d,f,l,p),c=yield(0,o.A)(t,y,l,u,n.id,v,void 0,void 0,p);else{n=yield(0,i.$)(y,d,f,l,p);let e=yield r.v.GetConceptByCharacterAndTypeLocal(t,n.id);c=e,0==e.id&&0==e.userId&&(c=yield(0,o.A)(t,y,l,u,n.id,v,void 0,void 0,p))}return c.type=n,s.LocalSyncData.AddConcept(c),p.concepts.push(c),s.Logger.logUpdate(m),c}catch(e){throw(0,c.ey)(m,"MakeTheInstanceConceptLocal",e),e}})}},5976:(e,t,n)=>{n.d(t,{p:()=>l,B:()=>a});var o=n(9581),i=n(3518),r=n(1863),s=n(8562),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static getId(){return c(this,void 0,void 0,function*(){this.ids.length<5&&(yield function(){var e,t,n,c,l=arguments;return e=this,t=void 0,c=function*(){const e=s.Logger.logfunction("GetReservedIds",l);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const c=yield n.json();for(let e=0;e<c.length;e++)a.AddId(c[e]);s.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved ids error message: ",t.message):console.log("get reserved ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedIdUrl()),(0,r.ey)(e,"GetReservedIds",t)}},new((n=void 0)||(n=Promise))(function(o,i){function r(e){try{a(c.next(e))}catch(e){i(e)}}function s(e){try{a(c.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,s)}a((c=c.apply(e,t||[])).next())})}());var e=this.ids[0];return this.ids.shift(),e})}static AddId(e){this.ids.includes(e)||this.ids.push(e)}}a.ids=[];class l{static getId(){return c(this,void 0,void 0,function*(){this.connectionIds.length<5&&(yield function(){var e,t,n,c,a=arguments;return e=this,t=void 0,c=function*(){const e=s.Logger.logfunction("GetReservedConnectionIds",a);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedConnectionIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const c=yield n.json();for(let e=0;e<c.length;e++)l.AddId(c[e]);s.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved connection ids error message: ",t.message):console.log("get reserved connection ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedConnectionIdUrl()),(0,r.ey)(e,"GetReservedConnectionIds",t)}},new((n=void 0)||(n=Promise))(function(o,i){function r(e){try{a(c.next(e))}catch(e){i(e)}}function s(e){try{a(c.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,s)}a((c=c.apply(e,t||[])).next())})}());var e=this.connectionIds[0];return this.connectionIds.shift(),e})}static AddId(e){this.connectionIds.includes(e)||this.connectionIds.push(e)}}l.connectionIds=[]},6058:(e,t,n)=>{n.d(t,{W:()=>c});var o=n(1863),i=n(3518),r=n(8562),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e){var t=arguments;return s(this,void 0,void 0,function*(){const n=r.Logger.logfunction("GetAllLinkerConnectionsToTheConcept",t);var s=[];try{(new Date).getTime();var c=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionToConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:c});if(t.ok){const e=yield t.json();for(var a=0;a<e.length;a++){var l=e[a];s.push(l)}r.Logger.logUpdate(n)}else console.log("Get all linker connection To the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection To the concepts error: ",e.message):console.log("Get all linker connection To the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionToConceptUrl()),(0,o.ey)(n,"GetAllLinkerConnectionsToTheConcept",e)}return s})}},6156:e=>{let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},6291:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();if(!e[i])return;e=e[i]}return e},e.exports=t.default},6416:(e,t,n)=>{n.d(t,{u:()=>i});var o=n(2615);function i(){let e=new Date,t=new Date;return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}},6467:(e,t,n)=>{function o(e){const t=e.lastIndexOf("_");let n=[];return n=t>0?[e.substring(0,t),e.substring(t+1,e.length)]:[e],n}n.d(t,{f:()=>o})},6687:(e,t,n)=>{n.d(t,{D:()=>I,MT:()=>w,Nt:()=>f,QL:()=>g,as:()=>v,cw:()=>u,dF:()=>d,hG:()=>y,km:()=>p,nr:()=>C,p8:()=>h,rv:()=>m});var o=n(8642),i=n(7467),r=n(8562),s=n(1863),c=n(5284),a=n(8939),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(){return l(this,arguments,void 0,function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.kx)(e[n]);t.push(o)}return t})}function u(){return l(this,arguments,void 0,function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.RW)(e[n]);t.push(o)}return t})}function h(){return l(this,arguments,void 0,function*(e=[],t=[]){const n=r.Logger.logfunction("GetCompositionFromConnectionsWithDataId",[e])||{};if(r.serviceWorker){n.serviceWorker=!0;try{const o=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataId",{conceptIds:e,connectionIds:t});return r.Logger.logUpdate(n),o.data}catch(e){console.error("GetCompositionFromConnectionsWithDataId error sw: ",e),(0,s.ey)(n,"GetCompositionFromConnectionsWithDataId",e),(0,r.handleServiceWorkerException)(e)}}let o=[];for(let t=0;t<e.length;t++){let n=yield(0,a.RW)(e[t]);o.push(n)}return r.Logger.logUpdate(n),o})}function p(){var e=arguments;return l(this,arguments,void 0,function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdFromConnections",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdFromConnections",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdFromConnections error sw: ",e),(0,s.ey)(o,"GetCompositionFromConnectionsWithDataIdFromConnections",e),(0,r.handleServiceWorkerException)(e)}}let c=yield(0,i.j)(n),l=[];for(let e=0;e<t.length;e++){let n=yield(0,a.PT)(t[e],c);l.push(n)}return r.Logger.logUpdate(o),l})}function f(){var e=arguments;return l(this,arguments,void 0,function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdIndex",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdIndex",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdIndex error sw: ",e),(0,s.ey)(o,"GetCompositionFromConnectionsWithDataIdIndex",e),(0,r.handleServiceWorkerException)(e)}}yield(0,i.j)(n),yield(0,c.B)(t);let l={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);l[t[e]]=n}return r.Logger.logUpdate(o),l})}function v(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t),yield(0,c.B)(e);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n})}function y(){return l(this,arguments,void 0,function*(e=[],t=[]){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetCompositionFromConnectionsWithIndexFromConnections",{conceptIds:e,connectionIds:t})).data}catch(e){console.error("GetCompositionFromConnectionsWithIndexFromConnections error sw: ",e),(0,r.handleServiceWorkerException)(e)}let n=yield(0,i.j)(t),o=[];for(let t=0;t<e.length;t++){let i=yield(0,a.JA)(e[t],n);o[e[t]]=i}return o})}function g(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=r.Logger.logfunction("GetConnectionDataPrefetch",t)||{};if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConnectionDataPrefetch",{connectionIds:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionDataPrefetch error sw: ",e),(0,s.ey)(n,"GetConnectionDataPrefetch",e),(0,r.handleServiceWorkerException)(e)}}const o=yield Promise.all(e.map(e=>r.ConnectionData.GetConnection(e))),c=[],a=[];for(let t=0;t<o.length;t++){const n=o[t];0===(null==n?void 0:n.id)?a.push(e[t]):c.push(n)}const l=yield(0,i.j)(a),d=[...c,...l],u=new Set;for(const e of d)u.add(e.ofTheConceptId),u.add(e.toTheConceptId),u.add(e.typeId);return yield(0,r.GetConceptBulk)([...u]),r.Logger.logUpdate(n),d})}function m(){var e=arguments;return l(this,arguments,void 0,function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdInObject",e);yield(0,i.j)(n);let s={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);s[t[e]]=n}return r.Logger.logUpdate(o),s})}function C(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.$N)(e[t]);n[e[t]]=o}return n})}function w(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n})}function I(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.XI)(e[t]);n[e[t]]=o,console.log("this is the normal data",e[t],o)}return n})}},6731:(e,t,n)=>{n.d(t,{b:()=>o});class o{constructor(e,t,n,o){this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return e;let n=!1;for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}checkIfIdsInNode(e,t,n,o){if(e){if(t.includes(e.key)){n.push(e.value);let o=t.indexOf(e.key);t.splice(o,1)}e.leftNode&&this.checkIfIdsInNode(e.leftNode,t,n,o),e.rightNode&&this.checkIfIdsInNode(e.rightNode,t,n,o)}}addCharacterNode(e,t,n){if(""!=e.value.characterValue){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addCharacterNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&""!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addCharacterNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return console.log("adding the type node to the tree",e),e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return console.log("adding the type node to the tree down",e),t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),console.log("adding the type node to the tree last",t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getCharacterFromNodeUpdated(e,t){var n;return t?e==t.key||51==(null===(n=t.value)||void 0===n?void 0:n.typeId)?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getFromNodeWithCharacterAndType(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.typeId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.typeId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndType(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndType(e,t,n.rightNode)}return null}return n}getFromNodeWithCharacterAndCategory(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.categoryId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.categoryId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.rightNode)}return null}return n}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){let t=e.variants[0];if(t)return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}},6846:(e,t,n)=>{let o=n(145),i=n(6966),r=n(4211),s=n(5644);class c{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new i(this,e,t):new r(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=c,c.default=c,s.registerProcessor(c),o.registerProcessor(c)},6915:(e,t,n)=>{function o(e,t="DESC"){return"ASC"==t?e.sort(function(e,t){return e.id-t.id}):e.sort(function(e,t){return t.id-e.id}),e}n.d(t,{X:()=>o})},6963:(e,t,n)=>{n.d(t,{f:()=>s});var o=n(205),i=n(6731),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static waitForDataToLoad(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isCharacterLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static addNodeToTree(e){return r(this,void 0,void 0,function*(){return null==this.characterRoot?(this.characterRoot=e,this.characterRoot):(this.characterRoot=this.characterRoot.addCharacterNode(e,this.characterRoot,this.characterRoot.height),this.characterRoot)})}static removeNodeByCharacter(e,t){return r(this,void 0,void 0,function*(){this.characterRoot&&this.characterRoot.removeNodeWithVariants(this.characterRoot,e,t)})}static countNumberOfNodes(){return this.characterRoot?this.characterRoot.countNodeBelow(this.characterRoot):0}static addConceptToTree(e){if(""!=e.characterValue){var t=new i.b(e.characterValue,e,null,null);this.addNodeToTree(t)}}static getNodeFromTree(e){return this.characterRoot?this.characterRoot.getCharacterFromNode(e,this.characterRoot):this.characterRoot}static getNodeFromTreeUpdated(e){return this.characterRoot?this.characterRoot.getCharacterFromNode(e,this.characterRoot):this.characterRoot}static getCharacterAndTypeFromTree(e,t){return r(this,void 0,void 0,function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndType(e,t,this.characterRoot):this.characterRoot})}static getCharacterAndCategoryFromTree(e,t){return r(this,void 0,void 0,function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndCategory(e,t,this.characterRoot):this.characterRoot})}static removeConceptCharacter(e){this.characterRoot&&(this.characterRoot=this.characterRoot.removeNode(this.characterRoot,e))}}s.characterRoot=null},6966:(e,t,n)=>{let o=n(7793),i=n(145),r=n(3604),s=n(9577),c=n(3717),a=n(5644),l=n(3303),{isClean:d,my:u}=n(4151);n(6156);const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function v(e){return"object"==typeof e&&"function"==typeof e.then}function y(e){let t=!1,n=h[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:y(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(e){return e[d]=!1,e.nodes&&e.nodes.forEach(e=>m(e)),e}let C={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof w||t instanceof c)i=m(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(t,n)}catch(e){this.processed=!0,this.error=e}i&&!i[u]&&o.rebuild(i)}else i=m(t);this.result=new c(e,i,n),this.helpers={...C,postcss:C,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!p[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let o in t[n])e(t,"*"===o?n:n+"-"+o.toLowerCase(),t[n][o]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(v(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[d];){e[d]=!0;let t=[g(e)];for(;t.length>0;){let e=this.visitTick(t);if(v(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return v(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=l;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(v(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[d];)e[d]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,o]of e){let e;this.result.lastPlugin=n;try{e=o(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:o}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(o.length>0&&t.visitorIndex<o.length){let[e,i]=o[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===o.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let o,i=t.iterator;for(;o=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!o[d])return o[d]=!0,void e.push(g(o));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[d]=!0;let t=y(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[d]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}w.registerPostcss=e=>{C=e},e.exports=w,w.default=w,a.registerLazyResult(w),i.registerLazyResult(w)},7071:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.ID,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o.prototype.valueToString=function(){return"#"+e.prototype.valueToString.call(this)},o}(i.default);t.default=c,e.exports=t.default},7139:(e,t,n)=>{n.d(t,{r:()=>d});var o=n(3026),i=n(9581),r=n(8562),s=n(1863),c=n(1596),a=n(3278),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=r.Logger.logfunction("GetConcept",t)||{};let d=(0,r.CreateDefaultConcept)();const u=new FormData;u.append("id",e.toString());try{if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConcept",{id:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConcept sw error: ",e),(0,s.ey)(n,"GetConcept",e),(0,r.handleServiceWorkerException)(e)}}if(0==e||null==e||null==e)return d;var h=yield o.I.GetConcept(e);let t=o.I.GetNpc(e);if(0!=h.id||t)return r.Logger.logUpdate(n),h;{let t;const h={method:"POST",body:u,headers:{Authorization:"Bearer "+a.b.BearerAccessToken}};try{console.log("this is the url",i.B.GetConceptUrl()),t=yield fetch(i.B.GetConceptUrl(),h)}catch(e){t=yield(0,c.g)(h,"/api/getConcept")}return yield function(e,t,n,i){return l(this,void 0,void 0,function*(){return e.ok?(t=yield e.json()).id>0?o.I.AddConcept(t):o.I.AddNpc(i):(console.log("Get the concept error",e.status),(0,s.ry)(e)),r.Logger.logUpdate(n),t})}(t,d,n,e)}}catch(e){e instanceof Error?console.log("Get the concept error message: ",e.message):console.log("Get the concept unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptUrl()),(0,s.ey)(n,"GetConcept",e)}})}},7149:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(8349))&&o.__esModule?o:{default:o},r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(680));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}var c=function(e){return new i.default(e)};Object.assign(c,r),delete c.__esModule;var a=c;t.default=a,e.exports=t.default},7273:(e,t,n)=>{n.d(t,{z:()=>i});var o=n(9581);class i{constructor(e,t,n,i){this.url=o.B.BASE_URL,this.message=e,this.ok=t,this.status=n,this.data=i}getMessage(){return this.message}setMessage(e){return this.message=e,this}getStatus(){return this.status}setStatus(e){return this.status=e,this}getData(){return this.data}setData(e){return this.data=e,this}getOk(){return this.ok}setOk(e){return this.ok=e,this}getUrl(){return this.url}setUrl(e){return this.url=e,this}}},7282:(e,t,n)=>{n.d(t,{Y:()=>r,o:()=>i});var o=n(2615);function i(){let e=r(new Date),t=r(new Date);return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}function r(e){const t=e.getMonth()+1,n=e.getDate(),o=e.getFullYear();let i=e.getHours();const r=e.getMinutes(),s=e.getSeconds(),c=i>=12?"PM":"AM";i%=12,i=i||12;const a=e=>e.toString().padStart(2,"0");return`${t}/${n}/${o} ${i}:${a(r)}:${a(s)} ${c}`}},7324:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.PSEUDO,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o.prototype.toString=function(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")},o}(i.default);t.default=c,e.exports=t.default},7467:(e,t,n)=>{n.d(t,{j:()=>u});var o=n(8286),i=n(9581),r=n(4364),s=n(3518),c=n(1863),a=n(8562),l=n(1596),d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function u(){return d(this,arguments,void 0,function*(e=[]){const t=a.Logger.logfunction("GetConnectionBulk",e.length)||{};let n=[];try{if(a.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("GetConnectionBulk",{connectionIds:e});return a.Logger.logUpdate(t),n.data}catch(e){console.error("GetConnectionBulk sw error: ",e),(0,c.ey)(t,"GetConnectionBulk",e),(0,a.handleServiceWorkerException)(e)}}if(e.length>0){let r=[];for(let t=0;t<e.length;t++)if(!o.d.GetNpConn(e[t])){let i=yield o.d.GetConnection(e[t]);0==i.id?r.push(e[t]):n.push(i)}if(0==r.length)return a.Logger.logUpdate(t),n;{let e;const u={method:"POST",headers:(0,s.Xr)("application/json"),body:JSON.stringify(r)};try{e=yield fetch(i.B.GetConnectionBulkUrl(),u)}catch(t){e=yield(0,l.g)(u,"/api/get_connection_bulk")}yield function(e,t,n){return d(this,void 0,void 0,function*(){if(e.ok){const n=yield e.json();if(n.length>0)for(let e=0;e<n.length;e++){let i=n[e];t.push(i),o.d.AddConnection(i)}}else(0,c.ey)(n,"GetConnectionBulk",e.status),(0,c.ry)(e),console.log("Get Connection Bulk error",e.status)})}(e,n,t),a.Logger.logUpdate(t)}}}catch(e){e instanceof Error?console.log("Get Connection Bulk error message: ",e):console.log("Get Connection Bulk unexpected error: ",e),(0,c.ey)(t,"GetConnectionBulk",e),(0,c.Mb)(e,i.B.GetConnectionBulkUrl())}return yield(0,r.s)(n),n})}},7668:e=>{const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+o+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let o=e.parent,i=0;for(;o&&"root"!==o.type;)i+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,o=this.raw(e,"between","beforeOpen");this.builder(t+o+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let o=0;o<e.nodes.length;o++){let i=e.nodes[o],r=this.raw(i,"before");r&&this.builder(r),this.stringify(i,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=e.raws.important||" !important"),t&&(o+=";"),this.builder(o,e)}document(e){this.body(e)}raw(e,n,o){let i;if(o||(o=n),n&&(i=e.raws[n],void 0!==i))return i;let r=e.parent;if("before"===o){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return t[o];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[o])return s.rawCache[o];if("before"===o||"after"===o)return this.beforeAfter(e,o);{let t="raw"+((c=o)[0].toUpperCase()+c.slice(1));this[t]?i=this[t](s,e):s.walk(e=>{if(i=e.raws[n],void 0!==i)return!1})}var c;return void 0===i&&(i=t[o]),s.rawCache[o]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let o=n.parent;if(o&&o!==e&&o.parent&&o.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},7793:(e,t,n)=>{let o,i,r,s,c=n(9371),a=n(5238),l=n(3152),{isClean:d,my:u}=n(4151);function h(e){return e.map(e=>(e.nodes&&(e.nodes=h(e.nodes)),delete e.source,e))}function p(e){if(e[d]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)p(t)}class f extends l{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]<this.proxyOf.nodes.length&&(t=this.indexes[o],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[o]+=1;return delete this.indexes[o],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,o=this.index(e),i=this.normalize(t,this.proxyOf.nodes[o]).reverse();o=this.index(e);for(let e of i)this.proxyOf.nodes.splice(o+1,0,e);for(let e in this.indexes)n=this.indexes[e],o<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,o=this.index(e),i=0===o&&"prepend",r=this.normalize(t,this.proxyOf.nodes[o],i).reverse();o=this.index(e);for(let e of r)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=h(i(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new a(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new c(e)]}return e.map(e=>(e[u]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[d]&&p(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)}):this.walk((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)}):this.walk((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)}):this.walk((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}}f.registerParse=e=>{i=e},f.registerRule=e=>{s=e},f.registerAtRule=e=>{o=e},f.registerRoot=e=>{r=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,a.prototype):"comment"===e.type?Object.setPrototypeOf(e,c.prototype):"root"===e.type&&Object.setPrototypeOf(e,r.prototype),e[u]=!0,e.nodes&&e.nodes.forEach(e=>{f.rebuild(e)})}},7820:(e,t,n)=>{n.d(t,{G:()=>s});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addConceptToTree(e){var t=new i.x(e.ghostId,e,null,null);this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static getNodeFromTree(e){return r(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return r(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}}s.root=null},7869:(e,t,n)=>{n.d(t,{_:()=>v,A:()=>f});var o=n(9581),i=n(3026),r=n(1863),s=n(3518),c=n(8562),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},l=n(2299);class d{}d.isUpdated=!1,d.isOnlineSync=!1;var u=n(3655),h=n(9003),p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function f(){return p(this,arguments,void 0,function*(e=!0){try{if(yield(0,u.qI)("concepts"),yield(0,h.qI)("concepts"),e){if((yield(0,u.b8)()).isOnlineSync)return!0;yield function(){return a(this,void 0,void 0,function*(){const e=c.Logger.logfunction("GetAiData");try{const a=(new Date).getTime();var t=(0,s.ab)("application/x-www-form-urlencoded");const l=yield fetch(o.B.GetAllAiData(),{method:"GET",headers:t});l.ok||(console.log("Ai Error Message: ","Cannot get response"),(0,r.ry)(l));const d=yield l.json();for(var n=0;n<d.length;n++)i.I.AddConcept(d[n]);v();let u=(new Date).getTime()-a;console.log("The time taken is ",u),c.Logger.logUpdate(e)}catch(e){e instanceof Error?console.log("Ai Error Message: ",e.message):console.log("Ai Error Message: ",e),(0,r.Mb)(e,o.B.GetAllAiData())}})}()}return!0}catch(e){let t={message:"cannot initlize the AI system",ok:!1,status:400,data:e};return console.log(t),!0}})}function v(){return p(this,void 0,void 0,function*(){d.isOnlineSync=!0;var e=new l.B(d.isOnlineSync);(0,u.El)(e)})}},7876:(e,t,n)=>{n.d(t,{A:()=>d,K:()=>u});var o=n(1735),i=n(7139),r=n(8562),s=n(3026),c=n(7282),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const l=new Map;function d(e){return a(this,arguments,void 0,function*(e,t=999){let n=performance.now();if(o.J.activateStatus)try{o.J.incrementConcept(e)}catch(e){console.error("Error adding connection in access tracker"),r.Logger.log("ERROR","Error Adding Connection")}if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConcept",{id:e,userId:t})).data}catch(e){console.error("GetTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let d=(0,c.o)();if(l.has(e))return l.get(e)||d;const u=(()=>a(this,void 0,void 0,function*(){try{if(e<0)return yield r.LocalConceptsData.GetConceptByGhostId(e);if(d=yield s.I.GetConcept(e),(null==d||0==d.id)&&null!=e&&null!=e){let t=yield(0,i.r)(e);d=t}if(0!=d.id&&null==d.type&&null==(yield s.I.GetConcept(d.typeId))&&null!=d.typeId&&null!=d.typeId){let e=yield(0,i.r)(d.typeId);d.type=e}return d}catch(o){throw console.error("this is the error in the getting concept",o),r.Logger.logError(n,t,"read","unknown",void 0,500,o,"GetTheConcept",[e,t],"unknown",void 0),o}finally{l.delete(e)}}))();return l.set(e,u),u})}function u(e){return a(this,void 0,void 0,function*(){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("AddTypeConcept",{concept:e})).data}catch(e){console.error("AddTypeConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(null==e.type){let t=yield s.I.GetConcept(e.typeId);if(0==t.id&&0!=e.typeId&&999!=e.typeId){let t=yield(0,i.r)(e.typeId);e.type=t}else e.type=t}})}},7887:(e,t,n)=>{n.d(t,{a:()=>s,p:()=>c});var o=n(8286),i=n(4864),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(){return r(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)o.d.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Connection Binary Tree Concept",ok:!1,status:400,data:e}}})}function c(){return r(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)i.G.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Local Connection Binary Tree Concept",ok:!1,status:400,data:e}}})}},8064:(e,t,n)=>{n.d(t,{$I:()=>c,Ay:()=>s});var o=n(9736),i=(n(9581),n(3518),n(8562));n(1863);var r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(e){return r(this,void 0,void 0,function*(){return yield o.v.GetConceptByCharacterAndTypeLocal(e,51)})}function c(e){return r(this,void 0,void 0,function*(){if(i.serviceWorker)try{return(yield(0,i.sendMessage)("GetConceptByCharacterAndCategoryLocal",{character:e})).data}catch(e){console.error("GetConceptByCharacterAndCategoryLocal error sw: ",e),(0,i.handleServiceWorkerException)(e)}let t=(0,i.CreateDefaultLConcept)();if("the"==e)return t.id=1,t.typeId=5,t.characterValue="the",t;let n=(0,i.SplitStrings)(e);if(n.length>1){let i=1,s=yield c(n[0]);0!=s.id&&(i=s.id),t=yield function(e,t){return r(this,void 0,void 0,function*(){return o.v.GetConceptByCharacterAndCategoryLocal(e,t)})}(e,i)}else n[0]==e&&(t=yield s(e));return t})}},8095:(e,t,n)=>{n.d(t,{h:()=>c});var o=n(8562),i=n(9700),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e,t,n){var c=arguments;return s(this,arguments,void 0,function*(e,t,n,s=!1,a={concepts:[],connections:[]}){var l,d,u,h,p,f;const v=i.V.logfunction("CreateConnectionBetweenTwoConceptsLocal",c)||{};let y=performance.now();try{if(o.serviceWorker){v.serviceWorker=!0;try{const r=yield(0,o.sendMessage)("CreateConnectionBetweenTwoConceptsLocal",{ofTheConcept:e,toTheConcept:t,linker:n,both:s,actions:a});return(null===(d=null===(l=null==r?void 0:r.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(r.actions.concepts))),(null===(h=null===(u=null==r?void 0:r.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(a.connections=JSON.parse(JSON.stringify(r.actions.connections))),i.V.logUpdate(v),r.data}catch(e){console.error("CreateConnectionBetweenTwoConceptsLocal sw error: ",e),(0,r.ey)(v,"CreateConnectionBetweenTwoConceptsLocal",e),(0,o.handleServiceWorkerException)(e)}}if(e.userId,s){let i=(null===(p=t.type)||void 0===p?void 0:p.characterValue)+"_s_"+n+"_by";var g=yield(0,o.MakeTheInstanceConceptLocal)("connection",i,!1,999,999,999,0,a);yield(0,o.CreateTheConnectionLocal)(t.id,e.id,g.id,1e3,void 0,void 0,a)}let c=(null===(f=e.type)||void 0===f?void 0:f.characterValue)+"_s_"+n+"_s";var m=yield(0,o.MakeTheInstanceConceptLocal)("connection",c,!1,999,999,999,void 0,a);let y=yield(0,o.CreateTheConnectionLocal)(e.id,t.id,m.id,1e3,void 0,void 0,a);return i.V.logUpdate(v),y}catch(o){throw i.V.logError(y,e.userId,"create",void 0,void 0,500,o,"CreateConnectionBetweenTwoConceptsLocal",[e,t,n,s],void 0,void 0),(0,r.ey)(v,"CreateConnectionBetweenTwoConceptsLocal",o),o}})}},8146:(e,t,n)=>{n.d(t,{Y:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(8562),c=n(1863),a=n(7876),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=s.Logger.logfunction("GetConceptByCharacterValue",t);let l=(0,s.CreateDefaultConcept)();try{const t=(0,r.Xr)("","application/json"),d=new FormData;d.append("character_value",e);const u=yield fetch(i.B.GetConceptByCharacterValueUrl(),{method:"POST",headers:t,body:d});u.ok?(l=yield u.json(),l.id>0&&(0,a.K)(l).then(e=>{o.I.AddConcept(l)}),s.Logger.logUpdate(n)):((0,c.ry)(u),console.log("Error in Getting concept by character value Error",u.status))}catch(e){e instanceof Error?console.log("Error in Getting concept by character value error message: ",e):console.log("Error in Getting concept by character value unexpected error: ",e),(0,c.Mb)(e,i.B.GetConceptByCharacterValueUrl()),(0,c.ey)(n,"GetConceptByCharacterValue",e)}return l})}},8286:(e,t,n)=>{n.d(t,{d:()=>f});var o=n(1735),i=n(8562),r=n(3655),s=n(1863),c=n(2155),a=n(5239),l=n(991),d=n(3996);class u extends d.i{constructor(e,t,n,o){super(e,t,n,o),this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}}class h{static CreateCompositionKey(e){return e}static addNodeToTree(e){return t=this,n=void 0,i=function*(){return null==this.connectionTypeRoot?(this.connectionTypeRoot=e,this.connectionTypeRoot):(this.connectionTypeRoot=this.connectionTypeRoot.addNode(e,this.connectionTypeRoot,this.connectionTypeRoot.height),this.connectionTypeRoot)},new((o=void 0)||(o=Promise))(function(e,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(s,c)}a((i=i.apply(t,n||[])).next())});var t,n,o,i}static addConnectionToTree(e){if(e.id>0){let t=this.CreateCompositionKey(e.typeId);if(this.connectionTypeRoot){let n=this.connectionTypeRoot.getFromNode(t,this.connectionTypeRoot);if(n){let t=null==n?void 0:n.value;0==t.length&&(n.value=[]),t.includes(e.id)||t.push(e.id)}else{let n=[];n.push(e.id);let o=new u(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new u(t,n,null,null);this.addNodeToTree(o)}}else console.log("cannot insert key id with n 0 to the connection tree",e)}static GetConnectionByOfTheConceptAndTypeId(e,t){let n=this.CreateCompositionKey(t);if(this.connectionTypeRoot){let e=this.connectionTypeRoot.getFromNode(n,this.connectionTypeRoot);if(e)return e.value}return null}}h.connectionTypeRoot=null;var p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class f{constructor(){this.name="Connection Array"}static CheckContains(e){let t=!1;for(let n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e.id&&(t=!0);return t}static AddConnectionToStorage(e){(0,r.kH)("connection",e)}static AddNpConn(e){this.deletedConnections.includes(e)||this.deletedConnections.push(e)}static GetNpConn(e){return!!this.deletedConnections.includes(e)}static AddConnection(e){try{a.O.addConnectionToTree(e),h.addConnectionToTree(e),l.H.addConnection(e)}catch(e){throw console.log("this is the error in making the connection"),e}}static AddConnectionToMemory(e){e.isTemp||(a.O.addConnectionToTree(e),h.addConnectionToTree(e),l.H.addConnection(e))}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){0!=e.id&&((0,r.wh)("connection",e.id),a.O.removeNodeFromTree(e.id),l.H.removeNodeFromTree(e.id))}static GetConnectionTypeOfTree(){l.H.node}static GetConnectionByOfTheConceptAndType(e,t){return p(this,void 0,void 0,function*(){try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionByOfTheConceptAndType",{ofTheConceptId:e,typeId:t})).data}catch(e){console.error("GetConnectionByOfTheConceptAndType sw error: ",e),(0,i.handleServiceWorkerException)(e)}return l.H.GetConnectionByOfTheConceptAndTypeId(e,t)||[]}catch(e){return console.log("this is the error in GetConnectionByOfTheConceptAndType",e),[]}})}static GetConnectionByOfType(e,t){const n=i.Logger.logfunction("ConnectionData.GetConnectionByOfType",arguments);let o=h.GetConnectionByOfTheConceptAndTypeId(e,t);return o?(i.Logger.logUpdate(n),o):(i.Logger.logUpdate(n),[])}static GetConnectionTree(){return a.O.connectionroot}static GetConnectionTypeTree(){return h.connectionTypeRoot}static GetConnectionBulkData(e,t,n){return p(this,void 0,void 0,function*(){yield a.O.getConnectionListFromIds(e,t,n)})}static GetConnection(e){return p(this,void 0,void 0,function*(){o.J.incrementConnection(e);let t=new c.N(0,0,0,0,0,0,0);try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnection",{id:e})).data}catch(e){console.error("GetConnection sw error: ",e),(0,i.handleServiceWorkerException)(e)}let n=yield a.O.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}return t}catch(e){return console.log("this is the error in GetConnection",e),t}})}static GetConnectionsOfCompositionLocal(e){var t=arguments;return p(this,void 0,void 0,function*(){const n=i.Logger.logfunction("ConnectionData.GetConnectionsOfCompositionLocal",t)||{};let o=[];try{if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfCompositionLocal",{id:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionsOfCompositionLocal sw error: ",e),(0,s.ey)(n,"GetConnectionsOfCompositionLocal",e),(0,i.handleServiceWorkerException)(e)}}let t=[];t=f.GetConnectionByOfType(e,e);for(let e=0;e<t.length;e++){let r=yield a.O.getNodeFromTree(t[e]);r&&o.push(r.value),i.Logger.logUpdate(n)}}catch(t){console.log("this is the error GetConnectionsOfCompositionLocal",e,o),(0,s.ey)(n,"ConnectionData.GetConnectionsOfCompositionLocal",t)}return o})}static GetConnectionsOfConcept(e){return p(this,void 0,void 0,function*(){let t=[],n=[];try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfConcept",{id:e})).data}catch(e){console.error("GetConnectionsOfConcept sw error: ",e),(0,i.handleServiceWorkerException)(e)}t=yield f.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<t.length;e++){let o=yield a.O.getNodeFromTree(t[e]);o&&n.push(o.value)}return n}catch(e){return console.log("this is the error in GetConnectionsOfConcept",e),n}})}getName(){return this.name}}f.deletedConnections=[],f.connectionArray=[],f.connectionDictionary=[]},8339:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(5644),c=n(1534),a=n(5781);const l={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,i,r=new o;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let s=!1,c=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){c=!0;break}if("}"===t){if(a.length>0){for(i=a.length-1,n=a[i];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),s&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),c&&(r.nodes=[],this.current=r)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,o=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(o+=1,2!==o));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,o,i=0;for(let[r,s]of e.entries()){if(n=s,o=n[0],"("===o&&(i+=1),")"===o&&(i-=1),0===i&&":"===o){if(t){if("word"===t[0]&&"progid"===t[1])continue;return r}this.doubleColon(n)}t=n}return!1}comment(e){let t=new i;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=a(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let o,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(o=e.shift(),":"===o[0]){n.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,c=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)c.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(o=e[t],"!important"===o[1].toLowerCase()){n.important=!0;let o=this.stringFrom(e,t);o=this.spacesFromEnd(e)+o," !important"!==o&&(n.raws.important=o);break}if("important"===o[1].toLowerCase()){let o=e.slice(0),i="";for(let e=t;e>0;e--){let t=o[e][0];if(i.trim().startsWith("!")&&"space"!==t)break;i=o.pop()[1]+i}i.trim().startsWith("!")&&(n.important=!0,n.raws.important=i,e=o)}if("space"!==o[0]&&"comment"!==o[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=c.map(e=>e[1]).join(""),c=[]),this.raw(n,"value",c.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new c;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,o=!1,i=null,r=[],s=e[1].startsWith("--"),c=[],a=e;for(;a;){if(n=a[0],c.push(a),"("===n||"["===n)i||(i=a),r.push("("===n?")":"]");else if(s&&o&&"{"===n)i||(i=a),r.push("}");else if(0===r.length){if(";"===n){if(o)return void this.decl(c,s);break}if("{"===n)return void this.rule(c);if("}"===n){this.tokenizer.back(c.pop()),t=!0;break}":"===n&&(o=!0)}else n===r[r.length-1]&&(r.pop(),0===r.length&&(i=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(i),t&&o){if(!s)for(;c.length&&(a=c[c.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(c.pop());this.decl(c,s)}else this.unknownWord(c)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,o){let i,r,s,c,a=n.length,d="",u=!0;for(let e=0;e<a;e+=1)i=n[e],r=i[0],"space"!==r||e!==a-1||o?"comment"===r?(c=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",l[c]||l[s]||","===d.slice(-1)?u=!1:d+=i[1]):d+=i[1]:u=!1;if(!u){let o=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:o,value:d}}e[t]=d}rule(e){e.pop();let t=new c;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let o=t;o<e.length;o++)n+=e[o][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},8349:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(5170))&&o.__esModule?o:{default:o},r=function(){function e(e,t){this.func=e||function(){},this.funcRes=null,this.options=t}var t=e.prototype;return t._shouldUpdateSelector=function(e,t){return void 0===t&&(t={}),!1!==Object.assign({},this.options,t).updateSelector&&"string"!=typeof e},t._isLossy=function(e){return void 0===e&&(e={}),!1===Object.assign({},this.options,e).lossless},t._root=function(e,t){return void 0===t&&(t={}),new i.default(e,this._parseOptions(t)).root},t._parseOptions=function(e){return{lossy:this._isLossy(e)}},t._run=function(e,t){var n=this;return void 0===t&&(t={}),new Promise(function(o,i){try{var r=n._root(e,t);Promise.resolve(n.func(r)).then(function(o){var i=void 0;return n._shouldUpdateSelector(e,t)&&(i=r.toString(),e.selector=i),{transform:o,root:r,string:i}}).then(o,i)}catch(e){return void i(e)}})},t._runSync=function(e,t){void 0===t&&(t={});var n=this._root(e,t),o=this.func(n);if(o&&"function"==typeof o.then)throw new Error("Selector processor returned a promise to a synchronous call.");var i=void 0;return t.updateSelector&&"string"!=typeof e&&(i=n.toString(),e.selector=i),{transform:o,root:n,string:i}},t.ast=function(e,t){return this._run(e,t).then(function(e){return e.root})},t.astSync=function(e,t){return this._runSync(e,t).root},t.transform=function(e,t){return this._run(e,t).then(function(e){return e.transform})},t.transformSync=function(e,t){return this._runSync(e,t).transform},t.process=function(e,t){return this._run(e,t).then(function(e){return e.string||e.root.toString()})},t.processSync=function(e,t){var n=this._runSync(e,t);return n.string||n.root.toString()},e}();t.default=r,e.exports=t.default},8354:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t="",n=e.indexOf("/*"),o=0;n>=0;){t+=e.slice(o,n);var i=e.indexOf("*/",n+2);if(i<0)return t;o=i+2,n=e.indexOf("/*",o)}return t+e.slice(o)},e.exports=t.default},8357:(e,t,n)=>{n.d(t,{$:()=>d});var o=n(3077),i=n(8064),r=n(6467),s=n(9975),c=n(8562),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e,t,n,u){var h=arguments;return l(this,arguments,void 0,function*(e,t,n,l,u={concepts:[],connections:[]}){var p,f,v,y;const g=c.Logger.logfunction("MakeTheTypeConceptLocal",h)||{};if(c.serviceWorker){g.serviceWorker=!0;try{const o=yield(0,c.sendMessage)("MakeTheTypeConceptLocal",{typeString:e,sessionId:t,sessionUserId:n,userId:l,actions:u});return(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.concepts)||void 0===f?void 0:f.length)&&(u.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(y=null===(v=null==o?void 0:o.actions)||void 0===v?void 0:v.connections)||void 0===y?void 0:y.length)&&(u.connections=JSON.parse(JSON.stringify(o.actions.connections))),c.Logger.logUpdate(g),o.data}catch(e){console.error("MakeTheTypeConceptLocal error sw: ",e),(0,a.ey)(g,"MakeTheTypeConceptLocal",e),(0,c.handleServiceWorkerException)(e)}}let m=yield(0,i.$I)(e);if(m&&(0==m.id||0==m.userId)){let i=(0,r.f)(e);if(i[0]==e)m=yield(0,s.A)(e,"the",l,1,51,u);else{let r=yield d(i[0],t,n,l,u),s=yield d(i[1],t,n,l,u);m=yield(0,o.A)(e,i[1],l,r.id,s.id,4,void 0,null,u)}}return c.Logger.logUpdate(g),m})}},8407:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(9581),i=n(3518),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},c=n(4402),a=n(8562),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class d{constructor(e,t,n,o,i,r,s,c,a,l){this.id=0,this.userId=e,this.data=t,this.securityId=n,this.securityUserId=o,this.accessId=i,this.accessUserId=r,this.sessionId=s,this.sessionUserId=c,this.entryTimestamp=a,this.isNew=l}}var u=n(7282),h=n(2212),p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function f(e,t){var n=arguments;return p(this,arguments,void 0,function*(e,t,p=!1,f,v=4,y=999,g=0){f=p?f:999;const m=a.Logger.logfunction("MakeTheInstanceConcept",n)||{};if(a.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("MakeTheInstanceConcept",{type:e,referent:t,composition:p,userId:f,passedAccessId:v,passedSessionId:y,referentId:g});return a.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConcept sw error: ",e),(0,r.ey)(m,"MakeTheInstanceConcept",e),(0,a.handleServiceWorkerException)(e)}}let C,w=y,I=f,T=f,k=v,A=f,S="",N=t.length,b=(0,u.o)();if(S=e.startsWith("the_")?e:"the_"+e,p)b=yield(0,a.MakeTheTypeConceptApi)(e,f),C=yield(0,h.Ay)(t,f,4,b.id,g,k,e);else if(N>255)b=yield(0,a.MakeTheTypeConceptApi)(S,f),C=yield(0,h.Ay)(t,f,4,b.id,g,k,S),function(e){s(this,void 0,void 0,function*(){try{var t=(0,i.Xr)();const n=yield fetch(o.B.CreateTheTextDataUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);return yield n.json()}catch(e){throw e instanceof Error?console.log("Create the text error message: ",e.message):console.log("Create the text unexpected error: ",e),e}})}(new d(f,t,999,I,k,A,w,T,Date.now().toString(),!0));else{b=yield(0,a.MakeTheTypeConceptApi)(S,f);let e=yield(0,c.A)(t,b.id);C=e,0==e.id&&0==e.userId&&(C=yield(0,h.N)(t,f,4,b.id,12,k,S),function(e,t,n,s){var c=arguments;l(this,void 0,void 0,function*(){const l=a.Logger.logfunction("MakeTheNameInBackend",c);try{let c={newConceptId:e,referent:t,typeId:n,typeUserId:s},d=(0,i.Xr)(),u=JSON.stringify(c);const h=yield fetch(o.B.MakeTheNameInBackendUrl(),{method:"POST",headers:d,body:u});a.Logger.logUpdate(l),h.ok||(0,r.ry)(h)}catch(e){e instanceof Error?console.log("make the name in backend error message: ",e.message):console.log("make the name in backend unexpected error: ",e),(0,r.Mb)(e,o.B.MakeTheNameInBackendUrl()),(0,r.ey)(l,"MakeTheNameInBackend",e)}})}(C.id,`${t}`,b.id,f))}return C.type=b,a.Logger.logUpdate(m),C})}},8500:(e,t,n)=>{t.__esModule=!0,t.isComment=t.isCombinator=t.isClassName=t.isAttribute=void 0,t.isContainer=function(e){return!(!s(e)||!e.walk)},t.isIdentifier=void 0,t.isNamespace=function(e){return a(e)||m(e)},t.isNesting=void 0,t.isNode=s,t.isPseudo=void 0,t.isPseudoClass=function(e){return f(e)&&!w(e)},t.isPseudoElement=w,t.isUniversal=t.isTag=t.isString=t.isSelector=t.isRoot=void 0;var o,i=n(1581),r=((o={})[i.ATTRIBUTE]=!0,o[i.CLASS]=!0,o[i.COMBINATOR]=!0,o[i.COMMENT]=!0,o[i.ID]=!0,o[i.NESTING]=!0,o[i.PSEUDO]=!0,o[i.ROOT]=!0,o[i.SELECTOR]=!0,o[i.STRING]=!0,o[i.TAG]=!0,o[i.UNIVERSAL]=!0,o);function s(e){return"object"==typeof e&&r[e.type]}function c(e,t){return s(t)&&t.type===e}var a=c.bind(null,i.ATTRIBUTE);t.isAttribute=a;var l=c.bind(null,i.CLASS);t.isClassName=l;var d=c.bind(null,i.COMBINATOR);t.isCombinator=d;var u=c.bind(null,i.COMMENT);t.isComment=u;var h=c.bind(null,i.ID);t.isIdentifier=h;var p=c.bind(null,i.NESTING);t.isNesting=p;var f=c.bind(null,i.PSEUDO);t.isPseudo=f;var v=c.bind(null,i.ROOT);t.isRoot=v;var y=c.bind(null,i.SELECTOR);t.isSelector=y;var g=c.bind(null,i.STRING);t.isString=g;var m=c.bind(null,i.TAG);t.isTag=m;var C=c.bind(null,i.UNIVERSAL);function w(e){return f(e)&&e.value&&(e.value.startsWith("::")||":before"===e.value.toLowerCase()||":after"===e.value.toLowerCase()||":first-letter"===e.value.toLowerCase()||":first-line"===e.value.toLowerCase())}t.isUniversal=C},8562:(e,t,n)=>{n.d(t,{ADMIN:()=>Sn,ALLID:()=>An.BG,AccessControlService:()=>qo,AccessTracker:()=>Ee.J,AddGhostConcept:()=>en,Anomaly:()=>To,BaseUrl:()=>l.B,BinaryTree:()=>Te.W,BuildWidgetFromId:()=>Po.Cp,BuilderStatefulWidget:()=>yo,Composition:()=>Tt,CompositionBinaryTree:()=>mt,CompositionNode:()=>yt,Concept:()=>Qn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>xe.d,CountInfo:()=>Mo.y,CreateComposition:()=>D.A,CreateConnection:()=>Jt.d,CreateConnectionBetweenEntityLocal:()=>Go,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>gn.h,CreateData:()=>xi,CreateDefaultConcept:()=>W.o,CreateDefaultLConcept:()=>zt.u,CreateSession:()=>Ut,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>G.R,CreateTheCompositionWithCache:()=>At,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>Jt.F,DATAID:()=>An.y0,DATAIDDATE:()=>An.iw,DATAV2:()=>An.pU,DelayFunctionExecution:()=>kn,DeleteConceptById:()=>Ne,DeleteConceptLocal:()=>Cn,DeleteConnectionById:()=>q.m,DeleteConnectionByIdBulk:()=>q.E,DeleteConnectionByType:()=>No.$S,DeleteConnectionByTypeBulk:()=>No.L0,DeleteUser:()=>be,DependencyObserver:()=>En.w,Environments:()=>Fi,FilterSearch:()=>to,FormatFromConnections:()=>tn.vw,FormatFromConnectionsAltered:()=>tn.y8,FreeschemaQuery:()=>bo,FreeschemaQueryApi:()=>Lo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllLinkerConnectionsFromTheConcept:()=>fe.l,GetAllTheConnectionsByTypeAndOfTheConcept:()=>No.WC,GetComposition:()=>y.Nj,GetCompositionBulk:()=>je.dF,GetCompositionBulkWithDataId:()=>je.cw,GetCompositionFromConnectionsWithDataId:()=>je.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>je.km,GetCompositionFromConnectionsWithDataIdInObject:()=>je.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>je.Nt,GetCompositionFromConnectionsWithIndex:()=>je.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>je.hG,GetCompositionFromMemoryWithConnections:()=>y.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>I,GetCompositionListAllWithId:()=>T,GetCompositionListListener:()=>Fn,GetCompositionListLocal:()=>B,GetCompositionListLocalWithId:()=>O,GetCompositionListWithId:()=>k,GetCompositionListWithIdUpdated:()=>A,GetCompositionListener:()=>Dn,GetCompositionLocal:()=>_,GetCompositionLocalWithId:()=>L,GetCompositionWithAllIds:()=>y.Mb,GetCompositionWithCache:()=>Ot,GetCompositionWithDataIdBulk:()=>Gt,GetCompositionWithDataIdWithCache:()=>Dt,GetCompositionWithId:()=>y.yz,GetCompositionWithIdAndDateFromMemory:()=>y.Ez,GetConceptBulk:()=>ot.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>it.j,GetConnectionById:()=>Ge,GetConnectionDataPrefetch:()=>je.QL,GetConnectionOfTheConcept:()=>F,GetConnectionTypeForCount:()=>zn.V,GetFreeschemaImage:()=>zi,GetFreeschemaImageUrl:()=>Ji,GetImageApi:()=>Hi,GetLink:()=>ce,GetLinkListListener:()=>qn,GetLinkListener:()=>Mn.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>Ht,GetRelationLocal:()=>cn,GetRelationRaw:()=>qt,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>nn.f,GetUserGhostId:()=>Kt,JUSTDATA:()=>An.ZJ,LConcept:()=>Yn,LConnection:()=>Xn,LISTNORMAL:()=>An.SL,LocalConceptsData:()=>v.v,LocalSyncData:()=>eo.H,LocalTransaction:()=>Co,LogEvent:()=>Wo,Logger:()=>co.V,LoginToBackend:()=>st,MakeTheInstanceConcept:()=>J.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>Me,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>An.yv,PRIVATE:()=>Nn,PUBLIC:()=>bn,PatcherStructure:()=>Zn,Prototype:()=>Pi,RAW:()=>An.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>Vn,SchemaQuery:()=>Oo,SchemaQueryListener:()=>Bo,SearchAllConcepts:()=>_t,SearchLinkInternal:()=>vn,SearchLinkInternalAll:()=>yn,SearchLinkMultipleAll:()=>tn.cf,SearchLinkMultipleAllObservable:()=>xn,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>We,SearchStructure:()=>no,SearchWithLinker:()=>Et,SearchWithTypeAndLinker:()=>Un.zl,SearchWithTypeAndLinkerApi:()=>Ln,Selector:()=>jo,SessionData:()=>Kn,Signin:()=>ut,Signup:()=>at,SignupEntity:()=>lt,SplitStrings:()=>c.f,StatefulWidget:()=>fo,SyncData:()=>M.Y,TrashTheConcept:()=>Le,UpdateComposition:()=>Nt,UpdateCompositionLocal:()=>on.D,UserBinaryTree:()=>Xt,Validator:()=>Ao,ViewInternalData:()=>un,ViewInternalDataApi:()=>ln,WidgetTree:()=>Ro,convertFromConceptToLConcept:()=>hn.F4,convertFromLConceptToConcept:()=>hn.dp,convertWidgetTreeToWidget:()=>Ti,convertWidgetTreeToWidgetWithWrapper:()=>Ai,createFormFieldData:()=>So,createPrototypeLocal:()=>Wi,dispatchIdEvent:()=>cr,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUploadFileLimit:()=>nt,getUserDetails:()=>Uo.s,getWidgetBulkFromId:()=>Ii,getWidgetFromId:()=>wi,handleServiceWorkerException:()=>lr,hasActivatedSW:()=>er,importLatestWidget:()=>hi,importRecentWidget:()=>pi,init:()=>or,orderTheConnections:()=>Jn.X,recursiveFetch:()=>y.zN,recursiveFetchNew:()=>wt,removeAllChildren:()=>Fo,renderImportedWidget:()=>fi,renderLatestWidget:()=>vi,renderPage:()=>ui,renderWidget:()=>yi,searchLinkMultipleListener:()=>Bn,sendEmail:()=>uo,sendMessage:()=>ir,serviceWorker:()=>Qi,setHasActivatedSW:()=>tr,storeToDatabase:()=>te,subscribedListeners:()=>Zi,unwrapContainers:()=>bi,updateAccessToken:()=>nr,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye}),n.r(t);var o={};n.r(o),n.d(o,{ADMIN:()=>Sn,ALLID:()=>An.BG,AccessControlService:()=>qo,AccessTracker:()=>Ee.J,AddGhostConcept:()=>en,Anomaly:()=>To,BaseUrl:()=>l.B,BinaryTree:()=>Te.W,BuildWidgetFromId:()=>Po.Cp,BuilderStatefulWidget:()=>yo,Composition:()=>Tt,CompositionBinaryTree:()=>mt,CompositionNode:()=>yt,Concept:()=>Qn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>xe.d,CountInfo:()=>Mo.y,CreateComposition:()=>D.A,CreateConnection:()=>Jt.d,CreateConnectionBetweenEntityLocal:()=>Go,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>gn.h,CreateData:()=>xi,CreateDefaultConcept:()=>W.o,CreateDefaultLConcept:()=>zt.u,CreateSession:()=>Ut,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>G.R,CreateTheCompositionWithCache:()=>At,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>Jt.F,DATAID:()=>An.y0,DATAIDDATE:()=>An.iw,DATAV2:()=>An.pU,DelayFunctionExecution:()=>kn,DeleteConceptById:()=>Ne,DeleteConceptLocal:()=>Cn,DeleteConnectionById:()=>q.m,DeleteConnectionByIdBulk:()=>q.E,DeleteConnectionByType:()=>No.$S,DeleteConnectionByTypeBulk:()=>No.L0,DeleteUser:()=>be,DependencyObserver:()=>En.w,Environments:()=>Fi,FilterSearch:()=>to,FormatFromConnections:()=>tn.vw,FormatFromConnectionsAltered:()=>tn.y8,FreeschemaQuery:()=>bo,FreeschemaQueryApi:()=>Lo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllLinkerConnectionsFromTheConcept:()=>fe.l,GetAllTheConnectionsByTypeAndOfTheConcept:()=>No.WC,GetComposition:()=>y.Nj,GetCompositionBulk:()=>je.dF,GetCompositionBulkWithDataId:()=>je.cw,GetCompositionFromConnectionsWithDataId:()=>je.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>je.km,GetCompositionFromConnectionsWithDataIdInObject:()=>je.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>je.Nt,GetCompositionFromConnectionsWithIndex:()=>je.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>je.hG,GetCompositionFromMemoryWithConnections:()=>y.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>I,GetCompositionListAllWithId:()=>T,GetCompositionListListener:()=>Fn,GetCompositionListLocal:()=>B,GetCompositionListLocalWithId:()=>O,GetCompositionListWithId:()=>k,GetCompositionListWithIdUpdated:()=>A,GetCompositionListener:()=>Dn,GetCompositionLocal:()=>_,GetCompositionLocalWithId:()=>L,GetCompositionWithAllIds:()=>y.Mb,GetCompositionWithCache:()=>Ot,GetCompositionWithDataIdBulk:()=>Gt,GetCompositionWithDataIdWithCache:()=>Dt,GetCompositionWithId:()=>y.yz,GetCompositionWithIdAndDateFromMemory:()=>y.Ez,GetConceptBulk:()=>ot.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>it.j,GetConnectionById:()=>Ge,GetConnectionDataPrefetch:()=>je.QL,GetConnectionOfTheConcept:()=>F,GetConnectionTypeForCount:()=>zn.V,GetFreeschemaImage:()=>zi,GetFreeschemaImageUrl:()=>Ji,GetImageApi:()=>Hi,GetLink:()=>ce,GetLinkListListener:()=>qn,GetLinkListener:()=>Mn.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>Ht,GetRelationLocal:()=>cn,GetRelationRaw:()=>qt,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>nn.f,GetUserGhostId:()=>Kt,JUSTDATA:()=>An.ZJ,LConcept:()=>Yn,LConnection:()=>Xn,LISTNORMAL:()=>An.SL,LocalConceptsData:()=>v.v,LocalSyncData:()=>eo.H,LocalTransaction:()=>Co,LogEvent:()=>Wo,Logger:()=>co.V,LoginToBackend:()=>st,MakeTheInstanceConcept:()=>J.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>Me,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>An.yv,PRIVATE:()=>Nn,PUBLIC:()=>bn,PatcherStructure:()=>Zn,Prototype:()=>Pi,RAW:()=>An.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>Vn,SchemaQuery:()=>Oo,SchemaQueryListener:()=>Bo,SearchAllConcepts:()=>_t,SearchLinkInternal:()=>vn,SearchLinkInternalAll:()=>yn,SearchLinkMultipleAll:()=>tn.cf,SearchLinkMultipleAllObservable:()=>xn,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>We,SearchStructure:()=>no,SearchWithLinker:()=>Et,SearchWithTypeAndLinker:()=>Un.zl,SearchWithTypeAndLinkerApi:()=>Ln,Selector:()=>jo,SessionData:()=>Kn,Signin:()=>ut,Signup:()=>at,SignupEntity:()=>lt,SplitStrings:()=>c.f,StatefulWidget:()=>fo,SyncData:()=>M.Y,TrashTheConcept:()=>Le,UpdateComposition:()=>Nt,UpdateCompositionLocal:()=>on.D,UserBinaryTree:()=>Xt,Validator:()=>Ao,ViewInternalData:()=>un,ViewInternalDataApi:()=>ln,WidgetTree:()=>Ro,convertFromConceptToLConcept:()=>hn.F4,convertFromLConceptToConcept:()=>hn.dp,convertWidgetTreeToWidget:()=>Ti,convertWidgetTreeToWidgetWithWrapper:()=>Ai,createFormFieldData:()=>So,createPrototypeLocal:()=>Wi,dispatchIdEvent:()=>cr,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUploadFileLimit:()=>nt,getUserDetails:()=>Uo.s,getWidgetBulkFromId:()=>Ii,getWidgetFromId:()=>wi,handleServiceWorkerException:()=>lr,hasActivatedSW:()=>er,importLatestWidget:()=>hi,importRecentWidget:()=>pi,init:()=>or,orderTheConnections:()=>Jn.X,recursiveFetch:()=>y.zN,recursiveFetchNew:()=>wt,removeAllChildren:()=>Fo,renderImportedWidget:()=>fi,renderLatestWidget:()=>vi,renderPage:()=>ui,renderWidget:()=>yi,searchLinkMultipleListener:()=>Bn,sendEmail:()=>uo,sendMessage:()=>ir,serviceWorker:()=>Qi,setHasActivatedSW:()=>tr,storeToDatabase:()=>te,subscribedListeners:()=>Zi,unwrapContainers:()=>bi,updateAccessToken:()=>nr,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye});var i=n(5020),r=n(205),s=n(2832),c=n(6467),a=n(3026),l=n(9581),d=n(3518),u=n(1863),h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function p(e,t){var n=arguments;return h(this,void 0,void 0,function*(){const o=co.V.logfunction("GetAllConceptsByType",n);try{var i=new URLSearchParams;i.append("type",e),i.append("user_id",t.toString());var r=(0,d.Xr)("application/x-www-form-urlencoded");const n=yield fetch(l.B.GetAllConceptsByTypeUrl(),{method:"POST",headers:r,body:i});if(n.ok){const e=yield n.json();for(var s=0;s<e.length;s++)a.I.AddConcept(e[s])}else console.log("GetAllConceptsByType error",n.status),(0,u.ry)(n)}catch(e){e instanceof Error?console.log("GetAllConceptsByType error message: ",e.message):console.log("GetAllConceptsByType unexpected error: ",e),(0,u.Mb)(e,l.B.GetAllConceptsByTypeUrl()),(0,u.ey)(o,"GetAllConceptsByType",e)}})}var f=n(8642),v=n(9736),y=n(8939),g=n(2013),m=n(8064),C=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function w(e,t){var n=arguments;return C(this,arguments,void 0,function*(e,t,o=10,i=1){const r=co.V.logfunction("GetCompositionList",n)||{};if(Qi){r.serviceWorker=!0;try{const n=yield ir("GetCompositionList",{compositionName:e,userId:t,inpage:o,page:i});return co.V.logUpdate(r),n.data}catch(e){console.error("GetCompositionList sw error: ",e),(0,u.ey)(r,"GetCompositionList",e),lr(e)}}let s=yield(0,g.A)(e),c=[];if(s){yield p(e,t);let n=yield a.I.GetConceptsByTypeIdAndUser(s.id,t),r=o*(i-1),l=[];for(let e=r;e<r+o;e++)n[e]&&l.push(n[e].id);yield(0,f.Y)(l);for(let e=r;e<r+o;e++)if(n[e]){let t=yield(0,y.kx)(n[e].id);c.push(t)}}return co.V.logUpdate(r),c})}function I(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){let i=B(e,t),r=w(e,t),s=[];return Promise.race([i,r]).then(e=>{console.log("Promise result",e),s.push(...e)}).catch(e=>{console.log("error in handling",e)}),r.then(e=>{console.log("This is the second promise result",e),s.push(...e)}),s})}function T(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){if(Qi)try{return(yield ir("GetCompositionListAllWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListAllWithId sw error: ",e),lr(e)}let i=yield(0,m.Ay)(e),r=yield(0,g.A)(e),s=[],c=[],l=[],d=[];0!=i.id&&(c=yield v.v.GetConceptsByTypeIdAndUser(i.id,t)),0!=r.id&&(yield p(e,t),d=yield a.I.GetConceptsByTypeIdAndUser(r.id,t),s=d);for(let e=0;e<c.length;e++){let t=!1;for(let n=0;n<d.length;n++)c[e].ghostId==d[n].ghostId&&(t=!0);t||l.push(c[e])}console.log("This is the all list",l);let u=[];return u=yield function(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){let i=[],r=n*(o-1),s=[],c=t.length;for(let t=r;t<r+n-c;t++)e[t]&&s.push(e[t].id);for(let e=0;e<t.length;e++){let n=yield L(t[e].id);i.push(n)}yield(0,f.Y)(s);for(let t=r;t<r+n-c;t++)if(e[t]){let n=yield(0,y.RW)(e[t].id);i.push(n)}return i})}(s,l,n,o),u})}function k(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){if(Qi)try{return(yield ir("GetCompositionListWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListWithId sw error: ",e),lr(e)}let i=yield(0,g.A)(e),r=[];if(i){yield p(e,t);let s=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),c=n*(o-1),l=[];for(let e=c;e<c+n;e++)s[e]&&l.push(s[e].id);yield(0,f.Y)(l);for(let e=c;e<c+n;e++)if(s[e]){let t=yield(0,y.RW)(s[e].id);r.push(t)}}return r})}function A(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){let i=yield(0,g.w)(e),r=[];if(i){yield p(e,t);let s=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),c=n*(o-1),l=[];for(let e=c;e<c+n;e++)s[e]&&l.push(s[e].id);yield(0,f.Y)(l);for(let e=c;e<c+n;e++)if(s[e]){let t=yield(0,y.RW)(s[e].id);r.push(t)}}return r})}var S=n(4864),N=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},b=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function _(e){return b(this,void 0,void 0,function*(){var t,n;try{if(Qi)try{return(yield ir("GetCompositionLocal",{id:e})).data}catch(e){console.error("GetCompositionLocal error sw: ",e),lr(e)}let o=[],i={};o=yield S.G.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield v.v.GetConcept(e);if(0==s.id){let t=yield function(e){var t=arguments;return N(this,void 0,void 0,function*(){const n=co.V.logfunction("TranslateLocalToReal",t);let o=(0,W.o)();try{var i=(0,d.ab)("application/x-www-form-urlencoded");const t=yield fetch(l.B.GetRealConceptById(),{method:"POST",headers:i,body:`id=${e}`});if(t.ok)return o=yield t.json(),o.id>0&&a.I.AddConcept(o),o;console.log("Error in Getting Translating concept Error",t.status),(0,u.ry)(t),co.V.logUpdate(n)}catch(e){e instanceof Error?console.log("Error in Getting Translating concept error message: ",e):console.log("Error in Getting Translating concept unexpected error: ",e),(0,u.Mb)(e,l.B.GetRealConceptById()),(0,u.ey)(n,"TranslateLocalToReal",e)}return o})}(e);if(t.id>0)return yield(0,y.Nj)(t.id)}let c=yield E(e,o,r);return i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=c,i}catch(e){throw e}})}function L(e){return b(this,void 0,void 0,function*(){var t,n;try{if(Qi)try{return(yield ir("GetCompositionLocalWithId",{id:e})).data}catch(e){console.error("GetCompositionLocalWithId error sw: ",e),lr(e)}let o=[],i={},r={};o=yield S.G.GetConnectionsOfCompositionLocal(e);let s=[];for(let e=0;e<o.length;e++)s.includes(o[e].ofTheConceptId)||s.push(o[e].ofTheConceptId);let c=yield v.v.GetConcept(e);if(0!=c.id){let r=yield E(e,o,s);i[null!==(n=null===(t=null==c?void 0:c.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=r}return r.data=i,r.id=e,r}catch(e){throw e}})}function E(e,t,n){return b(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s;let c={},a=[],l=yield v.v.GetConcept(e);if(0!=l.id&&null==l.type){let e=l.typeId,t=yield v.v.GetConcept(e);l.type=t}if(null===(i=null==l?void 0:l.type)||void 0===i?void 0:i.characterValue,!n.includes(e))return null==l?void 0:l.characterValue;if(o.includes(e))return"";o.push(e);for(let o=0;o<t.length;o++)if(t[o].ofTheConceptId==e){let e=t[o].toTheConceptId,i=yield v.v.GetConcept(e);if(0!=i.id&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield v.v.GetConcept(e);i.type=t}let l="the_",d=(null!==(s=null===(r=null==i?void 0:i.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"top").replace(l,"");if(isNaN(Number(d))){if(d){const o=yield E(e,t,n);c[d]=o}}else{const o=yield E(e,t,n);a[d]=o,c=a}}return c})}var x=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function B(e,t){return x(this,void 0,void 0,function*(){if(Qi)try{return(yield ir("GetCompositionListLocal",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocal error sw: ",e),lr(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield v.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield _(e[t].id);o.push(n)}}return o}catch(e){throw e}})}function O(e,t){return x(this,void 0,void 0,function*(){if(Qi)try{return(yield ir("GetCompositionListLocalWithId",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocalWithId error sw: ",e),lr(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield v.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield L(e[t].id);o.push(n)}}return o}catch(e){throw e}})}var R=n(2),D=n(1218),G=n(999),P=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function F(e,t,n){var o=arguments;return P(this,arguments,void 0,function*(e,t,n,i=10,r=1){const s=co.V.logfunction("GetConnectionOfTheConcept",o)||{};let c=[];try{if(Qi){s.serviceWorker=!0;try{const o=yield ir("GetConnectionOfTheConcept",{typeId:e,ofTheConceptId:t,userId:n,inpage:i,page:r});return co.V.logUpdate(s),o.data}catch(e){console.error("GetConnectionOfTheConcept sw error: ",e),(0,u.ey)(s,"GetConnectionOfTheConcept",e),lr(e)}}let o=new URLSearchParams;o.append("typeId",`${e}`),o.append("ofTheConceptId",`${t}`),o.append("userId",`${n}`),o.append("inpage",`${i}`),o.append("page",`${r}`);let a=(0,d.Xr)("application/x-www-form-urlencoded");const h=yield fetch(l.B.GetAllConnectionsOfConceptUrl(),{method:"POST",headers:a,body:o});return h.ok?c=yield h.json():((0,u.ey)(s,"GetConnectionOfTheConcept",h.status),(0,u.ry)(h),console.log("Get connection of concept error",h.status)),co.V.logUpdate(s),c}catch(e){e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),(0,u.Mb)(e,l.B.GetAllConnectionsOfConceptUrl()),(0,u.ey)(s,"GetConnectionOfTheConcept",e)}})}var U=n(2155),M=n(442),W=n(7282),j=n(5976),V=n(7273),$=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function H(e,t,n,o){return $(this,arguments,void 0,function*(e,t,n,o,i=1,r=4){if(e>0&&n>0){var s=t,c=yield j.p.getId(),a=new U.N(c,e,n,s,o,i,r);return e==n?(a.ofTheConceptId=0,a.toTheConceptId=1,a):(a.toUpdate=!0,a.isTemp=!1,M.Y.AddConnection(a),a)}throw new V.z("cannot create connection because id are negative ",!1,400,"")})}var q=n(4818),z=n(7876),J=n(8407),Q=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Y(e,t,n){return Q(this,arguments,void 0,function*(e,t,n,o=!1,i=!1){var r,s;if(Qi)try{return(yield ir("CreateConnectionBetweenTwoConcepts",{ofTheConcept:e,toTheConcept:t,linker:n,both:o,count:i})).data}catch(e){console.error("CreateConnectionBetweenTwoConcepts sw error: ",e),lr(e)}let c=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,c));let a=yield(0,J.A)("connection",s,!1,999,999,999),l=new U.N(0,t.id,e.id,c,a.id,1e3,4);M.Y.AddConnection(l)}let a=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s_"+a;i&&(yield X(a,e,c));let d=yield(0,J.A)("connection",l,!1,999,999,999),u=new U.N(0,e.id,t.id,c,d.id,1e3,4);return M.Y.AddConnection(u),u})}function X(e,t){return Q(this,arguments,void 0,function*(e,t,n=null){var o;let i=t,r=null!=n?n:t.userId,s=e+"_count",c=(null===(o=t.type)||void 0===o?void 0:o.characterValue)+"_s_"+s,a=yield(0,J.A)("connection",c,!1,r,4,999),l=yield F(a.id,t.id,r,10,1),d=[],u=(0,W.o)();for(let e=0;e<l.length;e++){let t=yield(0,z.A)(l[e].toTheConceptId);d.push(t)}if(d.length<1)u=yield(0,J.A)("count","1",!1,r,4,999);else{let e=d[0],t=0;try{t=Number(e.characterValue)}catch(e){t=0}t+=1,u=yield(0,J.A)("count",t.toString(),!1,r,4,999);for(let e=0;e<l.length;e++)(0,q.m)(l[e].id)}let h=new U.N(0,i.id,u.id,i.userId,a.id,1e3,4);yield M.Y.AddConnection(h)})}function Z(e,t,n){return Q(this,arguments,void 0,function*(e,t,n,o=!1,i=!1){var r,s;let c=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,c));let a=yield(0,J.A)("connection",s,!1,999,999,999),l=new U.N(0,t.id,e.id,c,a.id,1e3,4);M.Y.AddConnection(l)}let a=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s_"+a;i&&(yield X(a,e,c));let d=yield(0,J.A)("connection",l,!1,999,999,999);return yield H(e.id,e.userId,t.id,d.id,1e3,4)})}var K=n(5868),ee=(n(3655),function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})});function te(e,t){const n=co.V.logfunction("storeToDatabase",[e,"noindexdb"]);co.V.logUpdate(n)}function ne(e,t,n){return ee(this,void 0,void 0,function*(){const t=co.V.logfunction("getFromDatabaseWithType",[e,"noindexdb"]);co.V.logUpdate(t)})}function oe(e){return ee(this,void 0,void 0,function*(){const t=co.V.logfunction("getObjectsFromIndexDb",[e,"noindexdb"]);co.V.logUpdate(t)})}var ie=n(1666),re=n(4402),se=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ce(e,t){var n=arguments;return se(this,arguments,void 0,function*(e,t,o=10,i=1){var r;const s=co.V.logfunction("GetLink",n)||{};if(Qi){s.serviceWorker=!0;try{const n=yield ir("GetLink",{id:e,linker:t,inpage:o,page:i});return co.V.logUpdate(s),n.data}catch(e){console.error("GetLink sw error: ",e),(0,u.ey)(s,"GetLink",e),lr(e)}}let c=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield F(d.id,a.id,a.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);yield(0,f.Y)(t);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield(0,z.A)(n),i=yield(0,y.Ez)(o.id);c.push(i)}}return co.V.logUpdate(s),c})}function ae(e,t){var n=arguments;return se(this,arguments,void 0,function*(e,t,o=10,i=1){var r;const s=co.V.logfunction("GetLinkRaw",n);let c=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield F(d.id,a.id,a.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield(0,z.A)(n);c.push(o)}}return co.V.logUpdate(s),c})}var le=n(8357),de=n(843),ue=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const he=new Map;function pe(e,t){var n=arguments;return ue(this,void 0,void 0,function*(){const t=co.V.logfunction("MakeTheTypeConceptApi",n);let o=(0,W.o)();if(he.has(e))return he.get(e)||o;const i=(()=>ue(this,void 0,void 0,function*(){try{if(o=yield(0,de.Az)(e),0==o.id||4==o.typeId){let n=(0,d.Xr)("application/x-www-form-urlencoded");const i=yield fetch(l.B.MakeTheTypeConceptUrl(),{method:"POST",headers:n,body:`type=${e}`});if(!i.ok)throw(0,u.ry)(i),new Error(`Error! status: ${i.status}`);let r=yield i.json();o=r,co.V.logUpdate(t)}}catch(e){e instanceof Error?console.log("Make The Type Concept Api error : ",e.message):console.log("Make The Type Concept Api error : ",e),(0,u.Mb)(e,l.B.MakeTheTypeConceptUrl()),(0,u.ey)(t,"MakeTheTypeConceptApi",e)}finally{he.delete(e)}return o}))();return he.set(e,i),i})}var fe=n(8675),ve=n(6058),ye=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ge(e){var t=arguments;return ye(this,void 0,void 0,function*(){const n=co.V.logfunction("GetLinkerConnectionFromConcepts",t);let o=yield(0,fe.l)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return co.V.logUpdate(n),o})}function me(e){var t=arguments;return ye(this,void 0,void 0,function*(){const n=co.V.logfunction("GetLinkerConnectionToConcepts",t);let o=yield(0,ve.W)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return co.V.logUpdate(n),o})}var Ce=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},we=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},Ie=n(6963),Te=n(2202),ke=n(5457),Ae=n(991),Se=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ne(e){var t=arguments;return Se(this,void 0,void 0,function*(){const n=co.V.logfunction("DeleteConceptById",t);if(Qi)try{return(yield ir("DeleteConceptById",{id:e})).data}catch(e){console.error("DeleteConceptById sw error: ",e),lr(e)}if(e>0){var o=yield a.I.GetConcept(e);if(o.id>0){var i=o.typeId,r=o.characterValue;yield ke.c.removeTypeConcept(i,e),yield Ie.f.removeNodeByCharacter(r,e),yield function(e){var t=arguments;return we(this,void 0,void 0,function*(){let n=!1;const o=co.V.logfunction("DeleteTheConcept",t);try{const t=new FormData;t.append("id",e.toString());let i=(0,d.BZ)();const r=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",headers:i,body:t});r.ok?n=(yield r.json()).success:(console.log("Delete concept error",r.status),(0,u.ry)(r)),n&&a.I.AddNpc(e),co.V.logUpdate(o)}catch(e){e instanceof Error?console.log("Delete concept error message: ",e.message):console.log("Delete concept unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl()),(0,u.ey)(o,"DeleteTheConcept",e)}return n})}(e),yield Te.W.removeNodeFromTree(e),yield Ae.H.removeNodeFromTree(e)}}else v.v.RemoveConceptById(e);co.V.logUpdate(n)})}function be(e){return Se(this,void 0,void 0,function*(){if(Qi)try{return(yield ir("DeleteUser",{id:e})).data}catch(e){console.error("DeleteUser sw error: ",e),lr(e)}e>0?function(e){var t=arguments;Ce(this,void 0,void 0,function*(){const n=co.V.logfunction("DeleteUserInBackend",t);try{var o=(0,d.ab)("application/json","");let t=l.B.DeleteUserUrl();t=t+"?conceptId="+e+"&apiKey=freeschema";const i=yield fetch(t,{method:"POST",headers:o});if(i.ok){let e=yield i.json(),t=Number(e.data);return console.log("this is the delete email concept",t),Ne(t),co.V.logUpdate(n),t}throw(0,u.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl()),(0,u.ey)(n,"DeleteUserInBackend",e)}})}(e):v.v.RemoveConceptById(e)})}var _e=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Le(e,t){return _e(this,void 0,void 0,function*(){try{const n=new Headers;n.append("Authorization","Bearer "+t);const o=new FormData;o.append("id",e.toString());const i=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",body:o,headers:n});if(!i.ok)throw(0,u.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl())}})}var Ee=n(1735),xe=n(8286),Be=n(1596),Oe=n(3278),Re=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};var De=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ge(e){var t=arguments;return De(this,void 0,void 0,function*(){const n=co.V.logfunction("GetConnectionById",t);if(console.log("AccessTracker activation status from GetConnectionById"),!0===Ee.J.activateStatus)try{Ee.J.incrementConnection(e)}catch(e){console.error("Error adding connection in access tracker"),co.V.log("ERROR","Error Adding Connection")}if(Qi)try{return(yield ir("GetConnectionById",{id:e})).data}catch(e){console.error("GetConnectionById sw error: ",e),lr(e)}let o=yield xe.d.GetConnection(e);return null!=o&&0!=o.id||null==e||null==e||(o=yield function(e){var t=arguments;return Re(this,void 0,void 0,function*(){const n=co.V.logfunction("GetConnection",t);let o=yield xe.d.GetConnection(e);try{if(0!=o.id)return o;{const t=new FormData;t.append("id",e.toString());const i={method:"POST",headers:{Authorization:"Bearer "+Oe.b.BearerAccessToken},body:t};let r;try{r=yield fetch(l.B.GetConnectionUrl(),i)}catch(e){r=yield(0,Be.g)(i,"/api/get-connection-by-id")}return yield function(e,t){return Re(this,void 0,void 0,function*(){e.ok?(t=yield e.json(),xe.d.AddConnection(t)):((0,u.ry)(e),console.log("Get Connection Error",e.status))})}(r,o),co.V.logUpdate(n),o}}catch(e){e instanceof Error?console.log("Get Connection error message: ",e.message):console.log("Get Connection unexpected error: ",e),(0,u.Mb)(e,l.B.GetConnectionUrl()),(0,u.ey)(n,"GetConnection",e)}})}(e)),co.V.logUpdate(n),o})}var Pe=n(2212),Fe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},Ue=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Me(e,t,n){return Ue(this,arguments,void 0,function*(e,t,n,o=4,i=999){const r=co.V.logfunction("MakeTheTimestamp")||{};if(Qi){r.serviceWorker=!0;try{const s=yield ir("MakeTheTimestamp",{type:e,referent:t,userId:n,accessId:o,sessionInformationId:i});return co.V.logUpdate(r),s.data}catch(e){console.error("MakeTheTimestamp sw error: ",e),(0,u.ey)(r,"MakeTheTimestamp",e),lr(e)}}let s,c="",a=e.startsWith("the_"),l=(0,W.o)();c=a?e:"the_"+e,l=yield pe(c,n);let d=yield function(e,t,n,o,i,r,s){return Fe(this,void 0,void 0,function*(){let n=yield(0,re.A)(e,o),i=n;return 0==i.id&&(n=yield(0,Pe.Ay)(e,t,4,o,0,r,s),i=n),i})}(t,n,0,l.id,0,o,c);return s=d,co.V.logUpdate(r),s})}class We{constructor(){this.composition=0,this.type="",this.linker="",this.inpage=10,this.page=1,this.listLinkers=[],this.fullLinkers=[],this.textSearch="",this.logic="or",this.reverse=!1,this.doFilter=!1,this.filterSearches=[],this.selectors=[],this.ofCompositions=[]}}var je=n(6687),Ve=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function $e(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const r=co.V.logfunction("RecursiveSearchApi",e)||{};let s=[];try{if(Qi){r.serviceWorker=!0;try{const e=yield ir("RecursiveSearchApi",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return co.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApi sw error: ",e),(0,u.ey)(r,"RecursiveSearchApi",e),lr(e)}}let e=new We;e.composition=t,e.listLinkers=n,e.fullLinkers=i,e.textSearch=o;let c=JSON.stringify(e),a=(0,d.Xr)("application/json");const h=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:a,body:c});if(h.ok){const e=yield h.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,s=yield(0,je.p8)(t,n)}else console.log("recursive search error ",h.status),(0,u.ey)(r,"RecursiveSearchApi",h.status),(0,u.ry)(h);co.V.logUpdate(r)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(r,"RecursiveSearchApi",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}return s})}function He(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=co.V.logfunction("RecursiveSearchApiWithInternalConnections",e)||{};let r=[];try{if(Qi){i.serviceWorker=!0;try{const e=yield ir("RecursiveSearchApiWithInternalConnections",{composition:t,listLinkers:n,textSearch:o});return co.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiWithInternalConnections sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiWithInternalConnections",e),lr(e)}}let e=new We;e.composition=t,e.listLinkers=n,e.textSearch=o;let s=JSON.stringify(e),c=(0,d.Xr)("application/json");const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(a.ok){const e=yield a.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,r=yield(0,je.km)(t,n),co.V.logUpdate(i)}else console.log("recursive search error ",a.status),(0,u.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",a.status),(0,u.ry)(a)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}return r})}function qe(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const r=co.V.logfunction("RecursiveSearchApiRaw",e)||{};try{if(Qi){r.serviceWorker=!0;try{const e=yield ir("RecursiveSearchApiRaw",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return co.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApiRaw sw error: ",e),(0,u.ey)(r,"RecursiveSearchApiRaw",e),lr(e)}}let e=new We;e.composition=t,e.listLinkers=n,e.textSearch=o,e.fullLinkers=i;let s=JSON.stringify(e),c=(0,d.Xr)("application/json");const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(a.ok){const e=yield a.json();return e.compositionIds,e.internalConnections,e.externalConnections,co.V.logUpdate(r),e}return console.log("recursive search error ",a.status),(0,u.ey)(r,"RecursiveSearchApiRaw",a.status),(0,u.ry)(a),co.V.logUpdate(r),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(r,"RecursiveSearchApiRaw",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}})}function ze(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=co.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Qi){i.serviceWorker=!0;try{const e=yield ir("RecursiveSearchApiRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return co.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiRawFullLinker sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",e),lr(e)}}let e=new We;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)("application/json");const c=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:r});if(c.ok){const e=yield c.json();return e.compositionIds,e.internalConnections,e.externalConnections,co.V.logUpdate(i),e}return console.log("recursive search error ",c.status),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",c.status),(0,u.ry)(c),co.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl()),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",e)}})}function Je(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=co.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Qi)try{i.serviceWorker=!0;const e=yield ir("RecursiveSearchApiNewRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return co.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiNewRawFullLinker sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",e),lr(e)}let e=new We;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)("application/json");const c=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:r});if(c.ok){const e=yield c.json();return e.compositionIds,e.internalConnections,e.externalConnections,co.V.logUpdate(i),e}return console.log("recursive search error ",c.status),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",c.status),(0,u.ry)(c),co.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl()),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",e)}})}var Qe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const Ye=["image/jpeg","image/jpg","image/png","image/webp"],Xe=["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","text/plain","application/pdf"];function Ze(e,t){return Qe(this,void 0,void 0,function*(){const n=co.V.logfunction("uploadAttachment");try{console.log("File Type",e.type);const o=new FormData;let i;if(Xe.includes(e.type)||e.name.toLowerCase().endsWith(".md"))o.append("file",e,e.name),i=yield tt(o,t);else{if(!Ye.includes(e.type))return{message:"Invalid File Format",success:!1};o.append("image",e,e.name),i=yield Ke(o,t)}return(null==i?void 0:i.data)?(co.V.logUpdate(n),{message:"Upload Success",success:!0,url:i.data}):{message:"File Upload Failed",success:!1}}catch(e){throw console.error(e),(0,u.ey)(n,"uploadAttachment",e),e}})}function Ke(e){return Qe(this,arguments,void 0,function*(e,t=""){const n=co.V.logfunction("uploadImage");try{const o=yield fetch(l.B.uploadImageUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),co.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadImage",e),null}})}function et(e){return Qe(this,arguments,void 0,function*(e,t=""){const n=co.V.logfunction("uploadImageV2");try{const o=yield fetch(l.B.uploadImageUrlWithSmall(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),co.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadImageV2",e),null}})}function tt(e){return Qe(this,arguments,void 0,function*(e,t=""){const n=co.V.logfunction("uploadFile");try{const o=yield fetch(l.B.uploadFileUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(o.text());const t=yield o.text();return console.error(`${o.status} ${t}`),null}return co.V.logUpdate(n),yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadFile",e),null}})}function nt(){return Qe(this,void 0,void 0,function*(){let e=yield(0,d.Xr)(),t={};try{const n=yield fetch(l.B.UploadFileLimitUrl(),{method:"GET",headers:e});n.ok&&(t=n.json())}catch(e){throw console.error(e),e}return t})}var ot=n(1239),it=n(7467),rt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function st(e,t){var n=arguments;return rt(this,arguments,void 0,function*(e,t,o="boomconsole.com"){const i=co.V.logfunction("LoginToBackend",n);try{let n={email:e,password:t,application:o},r=new Headers;r.append("Content-Type","application/json");let s=JSON.stringify(n);const c=yield fetch(l.B.LoginUrl(),{method:"POST",headers:r,body:s}),a=yield c.json();if(c.ok)return Oe.b.BearerAccessToken=a.data.token,co.V.logUpdate(i),a;console.log("Login tsccs error message: ",c.status),(0,u.ER)(c,a)}catch(e){e instanceof Error?console.log("Login tsccs error message: ",e.message):console.log(" Login tsccs unexpected error: ",e),(0,u.Mb)(e,l.B.LoginUrl()),(0,u.ey)(i,"LoginToBackend",e)}})}var ct=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function at(e){return ct(this,void 0,void 0,function*(){const t=yield function(){return ct(this,arguments,void 0,function*(e="",t={}){let n={message:"success",status:!1,statusCode:200,data:"cannot signup"};try{const o=yield fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(t)}),i=yield o.json();return o.ok?n={message:"success",status:!0,statusCode:200,data:i}:(0,u.ER)(o,i),n}catch(t){console.log("Signup Error: ",t),(0,u.Mb)(t,e)}})}(l.B.SignupUrl(),e);return t})}function lt(e){return ct(this,void 0,void 0,function*(){const t=l.B.NODE_URL,n=yield fetch(`${t}/api/v1/entity/signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok)return n.json();{if(404===n.status)throw new Error("404, Not found");if(500===n.status)throw new Error("500, internal server error");let e=yield n.json();throw console.log("This is the error from package",e),new Error(e.message)}})}var dt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ut(e){return dt(this,void 0,void 0,function*(){const t=JSON.stringify({email:e.email,password:e.password});let n={message:"success",status:!1,statusCode:200,data:""};const o=new Headers;o.append("Content-Type","application/json");const i=l.B.LoginUrl();try{const e=yield fetch(i,{method:"POST",headers:o,body:t,redirect:"follow"}),r=yield e.json();if(e.ok){const e=null==r?void 0:r.data;n={message:"success",status:!0,statusCode:200,data:e},nr(e.token)}else(0,u.ER)(e,r);return n}catch(e){console.log("Sign in api error",e),(0,u.Mb)(e,i)}})}var ht=n(9934),pt=n(4485);function ft(e=[],t){Array.isArray(e)&&e.splice(e.findIndex(function(e){return e.id===t.id}),1)}function vt(e=[],t){Array.isArray(e)&&e.splice(e.findIndex(function(e){return e.id===t.id}),1)}class yt{constructor(e,t,n,o){this.expiryTime=new Date(Date.now()+6e5),this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}isValid(){const e=new Date(Date.now());return!(this.expiryTime<e&&(mt.removeNodeFromTree(this.key),1))}saveToCache(e){this.value.cached=e}addNode(e,t,n){if(null==t)return e;const o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return this.isValid(),e;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));const r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return this.isValid(),t}rightRotate(e){if(e){const t=e.leftNode;if(t){const n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){const t=e.rightNode;if(t){const n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key&&t.isValid()?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){const t=e.rightNode;return e=null,t}if(null==e.rightNode){const t=e.leftNode;return e=null,t}{const t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.rightNode=this.removeNode(e.rightNode,t.key),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var gt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class mt{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addCompositionToTree(e){const t=new yt(e.id,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return gt(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return gt(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}mt.root=null;var Ct=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function wt(e,t,n,o){return Ct(this,arguments,void 0,function*(e,t,n,o,i=[]){var r,s;let c={};const l=[];if(0==e)return"";let d=It(n,e);if(null!=d&&0!=d.id||null==e||null==e||(d=yield(0,z.A)(e)),0!=d.id&&null==d.type){const e=d.typeId;let t=It(n,e);d.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,z.A)(e),d.type=t)}if(!o.includes(e))return null==d?void 0:d.characterValue;if(i.includes(e))return"";i.push(e);for(let d=0;d<t.length;d++)if(t[d].ofTheConceptId==e){const u=t[d].toTheConceptId;if(o.includes(e)){let e=It(n,u);if(null!=e&&0!=e.id||null==u||null==u||(e=yield(0,z.A)(u)),0!=e.id&&null==(null==e?void 0:e.type)){const t=e.typeId;let n=yield a.I.GetConcept(t);e.type=n,null==n&&null!=t&&null!=t&&(n=yield(0,z.A)(t),e.type=n)}const d="the_",h=(null!==(s=null===(r=null==e?void 0:e.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"").replace(d,"");if(isNaN(Number(h))){if(h){const e=yield wt(u,t,n,o,i);c[h]=e}}else{const e=yield wt(u,t,n,o,i);l[h]=e,c=l}}}return c})}function It(e,t){let n=(0,W.o)();for(let o=0;o<e.length;o++)if(t==e[o].id)return n=e[o],n;return n}class Tt{constructor(){this.id=0,this.mainConcept=(0,W.o)(),this.connections=[],this.concepts=[],this.subcompositions=[],this.cached={}}updateCache(){return e=this,t=void 0,o=function*(){if(0==this.mainConcept.id)for(let e=0;e<this.concepts.length;e++)this.concepts[e].id==this.id&&(this.mainConcept=this.concepts[e]);this.cached=yield wt(this.id,this.connections,this.concepts,this.subcompositions,[])},new((n=void 0)||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())});var e,t,n,o}UpdateAcrossDistributedSystem(){var e,t;try{0!=this.id&&(t=null===(e=this.id)||void 0===e?void 0:e.toString(),l.B.MQTT_CONNECTION&&l.B.MQTT_CONNECTION.publish("compositionUpdate",t))}catch(e){console.log("Error while publishing message",e)}}isUpdating(){this.UpdateAcrossDistributedSystem()}GetDataCache(){var e,t,n;const o={};o[null!==(n=null===(t=null===(e=this.mainConcept)||void 0===e?void 0:e.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=this.cached;const i={};return i.data=o,i.id=this.id,i}}var kt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function At(e){return kt(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,c=null){const a=null!=i?i:999,l=null!=r?r:4,d=null!=s?s:999;let u=null!=o?o:0,h=(0,W.o)();null==c&&(c=new Tt);for(const o in e)if("object"==typeof e[o]||Array.isArray(e[o])){const p=yield(0,J.A)(o,"",!0,a,l,d);if(null==t&&null==n){let t=u;h=p,t=p.id,u=p.id,c.concepts.push(p),c.id=p.id,yield At(e[o],p.id,p.userId,t,i,r,s,c)}else{const a=null!=t?t:999,l=null!=n?n:999,d=u;h=p,c.concepts.push(p);const f=yield(0,ie.q)(a,l,p.id,d);c.connections.push(f),yield At(e[o],p.id,p.userId,d,i,r,s,c)}null!=e[o]&&null!=e[o]&&c.subcompositions.push(p.id)}else{const i=null!=t?t:999,r=null!=n?n:999,s=u,h=yield(0,J.A)(o,e[o],!1,a,l,d);c.concepts.push(h);const p=yield(0,ie.q)(i,r,h.id,s);c.connections.push(p)}return h})}var St=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Nt(e){return St(this,void 0,void 0,function*(){const t=co.V.logfunction("UpdateComposition")||{};if(Qi){t.serviceWorker=!0;try{const n=yield ir("UpdateComposition",{patcherStructure:e});return co.V.logUpdate(t),n.data}catch(e){console.error("UpdateComposition sw error: ",e),(0,u.ey)(t,"UpdateComposition",e),lr(e)}}const n=e.userId,o=e.sessionId,i=e.accessId;let r=[];const s=[];let c=(0,W.o)(),a=(0,W.o)();const l=[];let d=e.compositionId;const h=e.ofTheCompositionId;let p=[];if(d<0){let e=yield(0,z.A)(d,n);if(!(e.id>0))return null;d=e.id}r=yield(0,R.s)(d);const f=[],v=new Tt,y=[];v.id=d,v.isUpdating();let g=[];for(let e=0;e<r.length;e++)(0,ht.A)(y,r[e].ofTheConceptId),(0,ht.A)(f,r[e].ofTheConceptId),(0,ht.A)(f,r[e].toTheConceptId),g.push(r[e].ofTheConceptId);v.subcompositions=y,v.connections=r;for(let e=0;e<f.length;e++){const t=yield(0,z.A)(f[e]);d==f[e]&&(c=t),h==f[e]&&(a=t),s.push(t)}const m=e.patchObject;for(const e in m){let t=(0,W.o)();const r=m[e];let d=c;if(a.id>0&&(d=a),Array.isArray(r)||"object"==typeof r){t=yield(0,J.A)(e,"",!0,c.userId,4,999),v.subcompositions.push(t.id);const n=(0,pt.vo)(s,t);for(let e=0;e<n.length;e++)if(n[e].id>0){const t=(0,pt.wS)(v.connections,n[e].id);p=p.concat(t),l.push(n[e])}yield At(m[e],t.id,t.userId,c.id,c.userId,4,999,v)}else{t=yield(0,J.A)(e,r,!1,n,i,o);const c=(0,pt.vo)(s,t);for(let e=0;e<c.length;e++)if(c[e].id>0){const t=(0,pt.wS)(v.connections,c[e].id);p=p.concat(t),l.push(c[e])}}const u=(0,ie.q)(d.id,d.userId,t.id,c.id);s.push(t),v.connections.push(u)}for(let e=0;e<p.length;e++)vt(v.connections,p[e]),(0,q.m)(p[e].id);for(let e=0;e<l.length;e++)ft(s,l[e]);v.concepts=v.concepts.concat(s),v.mainConcept=c,v.id=c.id,yield v.updateCache(),mt.addCompositionToTree(v),M.Y.SyncDataOnline();let C=v.GetDataCache();return co.V.logUpdate(t),C})}var bt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function _t(e,t,n,o){return bt(this,arguments,void 0,function*(e,t,n,o,i=10,r=1){var s=(0,d.ab)("application/x-www-form-urlencoded",o),c=new URLSearchParams;c.append("type",e),c.append("search",t),c.append("composition",n),c.append("inpage",i.toString()),c.append("page",r.toString());const a=l.B.SearchCompositionsUrl()+"?"+c.toString();try{const e=yield fetch(a,{method:"GET",headers:s});return e.ok?yield e.json():((0,u.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,u.Mb)(e,a)}})}var Lt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Et(e){return Lt(this,arguments,void 0,function*(e,t=""){var n=(0,d.ab)("application/json",t);const o=l.B.SearchLinkMultipleAll(),i=JSON.stringify(e);try{const e=yield fetch(o,{method:"POST",headers:n,body:i});return e.ok?yield e.json():(console.log("This is the searching error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,u.Mb)(e,o)}})}var xt=n(7139),Bt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ot(e){return Bt(this,arguments,void 0,function*(e,t=[]){var n,o;let i=[];const r=[];let s={},c={};const l=yield mt.getNodeFromTree(e),d=[];let u=yield a.I.GetConcept(e);if(0==u.id&&null!=e&&null!=e&&(u=yield(0,xt.r)(e)),null==l){let a=[];a=t.length>0?Rt(e,t):yield(0,R.s)(e),i=a;for(let e=0;e<i.length;e++)d.includes(i[e].ofTheConceptId)||(d.push(i[e].ofTheConceptId),r.push(i[e].ofTheConceptId)),r.includes(i[e].toTheConceptId)||r.push(i[e].toTheConceptId);Pt(u,i,r,d);let l=[];c=yield(0,y.zN)(e,i,d,l),s[null!==(o=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c}else c=l.value.GetDataCache(),s=c;return 0==u.id?"":s})}function Rt(e,t){const n=[];for(let o=0;o<t.length;o++)t[o].typeId==e&&n.push(t[o]);return n}function Dt(e){return Bt(this,arguments,void 0,function*(e,t=[]){var n,o;let i={},r=[];const s=[];let c;const l={},d=yield mt.getNodeFromTree(e),u=[];let h=yield a.I.GetConcept(e);if(0==h.id&&null!=e&&null!=e&&(h=yield(0,xt.r)(e)),null==d){let a=[];a=t.length>0?Rt(e,t):yield(0,R.s)(e),r=a;for(let e=0;e<r.length;e++)u.includes(r[e].ofTheConceptId)||(u.push(r[e].ofTheConceptId),s.push(r[e].ofTheConceptId)),s.includes(r[e].toTheConceptId)||s.push(r[e].toTheConceptId);Pt(h,r,s,u),c=yield(0,y.zN)(e,r,u),l[null!==(o=null===(n=null==h?void 0:h.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c,i.created_at=h.entryTimeStamp,i.data=l,i.id=e}else c=d.value.GetDataCache(),i=c;return 0==h.id?"":i})}function Gt(e,t){return Bt(this,void 0,void 0,function*(){let n=[];const o=[];n=yield(0,it.j)(t);for(let t=0;t<e.length;t++){const i=yield Dt(e[t],n);i&&o.push(i)}return o})}function Pt(e,t,n,o){return Bt(this,void 0,void 0,function*(){const i=new Tt,r=yield function(e){return Bt(this,void 0,void 0,function*(){let t=[];const n=[];for(let o=0;o<(null==e?void 0:e.length);o++){const i=yield a.I.GetConcept(e[o]);0==i.id?n.push(e[o]):t.push(i)}return 0==(null==n?void 0:n.length)||(t=yield(0,ot.I)(n)),t})}(n);i.connections=t,i.concepts=r,i.id=e.id,i.subcompositions=o,i.mainConcept=e;const s=yield wt(e.id,t,r,o,[]);i.cached=s,mt.addCompositionToTree(i)})}var Ft=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ut(e){return Ft(this,void 0,void 0,function*(){try{var t=(0,d.Xr)();const n=JSON.stringify(e),o=yield fetch(l.B.CreateSessionId(),{method:"POST",headers:t,body:n});return o.ok?o.json():(console.log("Creating session failed",yield o.json()),(0,u.ry)(o),null)}catch(e){console.log("Creating session failed",e),(0,u.Mb)(e,l.B.CreateSessionId())}})}var Mt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Wt(e,t){return Mt(this,void 0,void 0,function*(){try{var n=(0,d.Xr)("application/x-www-form-urlencoded");const o=new URLSearchParams;o.append("sessionId",e.toString()),o.append("url",t);const i=yield fetch(l.B.CreateSessionVisitUrl(),{method:"POST",headers:n,body:o});return i.ok?i.json():(console.log("Creating session url failed",yield i.json()),(0,u.ry)(i),null)}catch(e){console.log("Creating session url failed",e),(0,u.Mb)(e,l.B.CreateSessionVisitUrl())}})}var jt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Vt(e,t,n){return jt(this,arguments,void 0,function*(e,t,n,o=10,i=1){let r=[];try{var s=new URLSearchParams;s.append("typeId",`${e}`),s.append("toTheConceptId",`${t}`),s.append("userId",`${n}`),s.append("inpage",`${o}`),s.append("page",`${i}`);var c=(0,d.Xr)("application/x-www-form-urlencoded");const a=yield fetch(l.B.GetAllConnectionsToConceptUrl(),{method:"POST",headers:c,body:s});return a.ok?r=yield a.json():(console.log("Get connection of concept error",a.status),(0,u.ry)(a)),r}catch(e){throw e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),e}})}var $t=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ht(e,t){var n=arguments;return $t(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=co.V.logfunction("GetRelation",n)||{};if(Qi){s.serviceWorker=!0;try{const n=yield ir("GetRelation",{id:e,relation:t,inpage:o,page:i,reverse:r});return co.V.logUpdate(s),n.data}catch(e){console.error("GetRelation error sw: ",e),(0,u.ey)(s,"GetRelation",e),lr(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[];if(l.id>0)if(r){d=yield Vt(l.id,a.id,a.userId,o,i);let e=[];for(var h=0;h<d.length;h++)e.push(d[h].ofTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].ofTheConceptId,n=yield(0,z.A)(t),o=yield(0,y.Ez)(n.id);c.push(o)}}else{d=yield F(l.id,a.id,a.userId,o,i);let e=[];for(let t=0;t<d.length;t++)e.push(d[t].toTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].toTheConceptId,n=yield(0,z.A)(t),o=yield(0,y.Ez)(n.id);c.push(o)}}return co.V.logUpdate(s),c})}function qt(e,t){var n=arguments;return $t(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=co.V.logfunction("GetRelationRaw",n)||{};if(Qi){s.serviceWorker=!0;try{const n=yield ir("GetRelationRaw",{id:e,relation:t,inpage:o,page:i,reverse:r});return co.V.logUpdate(s),n.data}catch(e){console.error("GetRelationRaw error sw: ",e),(0,u.ey)(s,"GetRelationRaw",e),lr(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[],h=[];if(l.id>0){if(r){d=yield Vt(l.id,a.id,a.userId,o,i);for(var p=0;p<d.length;p++)h.push(d[p].ofTheConceptId)}else{d=yield F(l.id,a.id,a.userId,o,i);for(let e=0;e<d.length;e++)h.push(d[e].toTheConceptId)}c=yield(0,ot.r)(h)}return co.V.logUpdate(s),c})}var zt=n(6416),Jt=n(4711);class Qt{constructor(e,t,n,o){this.value=[],this.height=1,this.key=e,this.value.push(t),this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t.value.push(...e.value),t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var n=this.inOrderSuccessor(e.rightNode);return e.value=n.value,e.key=n.key,e.rightNode=this.removeNode(e.rightNode,n.key),e}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var Yt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Xt{static compositeKey(e,t){return("0000"+e.toString(16).toUpperCase()).slice(-4)+("0000"+t.toString(16).toUpperCase()).slice(-4)}static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static waitForDataToLoad(){return Yt(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(Xt.checkFlag,1e3,e)}static addConceptToTree(e,t,n=999){let o=this.compositeKey(t,n);var i=new Qt(o,e,null,null);this.addNodeToTree(i)}static getNodeFromTree(e,t){return Yt(this,void 0,void 0,function*(){let n=this.compositeKey(e,t);return this.root?this.root.getFromNode(n,this.root):null})}static removeNodeFromTree(e){return Yt(this,arguments,void 0,function*(e,t=999){if(this.root){let n=this.compositeKey(e,t);this.root=this.root.removeNode(this.root,n)}})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}Xt.root=null;var Zt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Kt(e,t){return Zt(this,arguments,void 0,function*(e,t,n=999){let o=yield Xt.getNodeFromTree(e,n),i=(0,zt.u)();if(o)for(let e=0;e<o.value.length;e++){let n=o.value[e];n.ghostId==t&&(i=n)}return i})}function en(e,t){return Zt(this,arguments,void 0,function*(e,t,n=999){Xt.addConceptToTree(e,t,n)})}var tn=n(5312),nn=n(1213),on=n(3729),rn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},sn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function cn(e,t,n){return sn(this,void 0,void 0,function*(){try{if(Qi)try{return(yield ir("GetRelationLocal",{id:e,relation:t,userId:n})).data}catch(e){console.error("GetRelationLocal error sw: ",e),lr(e)}let o=yield(0,m.$I)(t),i=[];0!=o.id&&(i=yield function(e,t){return rn(this,void 0,void 0,function*(){try{return yield S.G.GetConnectionOfCompositionAndTypeLocal(t,e)}catch(e){throw e}})}(e,o.id));let r=[];for(let e=0;e<i.length;e++){let t=yield _(i[e].toTheConceptId);r.push(t)}return r}catch(e){throw e}})}var an=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ln(e){return an(this,void 0,void 0,function*(){let t=[];try{var n=(0,d.Xr)();const o=yield fetch(l.B.ViewInternalDataUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(o.ok){let e=yield o.json(),n={};for(let o=0;o<e.length;o++){let i=e[o].concepts;t=e[o].connections;let r=e[o].id;(0,ot.r)(i),n[r]=t}return n}return console.log("View Internal Data error",o.status),(0,u.ry)(o),t}catch(e){throw e instanceof Error?console.log(" This is the view internal data error message: ",e.message):console.log(" This is the view internal data unexpected error: ",e),e}})}var dn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function un(e){return dn(this,void 0,void 0,function*(){var t;try{let n=yield ln(e),o=[];for(let i=0;i<e.length;i++){let r=e[i],s=n[r];if(r&&s){let e=[],t={};for(let t=0;t<s.length;t++)e.includes(s[t].ofTheConceptId)||e.push(s[t].ofTheConceptId);let n=yield(0,y.zN)(r,s,e);t.data=n,t.id=r,o.push(t)}else{let e={};e.id=r;let n=yield(0,z.A)(r),i={};n.type&&(i[null===(t=null==n?void 0:n.type)||void 0===t?void 0:t.characterValue]=n.characterValue,e.data=i,o.push(e))}}return o}catch(e){throw e}})}var hn=n(176),pn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},fn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function vn(e){return fn(this,arguments,void 0,function*(e,t=""){try{let n=yield function(e){return pn(this,arguments,void 0,function*(e,t=""){var n=(0,d.ab)("application/json",t);let o=l.B.SearchInternalWithAuthenticatedCcsUrl();o=o+"?composition="+e.composition+"&search="+e.search+"&internalComposition="+e.internalComposition+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;try{const e=yield fetch(o,{method:"GET",headers:n});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,u.Mb)(e,o)}})}(e,t);return yield un(n)}catch(e){throw e}})}function yn(e){return fn(this,arguments,void 0,function*(e,t=""){try{return yield function(e){return pn(this,void 0,void 0,function*(){var t=(0,d.ab)("application/json","");let n=l.B.SearchInternalWithCcsUrl();n=n+"?composition="+e.composition+"&search="+e.search+"&internalComposition="+e.internalComposition+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;try{const e=yield fetch(n,{method:"GET",headers:t});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,u.Mb)(e,n)}})}(e)}catch(e){throw e}})}var gn=n(8095),mn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Cn(e){return mn(this,void 0,void 0,function*(){if(Qi)try{return(yield ir("DeleteConceptLocal",{id:e})).data}catch(e){console.error("DeleteConceptLocal error sw: ",e),lr(e)}let t=yield(0,nn.f)(e);v.v.RemoveConcept(t)})}var wn=n(2803),In=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Tn(e,t,n,o){return In(this,arguments,void 0,function*(e,t,n,o,i=!0){var r,s;const c=co.V.logfunction("GetConnectionBetweenTwoConceptsLinker")||{};if(Qi){c.serviceWorker=!0;try{const r=yield ir("GetConnectionBetweenTwoConceptsLinker",{ofTheConcept:e,toTheConcept:t,linker:n,fullLinker:o,forward:i});return co.V.logUpdate(c),r.data}catch(e){console.error("GetConnectionBetweenTwoConceptsLinker sw error: ",e),(0,u.ey)(c,"GetConnectionBetweenTwoConceptsLinker",e),lr(e)}}let a=(0,W.o)();if(""!=n){let o="";o=i?(null===(r=e.type)||void 0===r?void 0:r.characterValue)+"_s_"+n+"_s":(null===(s=t.type)||void 0===s?void 0:s.characterValue)+"_s_"+n+"_by",a=yield(0,J.A)("connection",o,!1,999)}""!=o&&(a=yield pe(o,999));let l=[];return l=i?yield(0,wn.x)(e.id,t.id,a.id):yield(0,wn.x)(t.id,e.id,a.id),co.V.logUpdate(c),l})}function kn(e,t){return new Promise((n,o)=>{setTimeout(()=>{n(t)},e)})}var An=n(3130);const Sn=3,Nn=4,bn=5;var _n=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ln(e,t){return _n(this,arguments,void 0,function*(e,t,n=""){let o=l.B.SearchAllTypeWithLinker(e.auth);var i=(0,d.ab)("application/json",n);o=o+"?search="+e.search+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;const r=JSON.stringify(t);try{const e=yield fetch(o,{method:"POST",headers:i,body:r});return e.ok?yield e.json():((0,u.ry)(e),console.log("This is the searching multiple error",e.status),[])}catch(e){console.log("This is the searching SearchWithTypeAndLinker error",e),(0,u.Mb)(e,o)}})}var En=n(4287);class xn extends En.w{constructor(e,t,n=An.y0){super(),this.searchQuery=[],this.format=An.y0,this.searchQuery=e,this.format=n}bind(){return e=this,t=void 0,o=function*(){return this.data=yield(0,tn.cf)(this.searchQuery,"",this,this.format),this.mainConcept=this.searchQuery[0].composition,this.listenToEvent(this.mainConcept),console.log("this is the data",this.data),this.data},new((n=void 0)||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())});var e,t,n,o}}function Bn(e,t,n=An.y0){return new xn(e,null!=t?t:"",n)}var On=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Rn extends En.w{constructor(e,t=An.ZJ){super(),this.id=e,this.format=t}bind(){return On(this,void 0,void 0,function*(){if(!this.isDataLoaded){let e=yield(0,y.hL)(this.id);this.mainConcept=this.id,this.compositionIds=e.compositionList;let t=e.connectionList;for(let e=0;e<t.length;e++)this.internalConnections.push(t[e].id);this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return On(this,void 0,void 0,function*(){let e=[],t=this.internalConnections;for(let n=0;n<t.length;n++)e.push(yield xe.d.GetConnection(t[n]));return this.format==An.ZJ?this.data=yield(0,y.ay)(this.mainConcept,e,this.compositionIds):this.format==An.y0?this.data=yield(0,y.$V)(this.mainConcept,e,this.compositionIds):this.format==An.yv?this.data=yield(0,y.re)(this.mainConcept,e,this.compositionIds):this.data=yield(0,y.ay)(this.mainConcept,e,this.compositionIds),this.data})}}function Dn(e,t=An.ZJ){return new Rn(e,t)}var Gn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Pn extends En.w{constructor(e,t,n,o,i){super(),this.data=[],this.startPage=0,this.compositionName=e,this.userId=t,this.inpage=n,this.page=o,this.format=i}bind(){return Gn(this,void 0,void 0,function*(){if(!this.isDataLoaded){var e=yield(0,g.A)(this.compositionName);if(e){yield p(this.compositionName,this.userId);let o=yield a.I.GetConceptsByTypeIdAndUser(e.id,this.userId);for(var t=this.inpage*(this.page-1),n=t;n<t+this.inpage;n++)o[n]&&this.compositionIds.push(o[n].id)}yield(0,f.Y)(this.compositionIds),this.isDataLoaded=!0,this.listenToEventType(e.id);for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e])}return yield this.build()})}build(){return Gn(this,void 0,void 0,function*(){if(this.data=[],this.format==An.ZJ){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.kx)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==An.y0){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.RW)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==An.yv){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.XI)(this.compositionIds[e]);this.data.push(t)}}else for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.kx)(this.compositionIds[e]);this.data.push(t)}return this.data})}}function Fn(e,t,n,o,i=An.ZJ){return new Pn(e,t,n,o,i)}var Un=n(1320),Mn=n(5328),Wn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class jn extends En.w{constructor(e,t,n="",o){super(),this.searchText="",this.connections=[],this.externalConnectionIds=[],this.data=[],this.mainConcept=e,this.searchLinkers=t,this.textSearch=n,o&&(this.format=o)}listenToEvent(e){if(this.eventHandlers[e])return;const t=t=>Wn(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return Wn(this,void 0,void 0,function*(){try{let n=yield xe.d.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield xe.d.GetConnection(n[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||t.compositionIds.push(e.ofTheConceptId),t.compositionIds.includes(e.toTheConceptId)||t.compositionIds.push(e.toTheConceptId)});t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw console.error("Error in RecursiveSearchObservable event listener:",e),t.isUpdating=!1,e}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}bind(){return Wn(this,void 0,void 0,function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;const e=yield qe(this.mainConcept,this.searchLinkers,this.textSearch);this.compositionIds=e.compositionIds||[],this.internalConnections=e.internalConnections||[],this.externalConnectionIds=e.externalConnections||[],this.linkers=this.externalConnectionIds,this.connections=yield(0,it.j)(this.externalConnectionIds);for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return Wn(this,void 0,void 0,function*(){return this.externalConnectionIds=this.linkers,this.format&&this.format==An.XZ?this.data={compositionIds:this.compositionIds,internalConnections:this.internalConnections,externalConnections:this.externalConnectionIds}:this.data=yield(0,je.p8)(this.compositionIds,this.internalConnections),this.data})}}function Vn(e,t,n="",o){return new jn(e,t,n,o)}var $n=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Hn extends En.w{constructor(e,t,n,o=An.y0){super(),this.searchQuery=[],this.format=An.y0,this.mainCompositionIds=[],this.searchCharacter="",this.token="",this.searchStructure=e,this.searchQuery=t,this.searchQuery[0].type=e.composition,this.searchCharacter=e.composition,this.format=o,this.token=Oe.b.BearerAccessToken}listenToEventType(e){if(this.eventHandlers[e])return;const t=e=>$n(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return $n(this,void 0,void 0,function*(){try{let n=e;t.mainCompositionIds.includes(null==n?void 0:n.detail)||(t.mainCompositionIds.unshift(null==n?void 0:n.detail),t.conceptIds.push(null==n?void 0:n.detail),t.listenToEvent(null==n?void 0:n.detail),xe.d.GetConnectionsOfConcept(null==n?void 0:n.detail).then(e=>{for(let n=0;n<e.length;n++)t.linkers.push(e[n].id)})),t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw console.error("Error in GetLinkListObservable event listener:",e),t.isUpdating=!1,e}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}bind(){return $n(this,void 0,void 0,function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;var e=yield(0,g.A)(this.searchCharacter);let t=yield Ln(this.searchStructure,this.searchQuery,this.token);this.conceptIds=t.compositionIds,this.internalConnections=t.internalConnections,this.linkers=t.linkers,this.reverse=t.reverse,this.mainCompositionIds=t.mainCompositionIds,this.listenToEventType(e.id);for(let e=0;e<this.mainCompositionIds.length;e++)this.listenToEvent(this.mainCompositionIds[e])}return yield this.build()})}build(){return $n(this,void 0,void 0,function*(){return yield(0,ot.r)(this.conceptIds),this.format==An.y0?this.data=yield(0,Un.yV)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse):this.data=yield(0,Un._W)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse),this.data})}}function qn(e,t,n,o=An.y0){return new Hn(e,t,n,o)}var zn=n(4698),Jn=n(6915),Qn=n(2615);class Yn{constructor(e,t,n,o,i,r,s,c=!1,a,d,u){this.structureType="lconcept",this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=l.B.getRandomizer(),this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=o,this.characterValue=r,this.accessId=i,this.type=null,this.isNew=c,this.typeCharacter=s,this.entryTimeStamp=a,this.updatedTimeStamp=d,this.isSynced=!1,this.referentId=u}getType(){console.log(this.typeId)}}class Xn{constructor(e,t,n,o,i,r){this.isTemp=!1,this.applicationId=l.B.getRandomizer(),this.type=(0,W.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.typeId=o,this.ghostId=e,this.orderId=i,this.typeCharacter="",this.accessId=r,this.typeCharacter="",this.entryTimeStamp=(0,W.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date}}class Zn{constructor(){this.compositionId=0,this.userId=999,this.sessionId=999,this.accessId=4,this.ofTheCompositionId=0,this.patchObject={}}}class Kn{constructor(){this.id="0",this.remote_address="",this.server_port="",this.server_address="",this.server_name="",this.server_software="",this.http_user_agent="",this.self="",this.port="",this.userId="",this.email=""}}var eo=n(628);class to{constructor(){this.type="",this.search="",this.logicoperator="=",this.index=0,this.composition=!0,this.name="",this.operateon=""}}class no{constructor(){this.type="",this.search="",this.composition="",this.internalComposition="",this.userId=999,this.inpage=10,this.page=1,this.auth=!0}}var oo=n(7887),io=n(3075),ro=n(7869),so=n(9635),co=n(9700);class ao{static initialize(){try{console.warn("Initialized Application Monitoring for tracking errors..."),this.initGlobalErrorHandlers(),this.logCatchError(),this.logErrorEvent(),this.logUnhandledError(),this.logUserInteractions(),this.logNetworkRequests(),this.logRouteChanges()}catch(e){console.error("Error during Application Monitoring initialization:",e)}}static initGlobalErrorHandlers(){try{if(console.log("this is the window",window),void 0===typeof window)return;window.onerror=(e,t,n,o,i)=>{const r=Oe.b.sessionId||"unknown",s={message:e,source:t,lineno:n,colno:o,stack:(null==i?void 0:i.stack)||"undefined",requestFrom:l.B.BASE_APPLICATION,sessionId:r};co.V.logApplication("ERROR","Runtime Error",s),co.V.log("ERROR","Runtime Error",s)},window.onunhandledrejection=e=>{const t=Oe.b.sessionId||"unknown";co.V.logApplication("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:t}),co.V.log("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:t})}}catch(e){console.warn("Failed to initialize global error handlers:",e)}}static logCatchError(){try{const e=console.error;console.log("Inside originalConsoleError..."),console.error=function(...t){if("Intercepted Fetch Error:"==(null==t?void 0:t[0]))return;const n="Console Error",o=Oe.b.sessionId||"unknown",i={arguments:t.map(e=>lo(e)),requestFrom:l.B.BASE_APPLICATION,sessionId:o};co.V.logApplication("ERROR",n,i),co.V.log("ERROR",n,i),e.apply(console,t)}}catch(e){console.warn("Failed to override console.error:",e)}}static logErrorEvent(){try{window.addEventListener("error",e=>{var t;console.log("Inside error event...");const n=Oe.b.sessionId||"unknown",o={error:(null===(t=e.error)||void 0===t?void 0:t.message)||e.message,source:e.filename,line:e.lineno,column:e.colno,stack:e.error?lo(e.error.stack):void 0,requestFrom:l.B.BASE_APPLICATION,sessionId:n},i="Unhandled Error";co.V.logApplication("ERROR",i,o),co.V.log("ERROR",i,o)})}catch(e){console.warn("Failed to add error event listener:",e)}}static logUnhandledError(){try{window.addEventListener("unhandledrejection",e=>{var t,n;console.log("Inside unhandledrejection...");const o=Oe.b.sessionId||"unknown",i={reason:(null===(t=e.reason)||void 0===t?void 0:t.message)||String(e.reason),stack:(null===(n=e.reason)||void 0===n?void 0:n.stack)||"No stack trace available",requestFrom:l.B.BASE_APPLICATION,sessionId:o};co.V.logApplication("ERROR","Unhandled Promise Rejection",i),co.V.log("ERROR","Unhandled Promise Rejection",i)})}catch(e){console.warn("Failed to add unhandled rejection event listener:",e)}}static logUserInteractions(){document.addEventListener("click",e=>{var t;const n=Oe.b.sessionId||"unknown",o=e.target,i={element:o.tagName,id:o.id,classes:o.className,text:null===(t=o.innerText)||void 0===t?void 0:t.slice(0,50),requestFrom:l.B.BASE_APPLICATION,sessionId:n};co.V.logApplication("INFO","User Click",i)}),document.addEventListener("input",e=>{const t=e.target;Oe.b.sessionId,t.tagName,t.id,t.value,l.B.BASE_APPLICATION}),document.addEventListener("scroll",()=>{Oe.b.sessionId,window.scrollY,l.B.BASE_APPLICATION})}static logNetworkRequests(){try{if(void 0===typeof window)return;Oe.b.sessionId;const e=null===window||void 0===window?void 0:window.fetch;if(!e)throw new Error("Original fetch is not available.");const t=[l.B.PostLogger(),l.B.PostPrefetchConceptConnections()];window.fetch=(...n)=>{return o=this,i=void 0,s=function*(){const o=Oe.b.sessionId||"unknown",[i,r]=n,s=i instanceof Request?i.url:i instanceof URL?i.toString():i;if(t.includes(s))return console.log("Ignored URLs detected : ",s),e(...n);let c={request:{type:"REQUEST",message:"Network Request",method:(null==r?void 0:r.method)||"GET",url:s,body:null==r?void 0:r.body,requestFrom:l.B.BASE_APPLICATION,sessionId:o}};try{const t=yield e(...n);return c.response={type:"RESPONSE",message:"Network Response",url:s,status:t.status,requestFrom:l.B.BASE_APPLICATION,sessionId:o},t}catch(e){throw c.response={type:"ERROR",message:"Network Request Failed",url:s,error:e instanceof Error?e.message:String(e),requestFrom:l.B.BASE_APPLICATION,sessionId:o},co.V.logApplication("ERROR","Failed Network Request",c),new Error(`Network request failed for ${s}: ${e.message}`)}},new((r=void 0)||(r=Promise))(function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function c(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r(function(e){e(o)})).then(n,c)}a((s=s.apply(o,i||[])).next())});var o,i,r,s}}catch(e){console.warn("Failed to override network requests:",e)}}static logPerformanceMetrics(){void 0!==typeof window&&(null===window||void 0===window||window.addEventListener("load",()=>{const e=performance.timing;Oe.b.sessionId,e.loadEventEnd,e.navigationStart,e.domContentLoadedEventEnd,e.navigationStart,l.B.BASE_APPLICATION}))}static logRouteChanges(){const e=history.pushState;setTimeout(()=>{ao.logOnWindowLoad()},3e3),history.pushState=function(...t){const n=Oe.b.sessionId||"unknown",o={url:t[2]?new URL(t[2],location.origin).href:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:n};return co.V.logApplication("ROUTE","Route Change",o),e.apply(this,t)},null===window||void 0===window||window.addEventListener("beforeunload",()=>{const e=Oe.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};co.V.logApplication("ROUTE","Unload",t)}),null===window||void 0===window||window.addEventListener("popstate",()=>{const e=Oe.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};co.V.logApplication("ROUTE","Route Changed (Back/Forward)",t)})}static logOnWindowLoad(){const e=Oe.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};co.V.logApplication("ROUTE","Initial Load",t)}static logSample(){const e=Oe.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};co.V.logApplication("ROUTE","Sample",t)}static logWebSocketEvents(){if(void 0===typeof window)return;const e=Oe.b.sessionId||"unknown",t=WebSocket;window.WebSocket=class extends t{constructor(t,n){super(t,n);const o={url:t.toString(),requestFrom:l.B.BASE_APPLICATION,sessionId:e};co.V.logApplication("INFO","WebSocket Open",o),this.addEventListener("message",e=>{const n=Oe.b.sessionId||"unknown",o={url:t,data:e.data,requestFrom:l.B.BASE_APPLICATION,sessionId:n};co.V.logApplication("INFO","WebSocket Message",o)}),this.addEventListener("error",e=>{const n=Oe.b.sessionId||"unknown",o={url:t,error:e instanceof Error?e.message:String(e),requestFrom:l.B.BASE_APPLICATION,sessionId:n};co.V.logApplication("ERROR","WebSocket Error",o)}),this.addEventListener("close",()=>{const e=Oe.b.sessionId||"unknown",n={url:t,requestFrom:l.B.BASE_APPLICATION,sessionId:e};co.V.logApplication("INFO","WebSocket Closed",n)})}}}}function lo(e){try{return JSON.stringify(e,(e,t)=>t&&"object"==typeof t&&t instanceof Error?{message:t.message,stack:t.stack}:t)}catch(e){return"Error while serializing value"}}const uo=(e,t,...n)=>{return o=void 0,i=[e,t,...n],s=function*(e,t,n=!1){try{let o=l.B.sendMail();n&&(o=l.B.sendBulkMail());const i=yield fetch(o,{method:"POST",body:e instanceof FormData?e:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),r=i.headers.get("content-type");if(!i.ok){const e=yield i.json();return console.info(`${i.status} ${e}`),null}const s=yield i.json();return r&&r.includes("text/plain")?yield i.text():s}catch(e){return console.error(e),null}},new((r=void 0)||(r=Promise))(function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function c(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r(function(e){e(o)})).then(n,c)}a((s=s.apply(o,i||[])).next())});var o,i,r,s};class ho{constructor(){this.inDevelopment=!1,this.subscribers=[]}notify(e=null){this.subscribers.map(t=>{t(e||this.data)})}dataChange(e){this.subscribers.push(e)}}class po extends ho{constructor(){super(...arguments),this.element=null,this.elementIdentifier=0,this.widgetMounted=!1}getComponent(){return this.element}getElementById(e){let t=this.getComponent(),n=document.body;if(t){let o=t.querySelector("#"+e);if(o)return n=o,n}return null}createWidgetWrapperIdentifier(){return this.elementIdentifier=1e4*Math.random(),this.elementIdentifier.toString()}}class fo extends po{constructor(){super(...arguments),this.html="",this.css="",this.js="",this.state={},this.previousState={},this.childWidgets=[],this.childWidgetElement=[],this.widgetState={},this.parentElement=""}querySelector(e){return this.element?this.element.querySelector(e):null}querySelectorAll(e){return this.element?this.element.querySelectorAll(e):null}getElement(){return this.element}setTitle(e){document.title=e}getHtml(){return this.html}UpdateChildData(e,t){let n=t;n.data=e,n.render(),n.update()}update(){}setState(e){this.previousState=Object.assign({},this),this.data=e,this.state=Object.assign({},this),this.hasStateChanged()&&(this.notify(),this.render())}setStateProperty(e){this.previousState=Object.assign({},this),Object.assign(this,e),this.state=Object.assign({},this),this.hasStateChanged()&&(this.notify(),this.render())}hasStateChanged(){return!this.isPropertyEqual(this.state,this.previousState)}isPropertyEqual(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let i of n){if(!o.includes(i))return!1;for(let n of o)if(i==n&&"state"!=i&&"previousState"!=i&&e[i]!=t[i])return!1}return!0}loadChildWidgets(){this.childWidgets.map(e=>{let t=this.getElementById(e.parentElement);t&&(t.innerHTML=""),e.mount(t)})}render(){this.element&&(this.element.innerHTML=this.getHtml()),this.loadChildWidgets(),this.after_render()}getElementByClassName(e){let t=this.getComponent();return t?null==t?void 0:t.querySelectorAll("."+e):[]}mount_child(){}mount(e){return t=this,n=void 0,i=function*(){e&&(this.element=document.createElement("div"),this.element.id=this.createWidgetWrapperIdentifier(),this.element.innerHTML=this.getHtml(),this.element.classList.add("mftsccs-marking-rendered"),e.appendChild(this.element),this.parentElement=e.id,this.before_render(),this.mount_child(),this.widgetMounted=!0)},new((o=void 0)||(o=Promise))(function(e,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(s,c)}a((i=i.apply(t,n||[])).next())});var t,n,o,i}before_render(){this.render()}after_render(){console.log("this is calling the after render",this)}renderChildWidgets(){function e(t){var n;t&&(null===(n=t.childWidgets)||void 0===n||n.forEach(t=>{e(t)}),t.render())}console.log("this is the render child widget",this),this.childWidgets.forEach(t=>{e(t)})}setWidgetState(e,t){this.widgetState[e]=t,function e(t){t&&Array.isArray(t.childWidgets)&&t.childWidgets.forEach(n=>{n.widgetState=Object.assign(Object.assign({},n.widgetState),t.widgetState),e(n)})}(this),this.renderChildWidgets()}getWidgetState(e,t){return Object.keys.length&&this.widgetState[e]?this.widgetState[e]:t}}var vo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class yo extends fo{constructor(){super(...arguments),this.childComponents=[],this.componentMounted=!1,this.oldHtml=null,this.phonebooks=[],this.childrenData={},this.childWidgets=[],this.typeValueList=[],this.widgetType="the_element_name",this.parentConceptList=[],this.customFunctions=[],this.widgetDependenciesData=""}getUserId(){return vo(this,void 0,void 0,function*(){const e=yield new Promise(e=>{let t=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";t?e(JSON.parse(t)):e()});return null==e?void 0:e.userId})}getTypeValueList(){return vo(this,arguments,void 0,function*(e=""){return new Promise(t=>vo(this,void 0,void 0,function*(){const n=null==(e=this.widgetType)?void 0:e.match(/^[a-z0-9]+_[a-z0-9]+/i),o=n?n[0]:"",i=null==e?void 0:e.match(/^([a-z0-9]+).*_([a-z0-9]+)$/i),r=i?`${i[1]}_${i[2]}`:"";let s=[],c=new to;c.type=r,c.search="1",c.logicoperator=">",c.name="emailfilter",c.operateon="entityEmail",c.composition=!1,s.push(c);let a=new bo;a.typeConnection=e,a.name="entityEmail";let l=new bo;l.type=o,l.filterLogic="( emailfilter )",l.filters=s,l.name="top",l.inpage=100,l.freeschemaQueries=[a],l.outputFormat=An.y0,Bo(l,"").subscribe(n=>{if(null==n?void 0:n.length){const i=null==n?void 0:n.map(t=>{var n,i,s,c,a,l,d;const u=null===(c=null===(s=null===(i=null===(n=t.data)||void 0===n?void 0:n[o])||void 0===i?void 0:i[e])||void 0===s?void 0:s.data)||void 0===c?void 0:c[r];return{id:null===(d=null===(l=null===(a=t.data)||void 0===a?void 0:a[o])||void 0===l?void 0:l[e])||void 0===d?void 0:d.id,name:u,text:u}});return this.typeValueList=i,t(i),i}})}))})}setTitle(e){document.title=e}getHtml(){return this.html}createRandomNumber(){return this.elementIdentifier=1e4*Math.random(),this.elementIdentifier}mount_child(){return vo(this,void 0,void 0,function*(){try{new Function("tsccs",`\n return (async function() {\n ${this.mountChildWidgetsFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the mount child",e),e}})}setProperty(e){return vo(this,void 0,void 0,function*(){return this.widgetType=e,this.getTypeValueList(this.widgetType).then(()=>{var e,t,n;null===(e=this.element)||void 0===e||e.setAttribute("data-type-value",this.widgetType),null===(n=null===(t=this.element)||void 0===t?void 0:t.parentElement)||void 0===n||n.setAttribute("data-type-value",this.widgetType),this.render()}),this})}createTypeEditor(e){!function(e,t){if(e){const n=document.querySelector("#widget-properties #widget-type"),o=null==n?void 0:n.querySelectorAll("input");null==o||o.forEach(e=>{null==e||e.remove()});const i=e.target.closest(".added-widget-container"),r=e.target.closest("div");let s="";i?s=null==i?void 0:i.getAttribute("data-type-value"):r&&(s=null==r?void 0:r.getAttribute("data-type-value"));const c=document.createElement("input");c.setAttribute("type","text"),c.setAttribute("name","input-widgetTypeValue"),c.setAttribute("of",t.elementIdentifier.toString()),c.setAttribute("class","form-control"),c.setAttribute("id","widgetType"),c.setAttribute("onchange","updateWidgetTypeValue(event)"),t.widgetType?c.value=t.widgetType:c.setAttribute("placeholder","e.g. the_entity");let a=t;c.addEventListener("change",function(e){var t,n,o;const i=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value;a.widgetType=i,a.before_render(),a.loadChildWidgets(),null===(o=null===(n=a.element)||void 0===n?void 0:n.parentElement)||void 0===o||o.setAttribute("data-type-value",a.widgetType)}),null==n||n.appendChild(c)}}(e,this)}mount(e){return vo(this,void 0,void 0,function*(){if(e){this.element=document.createElement("div"),this.element.id=this.createWidgetWrapperIdentifier();let t=this;this.inDevelopment?(this.element.onclick=function(e){e.preventDefault(),t.createTypeEditor(e)},this.element.className="mftsccs-marking-element"):this.element.classList.add("mftsccs-marking-rendered"),this.element.innerHTML=this.getHtml(),null==e||e.setAttribute("data-type-value",t.widgetType),e.appendChild(this.element),this.parentElement=e.id,0==this.componentMounted||0==this.widgetMounted?(this.render_custom_functions(),this.render_widgetDependencies(),this.before_render(),this.mount_child(),this.widgetMounted=!0,this.componentMounted=!0):this.render(),this.childWidgetElement=this.getElementByClassName("added-widget-container")}})}render_widgetDependencies(){try{new Function("tsccs",`\n return (async function() {\n ${this.widgetDependenciesData}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}render_custom_functions(){var e;const t=null===(e=this.customFunctions)||void 0===e?void 0:e.map(e=>null==e?void 0:e.code).join("");try{new Function("tsccs",`\n return (async function() {\n ${t}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.error("This is the error in the render_custom_functions",e),e}}before_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.componentDidMountFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}after_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.addEventFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the after render",e),e}}CreateConnectionBetweenEntityLocal(e,t,n){return vo(this,void 0,void 0,function*(){var o;const i=e.userId,r=(null===(o=e.type)||void 0===o?void 0:o.characterValue)+"_"+n,s=yield(0,le.$)(r,999,999,i);return yield(0,Jt.F)(e.id,t.id,s.id,1e3),"connection created"})}}var go=n(3077),mo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Co{constructor(){this.actions={concepts:[],connections:[]},this.success=!0,this.transactionId=Math.random().toString().substring(5)}initialize(){return mo(this,void 0,void 0,function*(){yield eo.H.initializeTransaction(this.transactionId)})}commitTransaction(){return mo(this,void 0,void 0,function*(){if(!this.success)throw Error("Query Transaction Expired");yield eo.H.SyncDataOnline(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1})}commitTransactionWithoutAuth(){return mo(this,void 0,void 0,function*(){if(!this.success)throw Error("Query Transaction Expired");yield eo.H.SyncDataOnlineWithoutAuth(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1})}rollbackTransaction(){return mo(this,void 0,void 0,function*(){this.success=!1,this.actions={concepts:[],connections:[]},yield eo.H.rollbackTransaction(this.transactionId,this.actions)})}markAction(){return mo(this,void 0,void 0,function*(){yield eo.H.markTransactionActions(this.transactionId,this.actions)})}MakeTheInstanceConceptLocal(e,t){return mo(this,arguments,void 0,function*(e,t,n=!1,o,i,r=999,s=0){try{if(!this.success)throw Error("Query Transaction Expired");const c=yield(0,K.k)(e,t,n,o,i,r,s,this.actions);return yield this.markAction(),c}catch(e){throw console.log(e),this.success=!1,e}})}MakeTheTypeConceptLocal(e,t,n,o){return mo(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,le.$)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}})}CreateTheConceptLocal(e,t,n,o,i,r){return mo(this,arguments,void 0,function*(e,t,n,o,i,r,s=!1,c=0,a={concepts:[],connections:[]}){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,go.A)(e,t,n,o,i,r,s,c,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}})}CreateConnectionBetweenTwoConceptsLocal(e,t,n){return mo(this,arguments,void 0,function*(e,t,n,o=!1){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,gn.h)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}})}CreateTheConnectionLocal(e,t,n){return mo(this,arguments,void 0,function*(e,t,n,o=1,i="",r=999){try{if(!this.success)throw Error("Query Transaction Expired");const s=yield(0,Jt.F)(e,t,n,o,i,r,this.actions);return yield this.markAction(),s}catch(e){throw console.log(e),this.success=!1,e}})}CreateConnection(e,t,n){return mo(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield(0,Jt.d)(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}})}CreateConnectionBetweenEntityLocal(e,t,n){return mo(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield Go(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}})}CreateTheCompositionLocal(e){return mo(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,c=!1){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,G.R)(e,t,n,o,i,r,s,c,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}})}}const wo={number:/^\d+(\.\d+)?$/,text:/^[\s\S]*$/,textOnly:/^[A-Za-z\s]+$/,email:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,document:/\.(pdf|docx?|pptx?|xlsx?)$/i,sound:/\.(mp3|wav|ogg|flac)$/i,image:/\.(jpg|jpeg|png|gif|bmp|svg|webp)$/i,video:/\.(mp4|avi|mov|mkv|flv|webm)$/i,url:/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/,date:/^\d{4}-\d{2}-\d{2}$/,time:/^(?:[01]\d|2[0-3]):[0-5]\d$/,password:/^.{6,}$/,ipaddress:/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$|^([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})$/,uuid:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/};var Io=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class To{constructor(){To.cacheInitialized||To.initializeAnomalyParameters()}static initializeAnomalyParameters(){return Io(this,void 0,void 0,function*(){try{yield To.getAnomalyParameters(),To.refreshCache(),To.cacheInitialized=!0}catch(e){console.error("Error during anomaly parameter initialization:",e)}})}static getAnomalyParameters(){return Io(this,void 0,void 0,function*(){const e=Date.now();if(To.anomalyParamsCache&&e-To.lastFetchedTime<To.cacheExpiryThreshold)return console.log("Returning cached anomaly parameters"),To.anomalyParamsCache;try{return yield To.fetchAnomalyParameters()}catch(e){throw console.error("Error fetching anomaly parameters:",e),e}})}static fetchAnomalyParameters(){return Io(this,void 0,void 0,function*(){try{const e=yield fetch("https://devai.freeschema.com/v1/get-frontend-anomaly-parameters",{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to fetch anomaly parameters");const t=yield e.json();return To.anomalyParamsCache=t.data,To.lastFetchedTime=Date.now(),t.data}catch(e){throw console.error("API Fetch Error:",e),e}})}static refreshCache(){return Io(this,void 0,void 0,function*(){try{Date.now()-To.lastFetchedTime>To.cacheExpiryThreshold&&(yield To.getAnomalyParameters())}catch(e){console.error("Error refreshing anomaly parameters cache:",e)}})}detectDataType(e){for(const[t,n]of Object.entries(wo))if(n.test(e))return t;return null}checkConceptAnomaly(e,t){return Io(this,void 0,void 0,function*(){const n=[];try{if(!t)return n.push("Null value"),{valid:!1,warnings:n};const o=To.anomalyParamsCache;e.startsWith("the_")||(e=`the_${e}`);const i=o[e];if(console.log("Concept Details : ",i),!i)return console.warn(`No concept details found for type: ${e}`),n.push(`No concept details found for type: ${e}`),{valid:!1,warnings:n};const r=t.length,{min_length:s,max_length:c,data_types:a}=i,l=r>=s&&r<=c,d=this.detectDataType(t),u=a.includes(d);return l||n.push(`Length of '${t}' is outside the allowed range (min: ${s}, max: ${c}). Current length: ${r}.`),u||n.push(`Type mismatch for '${t}'. Expected types: ${a.join(", ")}, detected type: ${d}.`),l&&u&&n.push(`Concept ${e} is valid. Length: ${r}, Type: ${d}`),{valid:l&&u,warnings:n}}catch(o){return console.error(`Error checking anomaly for ${e} with value ${t}:`,o),{valid:!1,warnings:n}}})}static checkAnomalyInBulk(e){return Io(this,void 0,void 0,function*(){To.cacheInitialized||(yield To.initializeAnomalyParameters());try{const t={};for(const[n,o]of Object.entries(e)){const e=o.value,{valid:i,warnings:r}=yield(new To).checkConceptAnomaly(n,e);t[n]={valid:i,warnings:r}}return t}catch(e){throw console.error("Bulk Anomaly Check Error:",e),e}})}static getExportedFunction(){console.log("Main : ",o);const e=Object.keys(o);return console.log("The exported List : ",e),e}static getFunctionaAnomalyParameters(){}}To.anomalyParamsCache=null,To.cacheInitialized=!1,To.lastFetchedTime=0,To.cacheExpiryThreshold=6e5;var ko=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Ao{checkUniqueness(e,t){return ko(this,void 0,void 0,function*(){const n=co.V.logfunction("checkUniqueness");e.startsWith("the_")||(e="the_"+e);let o=(yield pe(e,999)).id,i=yield(0,re.A)(t,o);return console.log("This is the concept for validator",i),!(i.id>0||(co.V.logUpdate(n),0))})}validateField(e){return ko(this,void 0,void 0,function*(){var t;const n=co.V.logfunction("validateField");try{performance.now();const o={},{name:i,value:r,type:s,dataType:c,pattern:a,conceptType:l,maxLength:d,minLength:u,minValue:h,maxValue:p,accept:f,file:v,required:y,isUnique:g}=e;if(console.log("Validation is happening on : \n",e),!y||null!==r&&""!==r||(o.required=`The field ${i} is required.`),c&&r){let e=wo[c];e&&""!==r&&!e.test(r)&&(o.dataType=`Invalid value for ${c}`)}if(a&&r){const e="string"==typeof a?new RegExp(a):a;""===r||e.test(r)||(o.pattern="Pattern doesn't match with value")}if(r&&null!=d&&r.length>d&&(o.maxLength=`Length exceeds the maximum length of ${d}`),r&&null!=u&&r.length<u&&(o.minLength=`Length must be at least ${u} characters long`),null!=h&&r&&!isNaN(Number(r))&&Number(r)<h&&(o.minValue=`Value must be greater than or equal to ${h}`),null!=p&&r&&!isNaN(Number(r))&&Number(r)>p&&(o.maxValue=`Value must be less than or equal to ${p}`),v&&s&&f){const e=f.split(",").map(e=>e.trim().toLowerCase()),n=null===(t=v.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();n&&!e.includes(n)&&(o.accept=`File must be a valid file type: ${e.join(", ")}`)}return l&&g&&r&&((yield this.checkUniqueness(l,r))||(o.unique="Value is not unique")),co.V.logUpdate(n),console.log("Before Validation Result : ",o),o}catch(e){throw(0,u.ey)(n,"Validator.validateField",e),e}})}validateForm(e){return ko(this,void 0,void 0,function*(){const t=co.V.logfunction("validateForm");try{performance.now();const n={};for(const t in e){const o=yield this.validateField(e[t]);Object.keys(o).length>0&&(n[t]=o)}return co.V.logUpdate(t),n}catch(e){throw(0,u.ey)(t,"Validator.validateForm",e),e}})}validate(e){const t=co.V.logfunction("validate");try{let n={};return this.validateField(e).then(e=>{Object.keys(e).length>0?(n.status=!1,n.details=e):n.status=!0}),console.error("Error on validate object"),co.V.logUpdate(t),n}catch(e){(0,u.ey)(t,"Validator.validate",e)}}}const So=e=>{var t;const n=document.getElementsByName(e)[0];if(!n)return console.warn(`Element with NAME "${e}" not found.`),{name:null,value:null,type:null,dataType:null,pattern:null,conceptType:null,maxLength:null,minLength:null,minValue:null,maxValue:null,accept:null,file:null,required:!1,isUnique:!0};const o=n.hasAttribute("required")||"true"===n.getAttribute("data-required"),i=n.hasAttribute("isUnique")&&"true"===n.getAttribute("isUnique");return{name:n.name,value:n.value,type:n.type,dataType:n.getAttribute("data-type"),pattern:n.getAttribute("data-pattern"),conceptType:n.getAttribute("concept-type"),maxLength:n.getAttribute("maxlength")?parseInt(n.getAttribute("maxlength")):null,minLength:n.getAttribute("minlength")?parseInt(n.getAttribute("minlength")):null,minValue:n.getAttribute("min")?parseInt(n.getAttribute("min")):null,maxValue:n.getAttribute("max")?parseInt(n.getAttribute("max")):null,accept:n.getAttribute("accept")||null,file:"file"===n.type&&(null===(t=n.files)||void 0===t?void 0:t[0])||null,required:o,isUnique:i}};var No=n(2289);class bo{constructor(){this.type="",this.inpage=10,this.page=1,this.concepts=[],this.conceptIds=[],this.selectors=[],this.freeschemaQueries=[],this.filters=[],this.filterLogic="",this.typeConnection="",this.order="DESC",this.outputFormat=An.yv,this.name="",this.filterAncestor="",this.reverse=!1,this.limit=!1,this.isSecure=!0,this.includeInFilter=!1,this.isOldConnectionType=!1}}var _o=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Lo(e){var t=arguments;return _o(this,arguments,void 0,function*(e,n=""){const o=co.V.logfunction("FreeschemaQueryApi",t);var i=(0,d.ab)("application/json",n);const r=l.B.FreeschemaQueryUrl(),s=JSON.stringify(e);try{const e=yield fetch(r,{method:"POST",headers:i,body:s});return e.ok?yield e.json():((0,u.ry)(e),console.log("This is the freeschema query error",e.status),[])}catch(e){console.log("This is the freeschema query error others",e),(0,u.Mb)(e,r),(0,u.ey)(o,"FreeschemaQueryApi",e)}})}var Eo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class xo extends En.w{constructor(e,t){super(),this.query=new bo,this.countInfoStrings=[],this.order="DESC",this.totalCount=0,this.query=e,this.format=e.outputFormat,this.order=e.order}run(){return Eo(this,void 0,void 0,function*(){var e,t;try{this.query.outputFormat=An.BG,this.compositionIds=[];let n=yield Lo(this.query,"");return this.conceptIds=n.conceptIds,this.internalConnections=null!==(e=n.internalConnections)&&void 0!==e?e:[],this.linkers=null!==(t=n.linkers)&&void 0!==t?t:[],this.reverse=n.reverse,this.compositionIds=n.mainCompositionIds,this.totalCount=n.mainCount,this.countInfoStrings=n.countinfo,yield this.build()}catch(e){throw console.error("Error in SchemaQueryObservable.run():",e),e}})}bind(){return Eo(this,void 0,void 0,function*(){var e,t;try{if(this.compositionIds.length>0)for(let e=0;e<this.compositionIds.length;e++)this.removeListenToEvent(this.compositionIds[e]);if(this.isDataLoaded)for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);else{this.query.outputFormat=An.BG,this.compositionIds=[];let n=yield Lo(this.query,"");this.conceptIds=n.conceptIds,this.internalConnections=null!==(e=n.internalConnections)&&void 0!==e?e:[],this.linkers=null!==(t=n.linkers)&&void 0!==t?t:[],this.reverse=n.reverse,this.compositionIds=n.mainCompositionIds,this.totalCount=n.mainCount,this.countInfoStrings=n.countinfo}let n=yield this.build();if(!this.isDataLoaded){this.isDataLoaded=!0;for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);if(""!=this.query.type){let e=yield pe(this.query.type,999);e.id>0&&this.listenToEventType(e.id)}}for(let e=0;e<this.newIds.length;e++)this.listenToEvent(this.newIds[e]);return this.newIds=[],n}catch(e){throw console.error("Error in SchemaQueryObservable.bind():",e),e}})}build(){return Eo(this,void 0,void 0,function*(){try{co.V.logfunction("build",["schemaquery",this.compositionIds]);let e=(0,zn.w)(this.countInfoStrings);return this.format==An.y0?this.data=yield(0,Un.e$)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==An.ZJ?this.data=yield(0,Un.y6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==An.pU?this.data=yield(0,Un.rq)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==An.XZ?(console.log("this is the raw format"),this.data={},this.data.linkers=this.linkers,this.data.conceptIds=this.conceptIds,this.data.compositionIds=this.compositionIds,this.data.reverse=this.reverse,this.data.countInfos=e,this.data.order=this.order):this.data=yield(0,Un.b6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e),this.data}catch(e){throw console.error("Error in SchemaQueryObservable.build():",e),e}})}}function Bo(e,t){return new xo(e,t)}function Oo(e,t){return new xo(e,t).execute()}class Ro{constructor(){this.id=0,this.name="",this.html="",this.css="",this.js="",this.library={css:[],js:[]},this.assistant={id:"",input:"",type:""},this.timestamp="",this.widgetId=0,this.type="",this.clean="",this.after_render="",this.before_render="",this.custom_functions=[],this.update="",this.origin=0,this.version=0,this.mount_child="",this.children=[],this.wrapper="0",this.widget=new yo,this.dependency="",this.root=0}}var Do=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Go(e,t,n){return Do(this,arguments,void 0,function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,c,a;const l=co.V.logfunction("CreateConnectionBetweenEntityLocal",[e.id,t.id,n]);if(Qi)try{const a=yield ir("CreateConnectionBetweenEntityLocal",{concept1Data:e,concept2Data:t,linker:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(c=null===(s=null==a?void 0:a.actions)||void 0===s?void 0:s.connections)||void 0===c?void 0:c.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.log("CreateConnectionBetweenEntityLocal error sw: ",e),lr(e)}const d=e.userId,u=(null===(a=e.type)||void 0===a?void 0:a.characterValue)+"_"+n,h=yield(0,le.$)(u,999,999,d,o);console.log(yield(0,Jt.F)(e.id,t.id,h.id,1e3,void 0,void 0,o)),co.V.logUpdate(l)})}var Po=n(4310);function Fo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var Uo=n(490),Mo=n(276);function Wo(e,t,n){const o=Oe.b.sessionId||"unknown",i={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:o,description:t};co.V.logApplication("USER_EVENT",e,i)}class jo extends fo{constructor(e,t,n,o="",i=10){super(),this.inpage=10,this.selector=t,this.mainType=e,this.filterType=o,this.inpage=i,this.parentDomElement=n,this.mount(this.parentDomElement)}before_render(){this.render()}addFilter(e){if(""!=e){let t=new to;t.search=e,t.type=this.filterType,t.logicoperator="like",t.operateon="selector",t.name="selector_filter";let n="( selector_filter )";this.query.filters=[t],this.query.filterLogic=n}else this.query.filters=[],this.query.filterLogic="";console.log("this is the filters",this.query)}after_render(){let e=this.getElementById("selector"),t=this.getElementById("search-bar"),n=this;t.onchange=()=>{n.addFilter(t.value),n.mainDetails.update()};let o=new bo;o.type=this.mainType,o.inpage=this.inpage;let i=new bo;i.typeConnection=this.selector,i.name="selector",o.freeschemaQueries=[i],this.query=o,Bo(this.query,"").subscribe((t,n)=>{let o={};this.mainDetails=n;for(let e=0;e<t.length;e++){let n=t[e],i=n.id,r=n[this.mainType];if(console.log("this is the selected data myItem",r,t[e],this.mainType,n),r){let e=r[this.selector];if(e){const t=Object.values(e)[0];o[i]=t}}}Fo(e);for(const[t,n]of Object.entries(o)){const o=document.createElement("option");o.value=t,o.textContent=n,e.appendChild(o)}console.log("this is the output from selector",t)})}getHtml(){const e=document.createElement("style");return e.textContent="\n.search-select-wrapper {\n width: 300px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-family: Arial, sans-serif;\n}\n\n#search-bar {\n padding: 8px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 6px;\n}\n\n#selector {\n padding: 6px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 6px;\n}\n",document.head.prepend(e),this.html='\n <div class="search-select-wrapper">\n <input type="text" placeholder="Select or type..." id=\'search-bar\'>\n <select id=\'selector\'>\n </div>',this.html}}var Vo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class $o{static get baseUrl(){return l.B.ACCESS_CONTROL_BASE_URL}static getAsync(e){return Vo(this,void 0,void 0,function*(){const t=yield fetch(`${this.baseUrl}${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error(`GET '${e}' failed with status ${t.status}`);const n=yield t.json();if(null==n)throw new Error(`The response for GET '${e}' returned null.`);return n})}static postAsync(e,t){return Vo(this,void 0,void 0,function*(){const n=yield fetch(`${this.baseUrl}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`POST '${e}' failed with status ${n.status}`);const o=yield n.json();if(null==o)throw new Error(`The response for POST '${e}' returned null.`);return o})}static deleteAsync(e,t){return Vo(this,void 0,void 0,function*(){const n={method:"DELETE",headers:{"Content-Type":"application/json"}};null!=t&&(n.body=JSON.stringify(t));const o=yield fetch(`${this.baseUrl}${e}`,n);if(!o.ok)throw new Error(`DELETE '${e}' failed with status ${o.status}`);const i=yield o.json();if(null==i)throw new Error(`The response for DELETE '${e}' returned null.`);return i})}assignAccessAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/assign",e)})}checkAccessAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/check",e)})}revokeAccessAsync(e){return Vo(this,void 0,void 0,function*(){return $o.deleteAsync("/access/revoke",e)})}assignAccessBulkAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/assign/bulk",e)})}revokeAccessBulkAsync(e){return Vo(this,void 0,void 0,function*(){return $o.deleteAsync("/access/revoke/bulk",e)})}checkAccessBulkAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/check/bulk",e)})}getAccessByIdAsync(e){return Vo(this,void 0,void 0,function*(){return $o.getAsync(`/access/${e}`)})}setAccessInheritanceAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/inheritance",e)})}getAccessInheritanceStatusAsync(e){return Vo(this,arguments,void 0,function*(e,t=999){return $o.getAsync(`/access/inheritance/status?accessId=${e}&connectionTypeId=${t}`)})}assignSuperAdminAccessAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/super-admin",e)})}revokeSuperAdminAccessAsync(e){return Vo(this,void 0,void 0,function*(){return $o.deleteAsync("/access/super-admin",e)})}checkSuperAdminStatusAsync(e){return Vo(this,void 0,void 0,function*(){return $o.getAsync(`/access/super-admin?accessId=${e}`)})}assignConceptAccessAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/concept/assign",e)})}assignConceptAccessBulkAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/concept/assign/bulk",e)})}revokeConceptAccessBulkAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/concept/revoke/bulk",e)})}setParentAccessInheritanceAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/inheritance/parent",e)})}removeParentAccessInheritanceAsync(e,t){return Vo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent?accessId=${e}`;return null!=t&&(n+=`&parentAccessId=${t}`),$o.deleteAsync(n)})}hasParentAccessInheritanceAsync(e,t){return Vo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/status?accessId=${e}`;return null!=t&&(n+=`&parentAccessId=${t}`),$o.getAsync(n)})}getParentAccessIdAsync(e){return Vo(this,void 0,void 0,function*(){return $o.getAsync(`/access/inheritance/parent?accessId=${e}`)})}setParentAccessInheritanceByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/inheritance/parent/concept",e)})}setParentAccessInheritanceBulkByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/inheritance/parent/concept/bulk",e)})}removeParentAccessInheritanceByConceptAsync(e,t){return Vo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/concept?childConceptId=${e}`;return null!=t&&(n+=`&parentConceptId=${t}`),$o.deleteAsync(n)})}removeParentAccessInheritanceBulkByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.deleteAsync("/access/inheritance/parent/concept/bulk",e)})}hasParentAccessInheritanceByConceptAsync(e,t){return Vo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/concept/status?childConceptId=${e}`;return null!=t&&(n+=`&parentConceptId=${t}`),$o.getAsync(n)})}getParentAccessIdByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.getAsync(`/access/inheritance/parent/concept?childConceptId=${e}`)})}assignSuperAdminByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/super-admin/concept",e)})}revokeSuperAdminByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.deleteAsync("/access/super-admin/concept",e)})}checkSuperAdminByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.getAsync(`/access/super-admin/concept?conceptId=${e}`)})}setAccessInheritanceByConceptAsync(e){return Vo(this,void 0,void 0,function*(){return $o.postAsync("/access/inheritance/concept",e)})}getAccessInheritanceStatusByConceptAsync(e){return Vo(this,arguments,void 0,function*(e,t=999){return $o.getAsync(`/access/inheritance/concept/status?conceptId=${e}&connectionTypeId=${t}`)})}}var Ho=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class qo{constructor(e){this.apiClient=e||new $o}checkAccess(e,t,n){return Ho(this,void 0,void 0,function*(){var o;if(!t||""===t.trim())throw new Error("Permission is required");return null!==(o=(yield this.checkAccessBulk([e],t.toLowerCase(),n)).get(e))&&void 0!==o&&o})}checkAccessBulk(e,t,n){return Ho(this,void 0,void 0,function*(){var o,i,r,s,c,a;if(!t||""===t.trim())throw new Error("Permission is required");t=t.toLowerCase();const l=new Map;if(!e||0===e.length)return l;if(null!=n&&n>0)try{if(yield this.isSuperAdmin(n)){for(const t of e)l.set(t,!0);return l}}catch(e){}const d=[],u=new Set,h=new Map;let p=null;if(null!=n&&n>0)try{p=yield(0,z.A)(n)}catch(e){}const f=yield(0,ot.r)(e),v=new Map;for(const e of f)v.set(e.id,e);const y=new Map;for(const t of e){const e=null!==(o=v.get(t))&&void 0!==o?o:yield(0,z.A)(t);if(!e||0===e.id){l.set(t,!1);continue}const n=null!==(i=e.accessId)&&void 0!==i?i:0,c=null!==(r=e.typeId)&&void 0!==r?r:0;if(p&&p.userId&&p.userId===e.userId){l.set(t,!0);continue}if(null===e.referentId||void 0===e.referentId||0===e.referentId){l.set(t,!0);continue}if(n<1e4){l.set(t,!0);continue}let a=0;if(c>0){let e=y.get(c);if(!e)try{e=yield(0,z.A)(c),y.set(c,e)}catch(e){}e&&(a=null!==(s=e.accessId)&&void 0!==s?s:0)}d.push({conceptId:t,accessId:n,typeAccessId:a}),n>0&&(u.add(n),h.set(n,t)),a>0&&u.add(a)}if(0===d.length)return l;const g=yield this.resolveBulkInheritanceGraph(u,0,h),m=[],C=new Set;for(const e of g.values())for(const t of e)C.has(t)||(C.add(t),m.push(t));const w=yield this.resolveSubjects(n),I=yield this.resolveBulkDecisions(m,t,w);for(const e of d){const t=null!==(c=g.get(e.accessId))&&void 0!==c?c:[e.accessId],n=e.typeAccessId>0?null!==(a=g.get(e.typeAccessId))&&void 0!==a?a:[e.typeAccessId]:[];l.set(e.conceptId,this.hasAnyGrant(t,n,w,I))}return l})}getConceptIdsWithPermission(e,t,n){return Ho(this,void 0,void 0,function*(){if(!e||""===e.trim())throw new Error("Permission is required");if(!t||0===t.length)return[];const o=yield this.checkAccessBulk(t,e.toLowerCase(),n);return t.filter(e=>!0===o.get(e))})}resolveBulkInheritanceGraph(e,t,n){return Ho(this,void 0,void 0,function*(){var o,i,r,s,c,a,l,d,u,h,p,f,v,y;const g=new Map,m=new Set;let C=new Set(e),w=0;for(;C.size>0;){if(w>=10){console.warn("[AccessControl] BFS depth limit (10) reached.");break}w++;const e=new Set;for(const e of C)m.add(e);const I=Array.from(C);for(const t of I)try{const n=null!==(o=yield(0,fe.l)(t))&&void 0!==o?o:[];for(const o of n){if("the_parent_access_inheritance"!==(null!==(c=null!==(r=null!==(i=o.connectionTypeName)&&void 0!==i?i:o.typeName)&&void 0!==r?r:null===(s=o.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"").toString().toLowerCase())continue;const n=null!==(l=null!==(a=o.toTheConceptId)&&void 0!==a?a:o.toConceptId)&&void 0!==l?l:0;n>0&&!m.has(n)&&(g.has(t)||g.set(t,[]),g.get(t).push(n),e.add(n))}}catch(e){}for(const t of I)try{const n=yield this.apiClient.getParentAccessIdAsync(t);if(!0===(null==n?void 0:n.status)&&void 0!==n.data&&null!==n.data){const o=qo.parseIntData(n);null!==o&&o>0&&!m.has(o)&&(g.has(t)||g.set(t,[]),g.get(t).push(o),e.add(o))}}catch(e){}for(const o of I)try{const i=yield this.apiClient.getAccessInheritanceStatusAsync(o);if(!qo.parseBoolData(i))continue;const r=n.get(o);if(!r||0===r)continue;const s=null!==(d=yield(0,fe.l)(r))&&void 0!==d?d:[];for(const i of s){if((null!==(h=null!==(u=i.ofTheConceptId)&&void 0!==u?u:i.ofConceptId)&&void 0!==h?h:0)!==r)continue;if(t>0&&(null!==(p=i.typeId)&&void 0!==p?p:0)!==t)continue;const s=null!==(v=null!==(f=i.toTheConceptId)&&void 0!==f?f:i.toConceptId)&&void 0!==v?v:0;if(s)try{const t=yield(0,z.A)(s),i=null!==(y=null==t?void 0:t.accessId)&&void 0!==y?y:0;i>0&&!m.has(i)&&(g.has(o)||g.set(o,[]),g.get(o).push(i),n.set(i,s),e.add(i))}catch(e){}}}catch(e){}for(const t of m)e.delete(t);C=e}const I=new Map;for(const t of e){const e=[t],n=new Set([t]),o=[t];for(;o.length>0&&e.length<100;){const t=o.shift(),i=g.get(t);if(i)for(const t of i)n.has(t)||(n.add(t),e.push(t),o.push(t))}I.set(t,e)}return I})}resolveBulkDecisions(e,t,n){return Ho(this,void 0,void 0,function*(){var o;const i=new Map;for(const r of n)try{const n={accessIds:e,permission:t,entityId:r},s=yield this.apiClient.checkAccessBulkAsync(n);if(!0===(null==s?void 0:s.status)&&s.data&&Array.isArray(s.data)){const t=new Map;for(const e of s.data)t.set(e.accessId,e.hasAccess);for(const n of e)i.set(`${n}:${null!=r?r:0}`,null!==(o=t.get(n))&&void 0!==o&&o)}else for(const t of e)i.set(`${t}:${null!=r?r:0}`,!1)}catch(t){for(const t of e)i.set(`${t}:${null!=r?r:0}`,!1)}return i})}resolveSubjects(e){return Ho(this,void 0,void 0,function*(){var t,n,o,i,r,s,c;const a=[null];if(null!=e&&e>0){a.push(e);try{const l=null!==(t=yield(0,fe.l)(e))&&void 0!==t?t:[];for(const e of l){if("the_entity_s_group"!==(null!==(r=null!==(o=null!==(n=e.connectionTypeName)&&void 0!==n?n:e.typeName)&&void 0!==o?o:null===(i=e.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"").toString().toLowerCase())continue;const t=null!==(c=null!==(s=e.toTheConceptId)&&void 0!==s?s:e.toConceptId)&&void 0!==c?c:0;t>0&&a.push(t)}}catch(e){}}return a})}hasAnyGrant(e,t,n,o){for(const t of e)for(const e of n)if(!0===o.get(`${t}:${null!=e?e:0}`))return!0;for(const e of t)for(const t of n)if(!0===o.get(`${e}:${null!=t?t:0}`))return!0;return!1}assignAccess(e){return Ho(this,void 0,void 0,function*(){if(!e||!e.conceptIds||0===e.conceptIds.length)throw new Error("Request must contain at least one conceptId");try{const t=yield this.apiClient.assignConceptAccessBulkAsync(e);if(!0!==(null==t?void 0:t.status))throw new Error((null==t?void 0:t.message)||"Failed to assign bulk access");return(null==t?void 0:t.data)&&Array.isArray(t.data)?t.data:[]}catch(e){throw console.error("Failed to assign bulk access:",e),e}})}revokeAccess(e,t,n){return Ho(this,void 0,void 0,function*(){var o;try{const i=null!==(o=(yield(0,z.A)(e)).accessId)&&void 0!==o?o:0;if(0===i)throw new Error(`Concept with ID ${e} does not have a valid accessId`);const r=yield this.apiClient.revokeAccessAsync({accessId:i,permission:t,entityId:n});return!0===(null==r?void 0:r.status)}catch(o){throw new Error(`Error revoking access for concept ${e}, permission '${t}', entityId ${n}: ${o}`)}})}revokeAccessBulk(e){return Ho(this,void 0,void 0,function*(){if(!e||!e.conceptIds||0===e.conceptIds.length)throw new Error("Request must contain at least one conceptId");try{const t=yield this.apiClient.revokeConceptAccessBulkAsync(e);if(!0!==(null==t?void 0:t.status))throw new Error((null==t?void 0:t.message)||"Failed to revoke bulk concept access");return(null==t?void 0:t.data)&&Array.isArray(t.data)?t.data:[]}catch(e){throw console.error("Failed to revoke bulk concept access:",e),e}})}setAccessInheritance(e){return Ho(this,void 0,void 0,function*(){var t;try{const n=yield this.apiClient.setAccessInheritanceByConceptAsync({conceptId:e,connectionTypeId:999});return null!==(t=null==n?void 0:n.status)&&void 0!==t&&t}catch(t){throw new Error(`Error setting access inheritance for conceptId ${e}: ${t}`)}})}getAccessInheritanceStatus(e){return Ho(this,arguments,void 0,function*(e,t=999){try{const n=yield this.apiClient.getAccessInheritanceStatusByConceptAsync(e,t);return qo.parseBoolData(n)}catch(t){throw new Error(`Error getting access inheritance status for conceptId ${e}: ${t}`)}})}setAccessInheritanceStatus(e,t){return Ho(this,arguments,void 0,function*(e,t,n=999){var o;try{const i=yield this.apiClient.setAccessInheritanceByConceptAsync({conceptId:e,enable:t,connectionTypeId:n});return null!==(o=null==i?void 0:i.status)&&void 0!==o&&o}catch(t){throw new Error(`Error setting access inheritance status for conceptId ${e}: ${t}`)}})}setParentAccessInheritance(e,t){return Ho(this,void 0,void 0,function*(){try{const n=yield this.apiClient.setParentAccessInheritanceByConceptAsync({parentConceptId:t,childConceptId:e});if(!0===(null==n?void 0:n.status)){const e=qo.parseIntData(n);if(null!==e&&e>0)return e}return 0}catch(t){throw new Error(`Error setting parent access inheritance for conceptId ${e}: ${t}`)}})}setParentAccessInheritanceBulk(e,t){return Ho(this,void 0,void 0,function*(){try{const n=yield this.apiClient.setParentAccessInheritanceBulkByConceptAsync({parentConceptId:t,childConceptIds:e});return!0===(null==n?void 0:n.status)&&Array.isArray(n.data)?n.data:[]}catch(e){throw new Error(`Error setting bulk parent access inheritance for parentConceptId ${t}: ${e}`)}})}removeParentAccessInheritance(e,t){return Ho(this,void 0,void 0,function*(){var n;try{const o=yield this.apiClient.removeParentAccessInheritanceByConceptAsync(e,t);return null!==(n=null==o?void 0:o.message)&&void 0!==n?n:"Parent access inheritance removal failed"}catch(t){throw new Error(`Error removing parent access inheritance for conceptId ${e}: ${t}`)}})}removeParentAccessInheritanceBulk(e,t){return Ho(this,void 0,void 0,function*(){try{const n=yield this.apiClient.removeParentAccessInheritanceBulkByConceptAsync({parentConceptId:null!=t?t:0,childConceptIds:e});return!0===(null==n?void 0:n.status)&&Array.isArray(n.data)?n.data:[]}catch(e){throw new Error(`Error removing bulk parent access inheritance: ${e}`)}})}hasParentAccessInheritance(e,t){return Ho(this,void 0,void 0,function*(){try{const n=yield this.apiClient.hasParentAccessInheritanceByConceptAsync(e,t);return qo.parseBoolData(n)}catch(t){throw new Error(`Error checking parent access inheritance for conceptId ${e}: ${t}`)}})}getParentAccessId(e){return Ho(this,void 0,void 0,function*(){try{const t=yield this.apiClient.getParentAccessIdByConceptAsync(e);return qo.parseIntData(t)}catch(t){throw new Error(`Error getting parent access ID for conceptId ${e}: ${t}`)}})}isSuperAdmin(e){return Ho(this,void 0,void 0,function*(){try{if(0===e)return!1;const t=yield this.apiClient.checkSuperAdminByConceptAsync(e);return qo.parseBoolData(t)}catch(t){throw new Error(`Error checking super admin status for entityId ${e}: ${t}`)}})}assignSuperAdmin(e){return Ho(this,void 0,void 0,function*(){try{const t=yield this.apiClient.assignSuperAdminByConceptAsync({conceptId:e});return!0===(null==t?void 0:t.status)&&void 0!==t.data?e:0}catch(t){throw new Error(`Failed to assign super admin for entityId ${e}: ${t}`)}})}revokeSuperAdmin(e){return Ho(this,void 0,void 0,function*(){try{const t=yield this.apiClient.revokeSuperAdminByConceptAsync({conceptId:e});return!0===(null==t?void 0:t.status)&&t.message?t.message:"Super admin access deletion failed"}catch(t){throw new Error(`Failed to revoke super admin for entityId ${e}: ${t}`)}})}makeConceptPrivate(e){return Ho(this,void 0,void 0,function*(){var t,n,o,i,r,s,c,l;try{if(!e)throw new Error("conceptId is required");const d=yield(0,z.A)(e);if(!d||0===d.id)throw new Error(`Concept with ID ${e} not found`);const u="function"==typeof globalThis.getUserDetails?globalThis.getUserDetails():null;let h=Number(null!==(i=null!==(o=null!==(n=null!==(t=null==u?void 0:u.entity)&&void 0!==t?t:null==u?void 0:u.entityId)&&void 0!==n?n:null==u?void 0:u.userConcept)&&void 0!==o?o:null==u?void 0:u.userId)&&void 0!==i?i:0)||0;if(!h)throw new Error("Logged-in entity id not found");if(d.userId!==h)throw new Error("Only the owner may make the concept private");const p=["read","write","execute","delete"];let f=null!==(r=d.accessId)&&void 0!==r?r:0;const v={conceptIds:[e],permissions:p,entityId:h},y=yield this.apiClient.assignConceptAccessBulkAsync(v);if(!y||!0!==y.status)throw new Error(`Failed to assign permissions for entity ${h} via bulk API`);if(Array.isArray(y.data))for(const e of y.data){const t=null!==(c=null!==(s=e.accessId)&&void 0!==s?s:e.data)&&void 0!==c?c:0;"number"==typeof t&&t>f&&(f=t)}else"number"==typeof y.data&&y.data>f&&(f=y.data);return f&&f!==(null!==(l=d.accessId)&&void 0!==l?l:0)&&(d.accessId=f,a.I.AddConcept(d)),!0}catch(t){throw new Error(`Error making concept ${e} private: ${t}`)}})}static parseBoolData(e){if(!(null==e?void 0:e.status)||void 0===e.data||null===e.data)return!1;const t=e.data;if("boolean"==typeof t)return t;if("string"==typeof t)return"true"===t.toLowerCase();if("number"==typeof t)return 0!==t;if("object"==typeof t)for(const e of["enabled","Enabled","isEnabled","IsEnabled","status","Status","hasAccess","HasAccess"])if(e in t){const n=t[e];if("boolean"==typeof n)return n;if("string"==typeof n)return"true"===n.toLowerCase()}return!1}static parseIntData(e){if(!(null==e?void 0:e.status)||void 0===e.data||null===e.data)return null;const t=e.data;if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,10);return isNaN(e)?null:e}if("object"==typeof t)for(const e of["id","Id","accessId","AccessId","parentAccessId","ParentAccessId"])if(e in t){const n=t[e];if("number"==typeof n)return n;if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return e}}return null}static isSuperAdmin(e){return Ho(this,void 0,void 0,function*(){return Jo().isSuperAdmin(e)})}static assignSuperAdmin(e){return Ho(this,void 0,void 0,function*(){return Jo().assignSuperAdmin(e)})}static revokeSuperAdmin(e){return Ho(this,void 0,void 0,function*(){return Jo().revokeSuperAdmin(e)})}static checkAccess(e,t,n){return Ho(this,void 0,void 0,function*(){return Jo().checkAccess(e,t,n)})}static checkAccessBulk(e,t,n){return Ho(this,void 0,void 0,function*(){return Jo().checkAccessBulk(e,t,n)})}static assignAccess(e){return Ho(this,void 0,void 0,function*(){return Jo().assignAccess(e)})}static revokeAccess(e,t,n){return Ho(this,void 0,void 0,function*(){return Jo().revokeAccess(e,t,n)})}static revokeAccessBulk(e){return Ho(this,void 0,void 0,function*(){return Jo().revokeAccessBulk(e)})}static setParentAccessInheritance(e,t){return Ho(this,void 0,void 0,function*(){return Jo().setParentAccessInheritance(e,t)})}static setParentAccessInheritanceBulk(e,t){return Ho(this,void 0,void 0,function*(){return Jo().setParentAccessInheritanceBulk(e,t)})}static removeParentAccessInheritance(e,t){return Ho(this,void 0,void 0,function*(){return Jo().removeParentAccessInheritance(e,t)})}static removeParentAccessInheritanceBulk(e,t){return Ho(this,void 0,void 0,function*(){return Jo().removeParentAccessInheritanceBulk(e,t)})}static hasParentAccessInheritance(e,t){return Ho(this,void 0,void 0,function*(){return Jo().hasParentAccessInheritance(e,t)})}static getParentAccessId(e){return Ho(this,void 0,void 0,function*(){return Jo().getParentAccessId(e)})}}let zo=null;function Jo(){return zo||(zo=new qo),zo}const Qo='\n/* CKEditor content styles */\n.ck-content {\n /* Container styles */\n max-width: 100%;\n margin: 0 auto;\n font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;\n line-height: 1.5;\n padding: 0.75rem;\n background: #fff;\n color: #333;\n border: 1px solid #ccced1;\n}\n\n/* Headings */\n.ck-content h1, .ck-content h2, .ck-content h3, \n.ck-content h4, .ck-content h5, .ck-content h6 {\n font-weight: 700;\n line-height: 1.2;\n margin: 1em 0 0.5em;\n}\n\n.ck-content h1 { font-size: 2.5em; }\n.ck-content h2 { font-size: 2em; }\n.ck-content h3 { font-size: 1.75em; }\n.ck-content h4 { font-size: 1.5em; }\n.ck-content h5 { font-size: 1.25em; }\n.ck-content h6 { font-size: 1em; }\n\n/* Paragraphs and spacing */\n.ck-content p {\n margin: 1em 0;\n line-height: 1.6;\n}\n\n/* Links */\n.ck-content a {\n color: #1a73e8;\n text-decoration: none;\n}\n\n.ck-content a:hover {\n text-decoration: underline;\n}\n\n/* Lists */\n.ck-content ul,\n.ck-content ol {\n padding-left: 2em;\n margin: 1em 0;\n}\n\n.ck-content ul {\n list-style: disc;\n}\n\n.ck-content ol {\n list-style: decimal;\n}\n\n.ck-content li {\n margin: 0.5em 0;\n}\n\n/* Blockquotes */\n.ck-content blockquote {\n margin: 1em 0;\n padding-left: 1em;\n border-left: 5px solid #ccc;\n font-style: italic;\n color: #666;\n}\n\n/* Code blocks */\n.ck-content pre {\n background: #f5f5f5;\n border: 1px solid #ddd;\n border-radius: 4px;\n padding: 1em;\n margin: 1em 0;\n overflow-x: auto;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n}\n\n.ck-content code {\n background: #f5f5f5;\n padding: 0.2em 0.4em;\n border-radius: 3px;\n font-size: 0.9em;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n}\n\n/* Tables */\n.ck-content table {\n border-collapse: collapse;\n width: 100%;\n margin: 1em 0;\n}\n\n.ck-content table th,\n.ck-content table td {\n border: 1px solid #ddd;\n padding: 0.75em;\n text-align: left;\n}\n\n.ck-content table th {\n background: #f5f5f5;\n font-weight: bold;\n}\n\n/* Images */\n.ck-content img {\n max-width: 100%;\n height: auto;\n margin: 1em 0;\n}\n\n.ck-content figure {\n margin: 1em 0;\n text-align: center;\n}\n\n.ck-content figure img {\n margin: 0;\n}\n\n.ck-content figcaption {\n color: #666;\n font-size: 0.9em;\n margin-top: 0.5em;\n}\n\n/* Dark mode */\n/*\n@media (prefers-color-scheme: dark) {\n .ck-content {\n background: #1a1a1a;\n color: #e0e0e0;\n }\n\n .ck-content a {\n color: #64b5f6;\n }\n\n .ck-content blockquote {\n border-left-color: #404040;\n color: #b0b0b0;\n }\n\n .ck-content pre,\n .ck-content code {\n background: #2d2d2d;\n border-color: #404040;\n }\n\n .ck-content table th,\n .ck-content table td {\n border-color: #404040;\n }\n\n .ck-content table th {\n background: #2d2d2d;\n }\n\n .ck-content figcaption {\n color: #b0b0b0;\n }\n}\n*/\n\n/* CUSTOM DOCUMENTATION CSS */\n\n#documentation-preview {\n border: 1px solid #ccc;\n padding: 1rem;\n}\n\n#documentation-preview h3 {\n font-size: 1.5rem;\n margin-bottom: 1rem;\n}\n\n.pre-wrapper {\n background: #f2f5f9;\n border: 1px solid #cecece;\n display: block;\n padding: 1rem;\n border-radius: 0.25rem;\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pre-wrapper pre {\n margin: 0;\n color: #e87aa2;\n}\n\n.widget-doc-section pre {\n background-color: transparent;\n}\n\n.widget-doc-section p {\n margin: 0;\n}\n\n.widget-doc-section code {\n color: #e87aa2;\n font-size: 0.875rem;\n}\n\n.mv-3 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pv-3 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n\n .widget-documentation-heading {\n background-color: #6e757d;\n color: #eee;\n font-size: 1.5rem;\n padding: 0.5rem 1rem;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .widget-documentation-heading h4 {\n margin-bottom: 0;\n }\n\n .close-documentation-button {\n border: none;\n outline: none;\n background-color: transparent;\n line-height: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n .close-documentation-button:hover,\n .close-documentation-button:focus {\n background-color: transparent;\n }\n\n .documentation-creator {\n text-align: right;\n color: #666;\n margin: 0;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n }\n\n .documentation-creator span {\n font-style: italic;\n }\n\n .documentation-attachments {\n display: flex;\n flex-wrap: wrap;\n }\n\n .documentation-attachments img {\n width: 25%;\n height: auto;\n border: 1px solid #ccc;\n padding: 0.25rem;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .documentation-attachments iframe {\n width: 50%;\n border: 1px solid #ccc;\n padding: 0.25rem;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .widget-documentation-footer {\n text-align: right;\n margin-top: 1rem;\n }\n\n .widget-documentation-footer button {\n border-radius: 0;\n border: none;\n padding: 0.5rem 1.5rem;\n text-align: center;\n background: #6e757d;\n color: #eee;\n }\n\n #widget-details {\n position: absolute;\n right: 0px;\n top: 0px;\n z-index: 9999;\n }\n\n #widget-details button {\n background: #fff;\n border: 1px solid #ccc;\n border-radius: 0 0 0 0.25rem;\n height: auto;\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n }\n\n #widget-details button:hover, \n #widget-details button:focus {\n opacity: 0.75;\n }\n\n #widget-details button span {\n pointer-events: none;\n font-size: 1rem;\n }\n\n #widget-details button svg {\n pointer-events: none;\n width: 16px;\n height: 16px;\n fill: #999;\n }\n\n #widget-documentation-preview-modal {\n border: none;\n }\n\n @media (min-width: 768px) {\n #widget-documentation-preview-modal {\n flex: 0 0 auto;\n width: 66.66666667%;\n }\n }\n\n',Yo={PAGE_COMP_NAME:"page",WIDGET_COMP_NAME:"widget",PROJECT_COMP_NAME:"project"};var Xo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Zo{static get(e,t){return Xo(this,void 0,void 0,function*(){if(Zo.cache.has(e))return Zo.cache.get(e);if(Zo.promises.has(e))return Zo.promises.get(e);const n=t().then(t=>(Zo.cache.set(e,t),Zo.promises.delete(e),t)).catch(t=>{throw Zo.promises.delete(e),t});return Zo.promises.set(e,n),n})}static has(e){return Zo.cache.has(e)}static peek(e){return Zo.cache.get(e)}static invalidate(e){Zo.cache.delete(e),Zo.promises.delete(e)}static clear(){Zo.cache.clear(),Zo.promises.clear()}static set(e,t){return Xo(this,void 0,void 0,function*(){return Zo.promises.delete(e),Zo.cache.set(e,t),t})}static stats(){return{cacheSize:Zo.cache.size,pendingRequests:Zo.promises.size,keys:Array.from(Zo.cache.keys())}}}Zo.cache=new Map,Zo.promises=new Map;var Ko=n(2895);const ei=Ko;Ko.stringify,Ko.fromJSON,Ko.plugin,Ko.parse,Ko.list,Ko.document,Ko.comment,Ko.atRule,Ko.rule,Ko.decl,Ko.root,Ko.CssSyntaxError,Ko.Declaration,Ko.Container,Ko.Processor,Ko.Document,Ko.Comment,Ko.Warning,Ko.AtRule,Ko.Result,Ko.Input,Ko.Rule,Ko.Root,Ko.Node;var ti=n(2110),ni=n.n(ti),oi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ii(e){return oi(this,void 0,void 0,function*(){try{return(yield ei([ni()()]).process(e,{from:void 0})).css}catch(e){return console.error("Error processing CSS:",e),null}})}var ri=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function si(e){const t=document.getElementById("fspage-properties");if(!t)return;let n=null==t?void 0:t.textContent;n=n?n.replace(new RegExp(e,"g"),""):"",t.textContent=n}function ci(e,t){let n=document.querySelector(`meta[name="${e}"]`);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t)}var ai=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function li(e){return ai(this,void 0,void 0,function*(){var t,n,o,i;(null===(n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.css)||void 0===n?void 0:n.length)&&function(e){var t;const n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.css,o=`vde-css-${(null==e?void 0:e.origin)?null==e?void 0:e.origin:null==e?void 0:e.widgetId}`;(function(e){const t=`link.${e}`,n=document.querySelectorAll(t);(null==n?void 0:n.length)&&(null==n||n.forEach(e=>{e.remove()}))})(o),(null==n?void 0:n.length)&&(null==n||n.sort((e,t)=>Number(null==e?void 0:e.order)-Number(null==t?void 0:t.order))),null==n||n.forEach(e=>{const t=document.createElement("link");t.classList.add(o),t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.url),document.head.appendChild(t)})}(e),(null===(i=null===(o=null==e?void 0:e.library)||void 0===o?void 0:o.js)||void 0===i?void 0:i.length)&&(yield function(e){return ai(this,void 0,void 0,function*(){var t;const n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.js,o=`vde-js-${(null==e?void 0:e.origin)?null==e?void 0:e.origin:null==e?void 0:e.widgetId}`;if(function(e){const t=`script.${e}`,n=document.querySelectorAll(t);(null==n?void 0:n.length)&&(null==n||n.forEach(e=>{e.remove()}))}(o),null==n?void 0:n.length){n.sort((e,t)=>Number(null==e?void 0:e.order)-Number(null==t?void 0:t.order));for(const e of n)(null==e?void 0:e.url)?document.querySelector(`script[src="${e.url}"]`)?console.log("Library already loaded:",e.url):yield new Promise((t,n)=>{const i=document.createElement("script");i.classList.add(o),i.setAttribute("type","text/javascript"),i.setAttribute("src",e.url),i.setAttribute("crossorigin","anonymous"),i.onload=()=>{t()},i.onerror=t=>{console.error("Failed to load script:",e.url,t),n(new Error(`Failed to load script: ${e.url}`))},document.head.appendChild(i)}):console.warn("Skipping library with invalid URL:",e);console.log("All JavaScript libraries loaded successfully")}})}(e))})}var di=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ui(e,t,n,o){return di(this,void 0,void 0,function*(){var i;const r=yield Ht(e,"the_page_body"),s=new bo;s.conceptIds=[e],s.inpage=100,s.outputFormat=An.y0,s.selectors=["the_page_body","the_page_title","the_page_slug","the_page_font_family","the_page_font_size","the_page_width","the_page_type","the_page_meta_title","the_page_meta_description","the_page_meta_keywords"],Bo(s,"").subscribe(e=>di(this,void 0,void 0,function*(){var t,n;yield function(e){return ri(this,void 0,void 0,function*(){var t,n,o,i,r,s,c,a,l,d,u,h,p,f;[{key:"meta_title",value:null===(n=null===(t=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_meta_title`])||void 0===t?void 0:t.data)||void 0===n?void 0:n.the_meta_title},{key:"meta_description",value:null===(i=null===(o=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_meta_description`])||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_meta_description},{key:"meta_keywords",value:null===(s=null===(r=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_meta_keywords`])||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_meta_keywords},{key:"width",value:null===(a=null===(c=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_width`])||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_width},{key:"font_size",value:null===(d=null===(l=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_font_size`])||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_font_size},{key:"font_family",value:null===(h=null===(u=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_font_family`])||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_font_family},{key:"type",value:null===(f=null===(p=null==e?void 0:e[`the_${Yo.PAGE_COMP_NAME}_type`])||void 0===p?void 0:p.data)||void 0===f?void 0:f.the_type}].forEach(e=>{e.value&&function(e,t){ri(this,void 0,void 0,function*(){const n=document.getElementById("fspage-properties")||function(){const e=document.createElement("style");return e.id="fspage-properties",document.head.appendChild(e),e}();let o="";switch(e){case"width":si(".fspage { width: [^;]+ !important; }"),o=t?`.fspage { width: ${t} !important; }`:"";break;case"font_size":si(".fspage { font-size: [^;]+; }"),o=t?`.fspage { font-size: ${t}px; }`:"";break;case"font_family":si(".fspage { font-family: [^;]+; }"),o=t?`.fspage { font-family: ${t}; }`:"";break;case"type":si(".fspage { width: 1200px; margin: 0 auto; }"),si(".fspage { width: 100%; padding: 0; }"),o="fixed"===t?".fspage { width: 1200px; margin: 0 auto; }":"fluid"===t?".fspage { width: 100%; padding: 0; }":"";break;case"meta_title":document.title=t;break;case"meta_keywords":ci(e.replace("meta_",""),t);break;case"meta_description":return void ci(e.replace("meta_",""),t)}n.textContent+=o})}(e.key,e.value)})})}(null===(n=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.data)||void 0===n?void 0:n[`the_${Yo.PAGE_COMP_NAME}`])})),document.getElementById("app").classList.add("fspage");const c=document.head.querySelectorAll("style#mystyleid");Array.from(c).forEach(e=>e.remove()),(null===(i=null==r?void 0:r[0])||void 0===i?void 0:i.id)?yield vi(r[0].id,t,n,o):t.innerHTML="<h4>Invalid or Page doesn't exist</h4>"})}function hi(e,t,n,o){return di(this,void 0,void 0,function*(){try{let t=yield(0,Po.qj)(e),n=t.mainId,o=t.data;const i=yield Ci(o,n),r=yield Ii(n,[],i);return Zo.cache.set(`wdgt_${n}`,r),console.log("DataCache after, widgetTree --\x3e",Zo.cache,r),r}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function pi(e,t,n,o){return di(this,void 0,void 0,function*(){try{let t=yield(0,Po.ml)(e),n=t.mainId,o=t.data;const i=yield Ci(o,n);return yield Ii(n,[],i)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function fi(e,t,n,o){return di(this,void 0,void 0,function*(){let i=(yield(0,Po.qj)(e)).mainId;console.log("renderImportedWidget latestWidgetId, DataCache.cache --\x3e",i,Zo.cache);const r=Zo.cache.get(`wdgt_${i}`);if(console.log("renderImportedWidget widgetTree --\x3e",r),!r.name)return void(t.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=t;yield li(r);const c=yield Ti(r,s,void 0,n),a=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");t.classList.add(`${a}`),t.style.position="relative";const l=document.createElement("style");l.id="mystyleid",l.classList.add("mftsccs-css");const d=`\n .${a} {\n ${r.css+c.css+Qo} \n }\n `,u=(yield ii(d))||"";if(l.innerHTML=u,document.head.appendChild(l),r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&li(e)})),o){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;_i(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{Li("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),c})}function vi(e,t,n,o){return di(this,void 0,void 0,function*(){try{let i=yield(0,Po.qj)(e),r=i.mainId,s=i.data;const c=yield Ci(s,r);return yield gi(r,c,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`),t.textContent=`Error: ${e.message}`}})}function yi(e,t,n,o){return di(this,void 0,void 0,function*(){try{const i=yield(0,Po.Cp)(e);return yield gi(e,i,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function gi(e,t,n,o){return di(this,arguments,void 0,function*(e,t,n,o,i=!0){const r=yield Ii(e,[],t);if(!r.name)return void(n.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=n;yield li(r);const c=yield Ti(r,s,void 0,o),a=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");n.classList.add(`${a}`),n.style.position="relative";const l=document.createElement("style");l.id="mystyleid",l.classList.add("mftsccs-css");const d=`\n .${a} {\n ${r.css+c.css+Qo} \n }\n `,u=(yield ii(d))||"";l.innerHTML=u,r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&li(e)})),document.head.appendChild(l);const h=document.createElement("script");if(h.innerHTML=r.js,s.appendChild(h),i){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n \x3c!-- <div id="documentation-preview" class="ck-content"></div> --\x3e\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;_i(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{Li("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),c})}function mi(e,t){return di(this,void 0,void 0,function*(){var n,o,i,r,s,c,a,l,d,u,h;const p=null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.the_widget)||void 0===o?void 0:o.the_widget_s_child;if(t.push(e),p&&p.length)for(let e=0;e<p.length;e++){const n=p[e];let o=null===(a=null===(c=null===(s=null===(r=null===(i=null==n?void 0:n.data.the_child_widget)||void 0===i?void 0:i.the_child_widget_info)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_widget)||void 0===c?void 0:c.the_widget_root)||void 0===a?void 0:a.id;const f=!!(null===(u=null===(d=null===(l=null==n?void 0:n.data)||void 0===l?void 0:l.the_child_widget)||void 0===d?void 0:d.the_child_widget_use_latest)||void 0===u?void 0:u.data);o=Number(o)||!1;let v=null;if(f&&o){const e=yield(0,Po.qj)(o);v=(null===(h=null==e?void 0:e.data)||void 0===h?void 0:h[0])||[],v.useLatest=!0,n.data.the_child_widget.the_child_widget_info=v}n.data.the_child_widget.the_child_widget_info.sChildId=n.id,yield mi(n.data.the_child_widget.the_child_widget_info,t)}})}function Ci(e,t){return di(this,void 0,void 0,function*(){const n=[],o=[...e];try{const e=o.find(e=>e.id===t);yield mi(e,n)}catch(e){console.error("convert to real bulk error",e)}return n})}function wi(e){return di(this,arguments,void 0,function*(e,t=[],n=""){let o=yield(0,Po.Cp)(e);const i=yield Ci(o,e);return yield Ii(e,[],i)})}function Ii(e){return di(this,arguments,void 0,function*(e,t=[],n,o=""){var i,r,s,c,a,l,d,u,h,p,f,v,y,g,m,C,w,I,T,k,A,S,N,b,_,L,E,x,B,O,R,D,G,P,F,U,M,W,j,V,$,H,q,z,J,Q,Y,X,Z,K,ee,te,ne,oe,ie,re,se;try{const ce=new Ro,ae=(0,Po.ix)(n,e);t.push(e);const le=null===(i=null==ae?void 0:ae.data)||void 0===i?void 0:i.the_widget;ce.name=null===(s=null===(r=null==le?void 0:le.the_widget_name)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_name,ce.html=null===(a=null===(c=null==le?void 0:le.the_widget_html)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_html,ce.css=null===(d=null===(l=null==le?void 0:le.the_widget_css)||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_css,ce.js=null===(h=null===(u=null==le?void 0:le.the_widget_js)||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_js,ce.root=Number(null!==(f=null===(p=null==le?void 0:le.the_widget_root)||void 0===p?void 0:p.id)&&void 0!==f?f:0),ce.origin=ce.root,ce.version=null===(y=null===(v=null==le?void 0:le.the_widget_version)||void 0===v?void 0:v.data)||void 0===y?void 0:y.the_version,ce.clean=null===(m=null===(g=null==le?void 0:le.the_widget_clean)||void 0===g?void 0:g.data)||void 0===m?void 0:m.the_clean,ce.timestamp=null===(w=null===(C=null==le?void 0:le.the_widget_timestamp)||void 0===C?void 0:C.data)||void 0===w?void 0:w.the_timestamp,ce.id=null==ae?void 0:ae.id;const de=null===(T=null===(I=null==le?void 0:le.the_widget_type)||void 0===I?void 0:I.data)||void 0===T?void 0:T.the_type;ce.type="null"==de||null==de?"the_element_name":de,ce.after_render=null===(A=null===(k=null==le?void 0:le.the_widget_after_render)||void 0===k?void 0:k.data)||void 0===A?void 0:A.the_after_render,ce.before_render=null===(N=null===(S=null==le?void 0:le.the_widget_before_render)||void 0===S?void 0:S.data)||void 0===N?void 0:N.the_before_render,ce.dependency=null===(_=null===(b=null==le?void 0:le.the_widget_dependency)||void 0===b?void 0:b.data)||void 0===_?void 0:_.the_dependency,ce.update=null===(E=null===(L=null==le?void 0:le.the_widget_update)||void 0===L?void 0:L.data)||void 0===E?void 0:E.the_update,ce.widgetId=e,ce.mount_child=null===(B=null===(x=null==le?void 0:le.the_widget_mount_child)||void 0===x?void 0:x.data)||void 0===B?void 0:B.the_mount_child;const ue=null==le?void 0:le.the_widget_s_child;(null==ae?void 0:ae.useLatest)&&(ce.useLatest=!0),(null==ae?void 0:ae.sChildId)&&(ce.sChildId=ae.sChildId);const he=null===(O=null==le?void 0:le.the_widget_s_css_library)||void 0===O?void 0:O.map(e=>{var t,n,o,i,r,s,c,a;return{order:null===(i=null===(o=null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_css_library)||void 0===n?void 0:n.the_css_library_order)||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_order,url:null===(a=null===(c=null===(s=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_css_library)||void 0===s?void 0:s.the_css_library_url)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_url}}),pe=null===(R=null==le?void 0:le.the_widget_s_js_library)||void 0===R?void 0:R.map(e=>{var t,n,o,i,r,s,c,a;return{order:null===(i=null===(o=null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_js_library)||void 0===n?void 0:n.the_js_library_order)||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_order,url:null===(a=null===(c=null===(s=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_js_library)||void 0===s?void 0:s.the_js_library_url)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_url}});ce.library={css:he||[],js:pe||[]};const fe=null===(G=null===(D=null==le?void 0:le.the_widget_assistant)||void 0===D?void 0:D.data)||void 0===G?void 0:G.the_assistant;ce.assistant={id:null===(F=null===(P=null==fe?void 0:fe.the_assistant_id)||void 0===P?void 0:P.data)||void 0===F?void 0:F.the_id,input:null===(M=null===(U=null==fe?void 0:fe.the_assistant_input)||void 0===U?void 0:U.data)||void 0===M?void 0:M.the_input,type:null===(j=null===(W=null==fe?void 0:fe.the_assistant_type)||void 0===W?void 0:W.data)||void 0===j?void 0:j.the_type};const ve=null===(V=null==le?void 0:le.the_widget_s_custom_function)||void 0===V?void 0:V.map(e=>{var t,n,o,i,r,s,c;const a=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_custom_function;return{id:null==e?void 0:e.id,name:null===(o=null===(n=null==a?void 0:a.the_custom_function_name)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_name,slug:null===(r=null===(i=null==a?void 0:a.the_custom_function_slug)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_slug,code:null===(c=null===(s=null==a?void 0:a.the_custom_function_code)||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_code}});if(ce.custom_functions=ve,null==ue?void 0:ue.length)for(let e=0;e<ue.length;e++){const i=(null===(q=null===(H=null===($=ue[e])||void 0===$?void 0:$.data.the_child_widget)||void 0===H?void 0:H.the_child_widget_info)||void 0===q?void 0:q.id)||(null===(Y=null===(Q=null===(J=null===(z=ue[e])||void 0===z?void 0:z.data.the_child_widget)||void 0===J?void 0:J.the_child_widget_parent)||void 0===Q?void 0:Q.data)||void 0===Y?void 0:Y.the_parent),r=yield Ii(i,t,n,o),s=null===(te=null===(ee=null===(K=null===(Z=null===(X=ue[e])||void 0===X?void 0:X.data)||void 0===Z?void 0:Z.the_child_widget)||void 0===K?void 0:K.the_child_widget_type)||void 0===ee?void 0:ee.data)||void 0===te?void 0:te.the_type,c=null===(se=null===(re=null===(ie=null===(oe=null===(ne=ue[e])||void 0===ne?void 0:ne.data)||void 0===oe?void 0:oe.the_child_widget)||void 0===ie?void 0:ie.the_child_widget_wrapper)||void 0===re?void 0:re.data)||void 0===se?void 0:se.the_wrapper;r.type="null"==s||null==s?"the_element_name":s,r.wrapper=c,ce.children.push(r)}return ce}catch(e){throw e instanceof Error&&console.error("error converting bulkwidget to widget tree",e.message),e}})}function Ti(e,t){return di(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,c;const a=new yo;a.html=e.html,r&&(a.parentWidget=ki(r)),a.widgetType=e.type,a.componentDidMountFunction=e.before_render,a.addEventFunction=e.after_render,a.mountChildWidgetsFunction=e.mount_child,a.widgetState=Object.assign({},i),a.customFunctions=e.custom_functions,a.widgetDependenciesData=e.dependency,o&&(a.data=o),t.innerHTML="";const l=t;if(l&&(yield a.mount(l),e.widget=a,e.children.length>0&&(null===(s=a.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){const n=e.children[t];for(let e=0;e<a.childWidgetElement.length;e++){const t=a.childWidgetElement[e];if(n.wrapper===t.id){const e=Si(n);n.html=`<div id="${n.wrapper}">${n.html}</div>`;const o=yield Ti(e,t,!1,a.data,a.widgetState,a);a.childWidgets.push(o),a.css=a.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange(e=>{var t;const n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(a.childrenData[n]=e)})}}}return console.log("newWidget ->",a,e),yield bi(t,".widget_container"),a})}function ki(e){const t={};for(const[n,o]of Object.entries(e))"object"==typeof o&&null!==o&&Array.isArray(o)||(t[n]=o);return t}function Ai(e,t){return di(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,c;let a=new yo;a.html=e.html,r&&(a.parentWidget=ki(r)),a.widgetState=Object.assign({},o),a.widgetType=e.type,a.componentDidMountFunction=e.before_render,a.addEventFunction=e.after_render,a.mountChildWidgetsFunction=e.mount_child,a.customFunctions=e.custom_functions,a.widgetDependenciesData=e.dependency,a.inDevelopment=!1!==i,t.innerHTML="";let l=t;if(l&&(yield a.mount(l),e.widget=a,e.children.length>0&&(null===(s=a.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){let n=e.children[t];for(let e=0;e<a.childWidgetElement.length;e++){let t=a.childWidgetElement[e];if(n.wrapper===t.id){const e=Si(n),o=yield Ai(e,t,!1,a.widgetState,i,a);a.childWidgets.push(o),a.css=a.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange(e=>{var t;console.log("This is the data change in child",e);let n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(a.childrenData[n]=e),console.log("new child data",a.childrenData)})}}}return console.log("newWidget ->",a,e),a})}function Si(e){return e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bwidget_container\b[^"']*["'][^>]*>/g,e=>e.replace(/\bwidget_container\b/g,"").trim()),e.html=e.html.replace(/<[^>]*\bdraggable=["'][^"']*\btrue\b[^"']*["'][^>]*>/g,e=>e.replace(/\btrue\b/g,"false").trim()),e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bhover-element\b[^"']*["'][^>]*>/g,e=>e.replace(/\bhover-element\b/g,"").trim()),e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bwb-block\b[^"']*["'][^>]*>/g,e=>e.replace(/\bwb-block\b/g,"").trim()),e.html=e.html.replace(/<[^>]*onclick="widgetSelected\(event\)"\s*,?\s*ondragover="_dragService\.dragOverWidgetElement\(event\)"\s*,?\s*ondrop="_dragService\.dropWidgetElement\(event\)"\s*,?\s*ondragstart="_dragService\.dragStartWidgetElement\(event\)"\s*,?\s*ondragend="_dragService\.dragEndWidgetElement\(event\)"[^>]*>/g,e=>e.replace(/onclick="widgetSelected\(event\)"/g,'onclick=""').replace(/ondragover="_dragService\.dragOverWidgetElement\(event\)"/g,'ondragover=""').replace(/ondrop="_dragService\.dropWidgetElement\(event\)"/g,'ondrop=""').replace(/ondragstart="_dragService\.dragStartWidgetElement\(event\)"/g,'ondragstart=""').replace(/ondragend="_dragService\.dragEndWidgetElement\(event\)"/g,'ondragend=""').trim()),e.html=e.html.replace(/<[^>]*\bondragstart=["'][^"']*\b_dragService\.onWidgetDragStart\(event\)\b[^"']*["'][^>]*>/g,e=>e.replace(/\b_dragService\.onWidgetDragStart\(event\)\b/g,"").trim()),e}function Ni(e,t){return di(this,void 0,void 0,function*(){return e&&1===e.nodeType&&e.querySelectorAll(t).forEach(e=>{for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.remove()}),e})}function bi(e,t){return di(this,void 0,void 0,function*(){const n=e.querySelectorAll(t);for(const e of n){const n=e.parentElement;if(n){for(;e.firstChild;){const o=yield Ni(e.firstChild,t);n.insertBefore(o,e)}n.removeChild(e)}}})}function _i(e){return di(this,void 0,void 0,function*(){const t=new bo;t.typeConnection="the_widget_documentation",t.name="documentationText",t.selectors=["the_documentation_text"];const n=new bo;n.typeConnection="the_widget_s_documentation",n.name="documentationBlank",n.selectors=["the_documentation_text","the_documentation_content","the_documentation_language","the_documentation_doc_title","the_documentation_folder","the_documentation_creator_email","the_documentation_created_by","the_documentation_content","the_documentation_type","the_documentation_s_doc_url","the_documentation_s_image_url","the_documentation_s_video_link","the_documentation_auth_type","the_documentation_bearer_token","the_documentation_method","the_documentation_method_url","the_documentation_username","the_documentation_password","the_documentation_s_json_list","the_documentation_api_script","the_documentation_api_body","the_documentation_code_editor","the_documentation_return"];const o=new bo;o.typeConnection="the_documentation_s_json_list",o.name="documentationJSON",o.selectors=["the_json_list_key","the_json_list_value"],n.freeschemaQueries=[o];const i=new bo;i.conceptIds=[e],i.freeschemaQueries=[t,n],i.inpage=100,i.outputFormat=An.y0,yield Bo(i,"").subscribe(t=>di(this,void 0,void 0,function*(){var n,o,i,r,s,c,a,d,u,h,p;let f;const v=(null===(d=null===(a=null===(c=null===(s=null===(r=null===(i=null===(o=null===(n=null==t?void 0:t[0])||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_widget)||void 0===i?void 0:i.the_widget_documentation)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_documentation)||void 0===c?void 0:c.the_documentation_text)||void 0===a?void 0:a.data)||void 0===d?void 0:d.the_text)||"";v&&(f=v);const y=null===(p=null===(h=null===(u=null==t?void 0:t[0])||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_widget)||void 0===p?void 0:p.the_widget_s_documentation;if(null==y?void 0:y.length){const e=null==y?void 0:y.map(e=>{var t,n,o,i,r,s,c,a,l,d,u,h,p,f,v,y,g,m,C,w,I,T,k,A,S,N,b,_,L,E,x;const B=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_documentation,O=null===(o=null===(n=null==B?void 0:B.the_documentation_type)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_type,R=null===(r=null===(i=null==B?void 0:B.the_documentation_content)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_content,D=null===(c=null===(s=null==B?void 0:B.the_documentation_creator_email)||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_creator_email,G=null===(l=null===(a=null==B?void 0:B.the_documentation_doc_title)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_doc_title,P=null===(u=null===(d=null==B?void 0:B.the_documentation_method)||void 0===d?void 0:d.data)||void 0===u?void 0:u.the_method,F=null===(p=null===(h=null==B?void 0:B.the_documentation_method_url)||void 0===h?void 0:h.data)||void 0===p?void 0:p.the_method_url,U=null===(v=null===(f=null==B?void 0:B.the_documentation_bearer_token)||void 0===f?void 0:f.data)||void 0===v?void 0:v.the_bearer_token,M=null===(g=null===(y=null==B?void 0:B.the_documentation_username)||void 0===y?void 0:y.data)||void 0===g?void 0:g.the_username,W=null===(C=null===(m=null==B?void 0:B.the_documentation_password)||void 0===m?void 0:m.data)||void 0===C?void 0:C.the_password,j=null===(I=null===(w=null==B?void 0:B.the_documentation_auth_type)||void 0===w?void 0:w.data)||void 0===I?void 0:I.the_auth_type,V=null==B?void 0:B.the_documentation_s_json_list,$=null===(k=null===(T=null==B?void 0:B.the_documentation_api_script)||void 0===T?void 0:T.data)||void 0===k?void 0:k.the_api_script,H=null===(S=null===(A=null==B?void 0:B.the_documentation_api_body)||void 0===A?void 0:A.data)||void 0===S?void 0:S.the_api_body,q=null===(b=null===(N=null==B?void 0:B.the_documentation_language)||void 0===N?void 0:N.data)||void 0===b?void 0:b.the_language,z=null===(L=null===(_=null==B?void 0:B.the_documentation_return)||void 0===_?void 0:_.data)||void 0===L?void 0:L.the_return,J=null===(x=null===(E=null==B?void 0:B.the_documentation_code_editor)||void 0===E?void 0:E.data)||void 0===x?void 0:x.the_code_editor,Q=null==B?void 0:B.the_documentation_s_doc_url,Y=null==B?void 0:B.the_documentation_s_image_url,X=null==B?void 0:B.the_documentation_s_video_link;let Z={type:O,content:R,creatorEmail:D,title:G};if("blank"===O)Z=Object.assign({},Z);else if("api"===O){const e=[];(null==V?void 0:V.length)&&(null==V||V.forEach(t=>{var n,o,i,r,s,c,a,l;e.push({key:null===(r=null===(i=null===(o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.the_json_list)||void 0===o?void 0:o.the_json_list_key)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_key,value:null===(l=null===(a=null===(c=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.the_json_list)||void 0===c?void 0:c.the_json_list_value)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_value})})),Z=Object.assign(Object.assign({},Z),{method:P,methodURL:F,authType:j,username:M,password:W,bearerToken:U,json:e,script:$,body:H})}else"function"===O&&(Z=Object.assign(Object.assign({},Z),{language:q,return:z,codeEditor:J}));const K=[],ee=[],te=[];return(null==Y?void 0:Y.length)&&(null==Y||Y.forEach(e=>{var t;K.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_image_url)})),(null==X?void 0:X.length)&&(null==X||X.forEach(e=>{var t;ee.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_video_link)})),(null==Q?void 0:Q.length)&&(null==Q||Q.forEach(e=>{var t;te.push(null===(t=e.data)||void 0===t?void 0:t.the_doc_url)})),Z=Object.assign(Object.assign({},Z),{imageList:K,linkList:te,videoList:ee}),Z});f=e}yield function(){return di(this,void 0,void 0,function*(){document.getElementById("widget-documentation-preview-modal").showModal()})}(),function(e,t){di(this,void 0,void 0,function*(){const n=document.getElementById("documentation-view");if(0!=l.B.DOCUMENTATION_WIDGET)return void(yield vi(l.B.DOCUMENTATION_WIDGET,n,{currentWidgetId:t}));const o=document.getElementById("documentation-preview");o.innerHTML="",e&&(null==e?void 0:e.length)&&"string"!=typeof e?null==e||e.forEach(e=>{var t,n,i,r;const s=document.createElement("h3");let c="";switch(null==e?void 0:e.type){case"api":c="API";break;case"function":c="Functions and Classes";break;case"imgAndLink":c="Images and Links";break;default:c=""}s.innerHTML=`\n ${null==e?void 0:e.title} ${c?"("+c+")":""}\n `,null==o||o.appendChild(s);const a=document.createElement("div");a.classList.add("widget-doc-content"),(null==e?void 0:e.content)&&(a.innerHTML=e.content,null==o||o.appendChild(a));const l=document.createElement("div");if(l.classList.add("widget-doc-section"),"api"===e.type){let n="";n="basicAuth"===e.authType?`\n <p>username: <code>${null==e?void 0:e.username}</code></p>\n <p>password: <code>${null==e?void 0:e.password}</code></p>\n `:"bearerToken"===e.authType?`\n <h6>Token: <code>${null==e?void 0:e.bearerToken}</code></h6>\n `:"None";const o=e.json.map(e=>`${null==e?void 0:e.key}: ${null==e?void 0:e.value}`).join(", "),i=document.createElement("pre");i.textContent=o,l.innerHTML=`\n <div class="pv-3">\n <h6>Method Type: <code>${null==e?void 0:e.method.toUpperCase()}</code></h6>\n <h6>Endpoint: <code>${null==e?void 0:e.methodURL}</code></h6>\n </div>\n <div class="pv-3">\n <h6>Auth Type: <code>${(null===(t=null==e?void 0:e.authType)||void 0===t?void 0:t.toUpperCase())||""}</code></h6>\n ${n}\n </div>\n <div class="pv-3">\n <h6>JSON</h6>\n <code class="pre-wrapper" id="json-list-pre"></code>\n </div>\n <div class="pv-3">\n <h6>Body</h6>\n ${e.body}\n </div>\n <div class="pv-3">\n <h6>Scripts</h6>\n ${e.script}\n </div>\n `;const r=l.querySelector("#json-list-pre");r&&(r.appendChild(i),r.removeAttribute("id"))}else if("function"===e.type){const t=document.createElement("pre");t.textContent=null==e?void 0:e.codeEditor;const n=document.createElement("pre");n.textContent=null==e?void 0:e.return,l.innerHTML=`\n <div class="mv-3">\n <h6>Parameter</h6>\n <p>Language: ${null==e?void 0:e.language}</p>\n <code class="pre-wrapper" id="editor-pre"></pre></code>\n <h6>Returns</h6>\n <code class="pre-wrapper" id="return-pre"></code>\n </div>\n `;const o=l.querySelector("#editor-pre");o&&(o.appendChild(t),o.removeAttribute("id"));const i=l.querySelector("#return-pre");i&&(i.appendChild(n),i.removeAttribute("id"))}const d=document.createElement("div");d.classList.add("mv-3");const u=null===(n=null==e?void 0:e.linkList)||void 0===n?void 0:n.map(e=>`\n <p>${e}</p>\n `).join(""),h=null===(i=null==e?void 0:e.imageList)||void 0===i?void 0:i.map(e=>`\n <img src="${e}">\n `).join(""),p=null===(r=null==e?void 0:e.videoList)||void 0===r?void 0:r.map(e=>`\n <iframe width="560" height="315" src="${e}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>\n `).join(""),f=(null==u?void 0:u.length)?`\n <div class="mv-3">\n <h6>Web links</h6>\n ${u}\n </div>\n `:"",v=(null==h?void 0:h.length)?`\n <h6>Attachments</h6>\n <div class="documentation-attachments">\n ${h}\n </div>\n `:"",y=(null==p?void 0:p.length)?`\n <h6>Videos</h6>\n <div class="documentation-attachments">\n ${p}\n </div>\n `:"";d.innerHTML=`\n <div class="mv-3">\n ${f}\n ${v}\n ${y}\n </div>\n <p class="documentation-creator">- added by: <span>${null==e?void 0:e.creatorEmail}</span></p>\n `,null==l||l.appendChild(d),null==o||o.appendChild(l)}):void 0!==e&&(o.innerHTML=e)})}(f,e)}))})}function Li(e){return di(this,void 0,void 0,function*(){const t=document.getElementById(e),n=null==t?void 0:t.querySelector("form");null==n||n.reset(),null==t||t.close()})}var Ei=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function xi(e){return Ei(this,arguments,void 0,function*(e,t=null,n="",o={concepts:[],connections:[]}){var i,r,s,c;if(Qi)try{const a=yield ir("CreateData",{json:e,ofConcept:t,typeConcept:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(c=null===(s=null==a?void 0:a.actions)||void 0===s?void 0:s.connections)||void 0===c?void 0:c.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.error("CreateTheComposition sw error: ",e),lr(e)}let a=999,l=999,d=(0,W.o)();for(const i in e){let r=Bi(i);if("string"!=typeof e[i]&&"number"!=typeof e[i])if(null==t||0==t.id)d=yield(0,K.k)(r,"",!0,a,4,l,void 0,o),Array.isArray(e[i])&&(r=Oi(r)),yield xi(e[i],d,r,o);else{Array.isArray(e[i])&&(r=Ri(r));let s=Ri(i),c=yield(0,K.k)(r,"",!0,a,4,l,void 0,o);d=c;let u=Gi(n,s),h=yield(0,le.$)(u,l,a,a,o);yield(0,Jt.F)(t.id,c.id,h.id,1e3,h.characterValue,a,o),Array.isArray(e[i])&&(r=Oi(r)),yield xi(e[i],c,r,o)}else{let r=Gi(n,i),s=yield(0,le.$)(r,l,a,a,o),c=yield(0,K.k)(i,e[i].toString(),!1,a,4,l,void 0,o);console.log("this is the type concept in down",s,c),null!=t&&(yield(0,Jt.F)(t.id,c.id,s.id,1e3,r,a,o))}}return d})}function Bi(e){return e.startsWith("the_")?e:"the_"+e}function Oi(e){return e.endsWith("_s")?e:e+"_s"}function Ri(e){return e.replace(/_s$/,"")}const Di=e=>/^[+-]?\d+(\.\d+)?$/.test(e);function Gi(e,t){return Di(t)?e+"_":e+"_"+function(e){return e.startsWith("the_")?e.slice(4):e}(t)}class Pi{constructor(){this.prototype="",this.required=[],this.optional=[],this.field="string",this.childPrototypes=[],this.isCompositional=!1,this.options=[],this.isQueryType=!1,this.querySelector=null,this.concepts=[],this.connections=[],this.addedConcepts=[],this.addedConnections=[]}}class Fi{static getValue(e){return e in this.environments?this.environments[e]:null}static setValue(e,t){return this.environments[e]=t,this}}function Ui(e,t){if(Array.isArray(e)&&Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);return e}Fi.environments={};var Mi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Wi(e){return Mi(this,arguments,void 0,function*(e,t=null){let n=[],o=[],i=[],r=(0,W.o)();try{null==t&&(t=new Co,yield t.initialize());let s=[];if(e.isCompositional){if(r=yield function(e,t,n,o){return Mi(this,void 0,void 0,function*(){let i=(0,W.o)(),r=yield o.MakeTheInstanceConceptLocal("the_composition","",!0,999,999,999),s=yield o.MakeTheTypeConceptLocal("the_composition_type",999,999,999),c=yield o.MakeTheTypeConceptLocal(e,999,999,999),a=yield o.CreateTheConnectionLocal(r.id,c.id,s.id,1e3,"the_composition_type");return i=r,t.push(s),t.push(c),n.push(a),i})}(e.prototype,n,o,t),e.isQueryType){let o=yield function(e,t,n){return Mi(this,void 0,void 0,function*(){let o=[],i=[],r="the_composition_filter_type",s="the_composition_selector",c=yield n.MakeTheTypeConceptLocal(r,999,999,999),a=yield n.MakeTheTypeConceptLocal(s,999,999,999);if(null!=e){let l=yield n.MakeTheTypeConceptLocal(e.selector,999,999,999);o.push(l);let d=yield n.MakeTheTypeConceptLocal(e.filterType,999,999,999);o.push(l),o.push(d);let u=yield n.CreateTheConnectionLocal(t.id,l.id,a.id,1e3,s,999);i.push(u);let h=yield n.CreateTheConnectionLocal(t.id,d.id,c.id,1e3,r,999);i.push(h)}return{concepts:o,connections:i}})}(e.querySelector,r,t),s=o.concepts;Ui(i,o.connections),Ui(n,s)}if(e.options.length>0){let o=yield function(e,t,n){return Mi(this,void 0,void 0,function*(){let o=[],i=[],r="the_composition_s_option",s=yield n.MakeTheTypeConceptLocal(r,999,999,999);for(let c=0;c<e.length;c++){let a=e[c].type,l=e[c].value,d=yield n.MakeTheInstanceConceptLocal(a,l,!1,999,999,999);o.push(d);let u=yield n.CreateTheConnectionLocal(t.id,d.id,s.id,1e3,r,999);i.push(u)}return{concepts:o,connections:i}})}(e.options,r,t),s=o.concepts;Ui(i,o.connections),Ui(n,s)}}else r=yield function(e,t){return Mi(this,void 0,void 0,function*(){let n=yield(0,z.A)(5124),o=yield t.MakeTheTypeConceptLocal(e,999,999,999),i=yield function(e,t,n,o){return Mi(this,void 0,void 0,function*(){let n=yield o.CreateTheConceptLocal("",t.characterValue,999,e.id,t.id,4,!1);return n.characterValue=t.characterValue,n.typeCharacter=t.characterValue,n.isComposition=!0,n.type=t,n})}(n,o,0,t);return i})}(e.prototype,t),i=yield Vi(e.required,r,n,t,!0),s=yield Vi(e.optional,r,n,t),n.push(r);let c=ji(r,!0,!0),a=yield t.MakeTheTypeConceptLocal(c,999,999,999);if(n.push(a),e.childPrototypes.length>0)for(let o=0;o<e.childPrototypes.length;o++){let s=yield Wi(e.childPrototypes[o]),l=s.mainConcept,d=s.connections,u=s.concepts,h=yield t.CreateTheConnectionLocal(r.id,l.id,a.id,1e3,c,999);i.push(h),Ui(i,d),Ui(n,u),n.push(l)}Ui(i,s),Ui(i,o),Ui(n,e.addedConcepts),Ui(i,e.addedConnections),e.concepts=n,e.connections=i,console.log("this is the connections",i)}catch(e){null==t||t.rollbackTransaction()}return{concepts:n,connections:i,mainConcept:r}})}function ji(e,t=!0,n=!1){var o;let i="the_prototype_of_"+(null===(o=e.type)||void 0===o?void 0:o.characterValue);return i+=t?"_requires":"_optional",n&&(i+="_the_composition"),i}function Vi(e,t,n,o){return Mi(this,arguments,void 0,function*(e,t,n,o,i=!1,r=!1){let s=[],c=[],a=ji(t,i,r),l=yield o.MakeTheTypeConceptLocal(a,999,999,999);n.push(l);for(let t=0;t<e.length;t++){let n=yield o.MakeTheTypeConceptLocal(e[t],999,999,999);s.push(n)}for(let e=0;e<s.length;e++){let n=yield o.CreateTheConnectionLocal(t.id,s[e].id,l.id,1e3,a,999);c.push(n)}for(let e=0;e<s.length;e++)n.push(s[e]);return c})}var $i=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Hi(e){return $i(this,void 0,void 0,function*(){let t;try{const n=yield fetch(l.B.GetCachedImage(e),{method:"GET"});return n.ok?t=n.body:(console.log("Error in Getting Image",n.status),(0,u.ry)(n)),t}catch(e){throw e instanceof Error?console.log("Error in Getting Local concept by character value error message: ",e):console.log("Error in Getting Local concept by character value unexpected error: ",e),t}})}var qi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function zi(e){return qi(this,arguments,void 0,function*(e,t="normal"){let n,o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");e&&(o=e[0]+"_small."+e[1])}return o&&(n=yield Hi(o)),n})}function Ji(e,t="normal"){let n=e;try{if(e){let o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");e&&(o=e[0]+"_small."+e[1])}o&&(n=l.B.GetCachedImage(o))}}catch(t){console.log("This url has error",e)}return n}var Qi,Yi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const Xi=Date.now().toString(36)+Math.random().toString(36).substring(2);let Zi=[],Ki=[],er=!1;function tr(e){er=e}function nr(e="",t){Oe.b.BearerAccessToken=e,Qi&&ir("updateAccessToken",{accessToken:e,session:Oe.b.sessionId})}function or(){return Yi(this,arguments,void 0,function*(e="",t="",n="",o="",i=!0,s="",c=void 0,a={},d={},h=""){var p;try{l.B.BASE_URL=e,l.B.AI_URL=t,l.B.NODE_URL=o,l.B.BASE_APPLICATION=s,l.B.LOG_SERVER=null!==(p=d.logserver)&&void 0!==p?p:"https://logdev.freeschema.com",l.B.ACCESS_CONTROL_BASE_URL=h,console.log("setting the logserver",l.B.LOG_SERVER,d.logserver),n&&nr(n);let i=Math.floor(1e8*Math.random());l.B.setRandomizer(i);const f={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1};if(l.B.FLAGS=f,l.B.FLAGS=Object.assign(Object.assign({},f),a),function(e){const t=co.V.logfunction("initializeFlags",arguments);try{return e.logApplication&&(ao.initialize(),co.V.logApplicationActivationStatus=!0,console.warn("Application log started.")),e.logPackage&&(co.V.logPackageActivationStatus=!0,console.warn("Package log started.")),e.accessTracker&&(Ee.J.activateStatus=!0,console.warn("Access Tracker Activated.")),e.isTest&&(r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0,r.B.isLocalDataLoaded=!0,r.B.isLocalTypeLoaded=!0,r.B.isLocalCharacterLoaded=!0,r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0,r.B.isLocalConnectionLoaded=!0),co.V.logUpdate(t),e}catch(e){throw(0,u.ey)(t,"initializeFlags",e),e}}(l.B.FLAGS),!("serviceWorker"in navigator))return yield sr(),void console.warn("Service Worker not supported in this browser.");if(yield function(){return Yi(this,void 0,void 0,function*(){var e;let t=l.B.BASE_APPLICATION+"_cacheServers",n=l.B.BASE_APPLICATION+"_config",o=l.B.BASE_APPLICATION+"_session",i=sessionStorage.getItem(t),r=sessionStorage.getItem(n),s=null!==(e=sessionStorage.getItem(o))&&void 0!==e?e:"999",c=parseInt(s);void 0!==i&&"undefined"!==i||(l.B.NODE_CACHE_URL=l.B.BASE_URL),i=JSON.parse(i);const a=JSON.parse(r);i&&a&&a.documentationWidget&&999!=c?(Array.isArray(i)&&i.length?l.B.NODE_CACHE_URL=i[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,Oe.b.setSession(c),l.B.DOCUMENTATION_WIDGET=a.documentationWidget):yield function(){return Yi(this,void 0,void 0,function*(){var e;let i;try{let r=null!==(e=l.B.BASE_APPLICATION)&&void 0!==e?e:"boomconsole";if(i=yield fetch(l.B.getAppConfig()+"?application="+r,{method:"POST"}),!i.ok)throw new Error("Failed to sync data to the server.");const s=yield i.json();s.success&&(sessionStorage.setItem(t,JSON.stringify(s.servers)),sessionStorage.setItem(n,JSON.stringify(s.config)),sessionStorage.setItem(o,s.session),Oe.b.setSession(s.session),s.servers?l.B.NODE_CACHE_URL=s.servers[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,s.config&&(l.B.DOCUMENTATION_WIDGET=s.config.documentationWidget))}catch(e){console.error("error getting app config from server",e.message)}})}(),console.log("before the payload in app",Oe.b.sessionId),navigator.serviceWorker&&navigator.serviceWorker.controller&&ir("SESSION_DATA",{type:"SESSION_DATA",data:l.B.NODE_CACHE_URL,session:Oe.b.sessionId})})}(),function(){navigator.serviceWorker.addEventListener("message",e=>Yi(this,void 0,void 0,function*(){var t,n,o,i;try{if(e.data&&"API_401"===e.data.type){const{requestDetails:o}=e.data,i={method:o.method,headers:new Headers(o.headers),body:o.body},r=yield fetch(o.url,i),s=yield null==r?void 0:r.json();null===(n=null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||void 0===n||n.postMessage({type:"API_RESPONSE",messageId:e.data.messageId,response:new Response(s,{status:r.status,statusText:r.statusText,headers:r.headers})})}}catch(t){console.error("Error during listenPostMessage",t),null===(i=null===(o=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===o?void 0:o.controller)||void 0===i||i.postMessage({type:"API_RESPONSE",messageId:e.data.messageId})}}))}(),function(){so.x.addEventListener("message",e=>Yi(this,void 0,void 0,function*(){const{type:t,payload:n}=e.data;if(!t)return;let o={success:!1,data:void 0};rr[t]?yield rr[t](n):console.warn(`Unable to handle "${t}" case in BC service worker`)}))}(),c&&c.activate&&c.manual)yield new Promise((e,t)=>{navigator.serviceWorker.ready.then(t=>Yi(this,void 0,void 0,function*(){console.log("registraions ready",t),Qi=t.active,yield dr(),e("done")})).catch(e=>{console.error("Error: Ready service worker",e),t(e)}).finally(()=>console.log("Finally service worker ready done")),setTimeout(()=>t("Timeout ready"),3e4)});else if(c&&(null==c?void 0:c.activate))try{console.log("service worker initialiing"),yield function(e){var t=arguments;return Yi(this,void 0,void 0,function*(){const n=co.V.logfunction("handleRegisterServiceWorker",t);yield new Promise((t,o)=>{var i,r;let s=!1;navigator.serviceWorker.register(null!==(i=e.pathToSW)&&void 0!==i?i:"./serviceWorker.bundle.js",{scope:null!==(r=e.scope)&&void 0!==r?r:"/"}).then(e=>Yi(this,void 0,void 0,function*(){console.log("Service Worker registered:",e),setInterval(()=>{Ki.length&&ar()},2e3),console.log("update listen start"),e.onupdatefound=()=>{const n=e.installing;console.log("new worker",n),n&&(n.onstatechange=()=>Yi(this,void 0,void 0,function*(){console.warn("on state change triggered",n.state,navigator.serviceWorker.controller),"installing"===n.state&&(console.log("Service Worker installing"),Qi=void 0),"activated"!==n.state&&"redundant"!==n.state||!navigator.serviceWorker.controller||(Qi=n,console.log("New Service Worker is active",e),setTimeout(()=>{console.log("Message Processed after some time"),ar()},5e3),yield dr(),s=!0,ar(),t())}))},e.addEventListener("controllerchange",()=>Yi(this,void 0,void 0,function*(){console.warn("controller change triggered",navigator.serviceWorker.controller),navigator.serviceWorker.controller&&(Qi=navigator.serviceWorker.controller,console.warn("Service worker has been activated; controller change"),yield dr())})),(e.installing||e.waiting||e.active)&&e.addEventListener("statechange",e=>Yi(this,void 0,void 0,function*(){var t;"activating"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.state)&&(Qi=navigator.serviceWorker.controller,console.warn("Service Worker is activating statechange"),yield dr())})),e.active?(console.log("active sw"),Qi=e.active,yield dr(),ar(),t()):setTimeout(()=>{s||o("Not Completed Initialization")},1e4)})).catch(e=>Yi(this,void 0,void 0,function*(){yield sr(),o(e),console.error("Service Worker registration failed:",e),(0,u.ey)(n,"handleRegisterServiceWorker",e)}))})})}(c)}catch(e){yield sr(),console.error("Unable to start service worker",e)}else yield sr(),console.warn("Service Worker not activated");return!0}catch(e){yield sr(),console.warn("Cannot initialize the system",e)}})}function ir(e,t){return Yi(this,arguments,void 0,function*(e,t,n=0){let o=!1;const i=Math.random().toString(36).substring(2);t.messageId=i,t.TABID=Xi;const r=JSON.parse(JSON.stringify(t));let s;return"checkProcess"!=e&&0==n&&(s=setInterval(()=>Yi(this,void 0,void 0,function*(){if(!o&&!(yield function(e,t){return Yi(this,void 0,void 0,function*(){var n;try{const o=yield ir("checkProcess",{checkMessageId:e});if(console.log("check interval data res for type ",t,e,o.data),null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.processing)return!0}catch(n){return console.error("error on checing executing process",t,e,n),!1}})}(i,e))&&(clearInterval(s),!o)){if(console.log("Failed to handle type "+e+" message not found "+i,"retrying: ",0==n,e),0==n&&"checkProcess"!=e)return console.log("retrying ",e,i),yield ir(e,t,n+1);console.log("Failed to handle type "+e+" "+i)}}),2e3)),new Promise((n,c)=>{if(navigator.serviceWorker.controller||Qi||console.log("",navigator.serviceWorker.controller,Qi,e),navigator.serviceWorker.controller||Qi){const a=r=>{var l,d,h,p,f,v;(null===(l=null==r?void 0:r.data)||void 0===l?void 0:l.messageId)==i&&(o=!0,clearInterval(s),r.data.success||(401==(null===(d=null==r?void 0:r.data)||void 0===d?void 0:d.status)?c((0,u.ry)(new Response("Unauthorized",{status:401,statusText:null===(h=null==r?void 0:r.data)||void 0===h?void 0:h.statusText}))):500==(null===(p=null==r?void 0:r.data)||void 0===p?void 0:p.status)?c((0,u.Mb)(new Response("Internal Server Error",{status:500,statusText:null===(f=null==r?void 0:r.data)||void 0===f?void 0:f.statusText}))):(console.error("Error in the response from worker:",r),c(`Failed to handle action ${e} ${JSON.stringify(t)}, Response: ${JSON.stringify(r.data)}`))),(null===(v=r.data)||void 0===v?void 0:v.actions)&&(t.actions=JSON.parse(JSON.stringify(r.data.actions))),n(r.data),navigator.serviceWorker.removeEventListener("message",a))};if(navigator.serviceWorker.addEventListener("message",a),navigator.serviceWorker.controller)"checkProcess"!=e&&console.log("sent to sw",e,i),navigator.serviceWorker.controller.postMessage({type:e,payload:r});else if(Qi){console.warn(`controller not found but serviceWorker is available. messageId: ${i}, type: ${e}`);try{Qi.postMessage({type:e,payload:r})}catch(t){console.log("Retrying again on catch service worker",t),Qi.postMessage({type:e,payload:r})}}else console.warn(`Service Worker hasn't loaded yet. messageId: ${i}, type: ${e}`),console.info("ready",navigator.serviceWorker.ready),setTimeout(()=>{console.warn(`Re-Trying after certain time. messageId: ${i}, type: ${e}`),Qi?(console.info("This is triggered "),null==Qi||Qi.postMessage({type:e,payload:t})):(console.log("not ready",e),clearInterval(s),c("Service worker not ready"))},3e4);setTimeout(()=>{clearInterval(s),c(`No response from service worker after timeout: ${e}`),navigator.serviceWorker.removeEventListener("message",a)},21e4)}else Ki.push({message:{type:e,payload:r}}),"init"==e&&(clearInterval(s),n(null))})})}const rr={GetLinkListener:e=>Yi(void 0,void 0,void 0,function*(){const t=Zi.find(t=>t.listenerId==e.listenerId);return null==t||t.callback(e.data),{success:!0}}),dispatchEvent:e=>Yi(void 0,void 0,void 0,function*(){if(Qi){let t=new CustomEvent(e.id||"",e.data);dispatchEvent(t)}return{success:!0}}),checkInit:e=>Yi(void 0,void 0,void 0,function*(){return console.log("service worker init 0"),navigator.serviceWorker.controller&&(console.log("service worker init 1"),Qi=navigator.serviceWorker.controller),yield dr(),{success:!0}})};function sr(){return Yi(this,void 0,void 0,function*(){yield(0,ro.A)();const e=(new Date).getTime();yield(0,i.A)().then(()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare concept data is ",t)}).catch(e=>{throw e}),yield(0,io.Ay)().then(()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare local concept ",t)}).catch(e=>{throw e}),yield(0,oo.p)().then(()=>{r.B.isLocalConnectionLoaded=!0}).catch(e=>{throw e}),yield(0,io.xd)().catch(e=>{throw console.log("This is the error in populating binary tree"),e}),yield(0,oo.a)().then(()=>{r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0;let t=(new Date).getTime()-e;console.log("The time taken to prepare connections ",t)}).catch(e=>{throw e})})}function cr(e,t={}){if(Qi||"undefined"!=typeof window){let n=new CustomEvent(`${e}`,t);dispatchEvent(n)}else so.x.postMessage({type:"dispatchEvent",payload:{id:e,data:t}})}function ar(){return Yi(this,void 0,void 0,function*(){console.log("message queue",Ki);const e=Ki.find(e=>{var t;return"init"==(null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.type)});if(e){console.log("Processing Init Queue poped",null==e?void 0:e.type,e);const t=Ki.indexOf(e);t>-1&&Ki.splice(t,1),yield ir(null==e?void 0:e.type,null==e?void 0:e.payload)}for(console.log("message queue while",Ki);Ki.length>0;){const{message:e,resolve:t,reject:n}=Ki.shift();console.log("Queue poped",e.type,e),yield ir(e.type,e.payload)}})}const lr=e=>{if(e instanceof V.z)throw console.error("FreeSchemaResponse Error",e),e;console.error("Service Worker Error",e)};function dr(){return Yi(this,void 0,void 0,function*(){yield ir("init",{url:l.B.BASE_URL,aiurl:l.B.AI_URL,accessToken:Oe.b.BearerAccessToken,nodeUrl:l.B.NODE_URL,enableAi:!1,applicationName:l.B.BASE_APPLICATION,flags:l.B.FLAGS,accessControlUrl:l.B.ACCESS_CONTROL_BASE_URL})})}},8633:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},8642:(e,t,n)=>{n.d(t,{Y:()=>h});var o=n(8286),i=n(9581),r=n(4364),s=n(5284),c=n(1412),a=n(3518),l=n(1863),d=n(8562),u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function h(){var e=arguments;return u(this,arguments,void 0,function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionBulk",e)||{};if(d.serviceWorker){n.serviceWorker=!0;try{const e=yield(0,d.sendMessage)("GetAllConnectionsOfCompositionBulk",{composition_ids:t});return d.Logger.logUpdate(n),e.data}catch(e){console.error("GetAllConnectionsOfCompositionBulk sw error: ",e),(0,l.ey)(n,"GetAllConnectionsOfCompositionBulk",e),(0,d.handleServiceWorkerException)(e)}}var h=[];if(t.length<=0)return h;var p=yield(0,s.B)(t),f=yield function(){var e=arguments;return u(this,arguments,void 0,function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionOnline",e);var r=[];try{var s=(0,a.Xr)("application/json");const e=yield fetch(i.B.GetAllConnectionsOfCompositionBulkUrl(),{method:"POST",headers:s,body:JSON.stringify(t)});if(e.ok){const t=yield e.json();for(var c=0;c<t.length;c++)o.d.AddConnection(t[c]),r.push(t[c])}else console.log("Get all connections of composition bulk error message: ","Cannot get response"),(0,l.ry)(e);return d.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connections of composition bulk error message: ",e.message):console.log("Get all connections of composition bulk unexpected error: ",e),(0,l.Mb)(e,i.B.GetAllConnectionsOfCompositionBulkUrl()),(0,l.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}})}(t);return h=f,(0,c.e)(h,p),yield(0,r.s)(h),d.Logger.logUpdate(n),h})}},8675:(e,t,n)=>{n.d(t,{l:()=>c});var o=n(1863),i=n(3518),r=n(8562),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e){var t=arguments;return s(this,void 0,void 0,function*(){r.Logger.logfunction("GetAllLinkerConnectionsFromTheConcept",t);var n=[];try{(new Date).getTime();var s=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionOfConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:s});if(t.ok){const e=yield t.json();for(var c=0;c<e.length;c++){var a=e[c];n.push(a)}}else console.log("Get all linker connection from the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection from the concepts error: ",e.message):console.log("Get all linker connection from the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionOfConceptUrl())}return n})}},8937:e=>{var t={}.hasOwnProperty,n=/[ -,\.\/:-@\[-\^`\{-~]/,o=/[ -,\.\/:-@\[\]\^`\{-~]/,i=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,r=function e(r,s){"single"!=(s=function(e,n){if(!e)return n;var o={};for(var i in n)o[i]=t.call(e,i)?e[i]:n[i];return o}(s,e.options)).quotes&&"double"!=s.quotes&&(s.quotes="single");for(var c="double"==s.quotes?'"':"'",a=s.isIdentifier,l=r.charAt(0),d="",u=0,h=r.length;u<h;){var p=r.charAt(u++),f=p.charCodeAt(),v=void 0;if(f<32||f>126){if(f>=55296&&f<=56319&&u<h){var y=r.charCodeAt(u++);56320==(64512&y)?f=((1023&f)<<10)+(1023&y)+65536:u--}v="\\"+f.toString(16).toUpperCase()+" "}else v=s.escapeEverything?n.test(p)?"\\"+p:"\\"+f.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(p)?"\\"+f.toString(16).toUpperCase()+" ":"\\"==p||!a&&('"'==p&&c==p||"'"==p&&c==p)||a&&o.test(p)?"\\"+p:p;d+=v}return a&&(/^-[-\d]/.test(d)?d="\\-"+d.slice(1):/\d/.test(l)&&(d="\\3"+l+" "+d.slice(1))),d=d.replace(i,function(e,t,n){return t&&t.length%2?e:(t||"")+n}),!a&&s.wrap?c+d+c:d};r.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},r.version="3.0.0",e.exports=r},8939:(e,t,n)=>{n.d(t,{$N:()=>I,$V:()=>h,Ez:()=>T,JA:()=>C,Mb:()=>v,Nj:()=>f,PT:()=>w,RW:()=>m,XI:()=>g,ay:()=>u,hL:()=>d,kx:()=>y,re:()=>p,yz:()=>k,zN:()=>N});var o=n(7139),i=n(2),r=n(3026),s=n(8286),c=n(8562),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){return l(this,void 0,void 0,function*(){let t={connectionList:[],compositionList:[]};try{if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionById",{id:e})).data}catch(e){console.error("GetCompositionById error sw: ",e),(0,c.handleServiceWorkerException)(e)}let n=yield(0,i.s)(e);t.connectionList=n;for(let e=0;e<t.connectionList.length;e++)t.compositionList.includes(t.connectionList[e].ofTheConceptId)||t.compositionList.push(t.connectionList[e].ofTheConceptId);return t}catch(e){return console.error("GetCompositionById error: ",e),t}})}function u(e,t,n){return l(this,void 0,void 0,function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield N(e,t,n);return c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l,c})}function h(e,t,n){return l(this,void 0,void 0,function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield N(e,t,n);c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l;let d={};return d.created_at=a.entryTimeStamp,d.data=c,d.id=e,d})}function p(e,t,n){return l(this,void 0,void 0,function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield S(a,t,n);return c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l,c})}function f(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetComposition",{id:e})).data}catch(e){console.error("GetComposition error sw: ",e),(0,c.handleServiceWorkerException)(e)}let s=[],a={};s=yield(0,i.s)(e);let l=[];for(let e=0;e<s.length;e++)l.includes(s[e].ofTheConceptId)||l.push(s[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield N(e,s,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a})}function v(e){return l(this,void 0,void 0,function*(){var t,n;let s=[],c={};s=yield(0,i.s)(e);let a=[];for(let e=0;e<s.length;e++)a.includes(s[e].ofTheConceptId)||a.push(s[e].ofTheConceptId);let l=yield r.I.GetConcept(e);0==l.id&&null!=e&&null!=e&&(l=yield(0,o.r)(e));let d=yield b(e,s,a);return c[null!==(n=null===(t=null==l?void 0:l.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=d,c})}function y(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionFromMemory",{id:e})).data}catch(e){console.error("GetCompositionFromMemory error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield A(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a})}function g(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionFromMemoryNormal",{id:e})).data}catch(e){console.error("GetCompositionFromMemoryNormal error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield S(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a})}function m(e){var t=arguments;return l(this,void 0,void 0,function*(){var n,i;const l=c.Logger.logfunction("GetCompositionWithIdFromMemory",t)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return c.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",e),(0,c.handleServiceWorkerException)(e)}}let d={},u=[],h={};try{u=yield s.d.GetConnectionsOfCompositionLocal(e);let t=[];for(let e=0;e<u.length;e++)t.includes(u[e].ofTheConceptId)||t.push(u[e].ofTheConceptId);let c=yield r.I.GetConcept(e);0==c.id&&null!=e&&null!=e&&(c=yield(0,o.r)(e));let a=yield A(c,u,t);h[null!==(i=null===(n=null==c?void 0:c.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=a,d.created_at=c.entryTimeStamp,d.data=h,d.id=e}catch(t){console.log("this is the exception in GetCompositionWithIdFromMemory",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",t)}return c.Logger.logUpdate(l),d})}function C(e,t){var n=arguments;return l(this,void 0,void 0,function*(){var i,s;const l=c.Logger.logfunction("GetCompositionFromMemoryWithConnections",n)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("GetCompositionFromMemoryWithConnections",{id:e,connectionList:t});return c.Logger.logUpdate(l),n.data}catch(e){console.error("GetCompositionFromMemoryWithConnections error sw: ",e),(0,a.ey)(l,"GetCompositionFromMemoryWithConnections",e),(0,c.handleServiceWorkerException)(e)}}let d={},u=[];for(let e=0;e<t.length;e++)u.includes(t[e].ofTheConceptId)||u.push(t[e].ofTheConceptId);let h=yield r.I.GetConcept(e);0==h.id&&null!=e&&null!=e&&(h=yield(0,o.r)(e));let p=yield A(h,t,u);d[null!==(s=null===(i=null==h?void 0:h.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=p;let f={};return f.created_at=h.entryTimeStamp,f.data=d,f.id=e,c.Logger.logUpdate(l),f})}function w(e,t){return l(this,void 0,void 0,function*(){var n,i;const s=c.Logger.logfunction("GetCompositionWithIdFromMemoryFromConnection",[e])||{};if(c.serviceWorker){s.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return c.Logger.logUpdate(s),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(s,"GetCompositionWithIdFromMemoryFromConnection",e),(0,c.handleServiceWorkerException)(e)}}let l={},d=[];for(let e=0;e<t.length;e++)d.includes(t[e].ofTheConceptId)||d.push(t[e].ofTheConceptId);let u=yield r.I.GetConcept(e);0==u.id&&null!=e&&null!=e&&(u=yield(0,o.r)(e));let h=yield A(u,t,d);l[null!==(i=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=h;let p={};return p.created_at=u.entryTimeStamp,p.data=l,p.id=e,c.Logger.logUpdate(s),p})}function I(e){return l(this,void 0,void 0,function*(){var t;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionWithIdFromMemoryNew",{id:e})).data}catch(e){console.error("GetCompositionWithIdFromMemoryNew error sw: ",e),(0,c.handleServiceWorkerException)(e)}let n=[],i={};n=yield s.d.GetConnectionsOfCompositionLocal(e);let a=[];for(let e=0;e<n.length;e++)a.includes(n[e].ofTheConceptId)||a.push(n[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(console.log("this concept you cannot find ",e),d=yield(0,o.r)(e)),(new Date).getTime();let u=yield function(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a,l,d,u,h;let p={},f=e.id,v=((new Date).getTime(),null!==(r=null===(i=null==e?void 0:e.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"");if(!n.includes(f)){let t=v;return{[t]:null==e?void 0:e.characterValue}}if(o.includes(f))return"";o.push(f);for(let e=0;e<t.length;e++){let n=yield(0,c.GetTheConcept)(t[e].ofTheConceptId),o=yield(0,c.GetTheConcept)(t[e].toTheConceptId);t[e].ofConcept=n,t[e].toConcept=o;let i=n.id,r="the_",l=(null!==(a=null===(s=null==o?void 0:o.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(r,"");null!=p[i]&&null!=p[i]||(p[i]={}),p[i][l]=o.characterValue}let y={};for(let e=0;e<t.length;e++){let n=t[e].ofConcept,o=t[e].toConcept,i=null!==(d=null===(l=null==n?void 0:n.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"",r="the_",s=(null!==(h=null===(u=null==o?void 0:o.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"").replace(r,"");null!=y[n.id]&&null!=y[n.id]||(y[n.id]={});let c=y[n.id];null!=c[i]&&null!=c[i]||(c[i]={}),null!=p[t[e].ofTheConceptId]&&null!=p[t[e].toTheConceptId]?c[i][s]=p[o.id]:c[i][s]=o.characterValue}return y[e.id]})}(d,n,a);null===(t=null==d?void 0:d.type)||void 0===t||t.characterValue,i=u;let h={};return h.created_at=d.entryTimeStamp,h.data=i,h.id=e,h})}function T(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionWithIdAndDateFromMemory",{id:e})).data}catch(e){console.error("GetCompositionWithIdAndDateFromMemory error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield N(e,i,l);a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u;let h={};return h.data=a,h.id=e,h.created_at=d.entryTimeStamp,h})}function k(e){var t=arguments;return l(this,void 0,void 0,function*(){var n,s;const l=c.Logger.logfunction("GetCompositionWithId",t)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithId",{id:e});return c.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithId error sw: ",e),(0,a.ey)(l,"GetCompositionWithId",e),(0,c.handleServiceWorkerException)(e)}}let d=[],u={};d=yield(0,i.s)(e);let h=[];for(let e=0;e<d.length;e++)h.includes(d[e].ofTheConceptId)||h.push(d[e].ofTheConceptId);let p=yield r.I.GetConcept(e);0==p.id&&null!=e&&null!=e&&(p=yield(0,o.r)(e));let f=yield N(e,d,h);u[null!==(s=null===(n=null==p?void 0:p.type)||void 0===n?void 0:n.characterValue)&&void 0!==s?s:""]=f;let v={};return v.data=u,v.id=e,c.Logger.logUpdate(l),v})}function A(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,c,a;let l={},d=[],u=e.id;if(null===(s=null==e?void 0:e.type)||void 0===s?void 0:s.characterValue,!n.includes(u))return null==e?void 0:e.characterValue;if(i.includes(u))return"";i.push(u);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==u)if(u!=t[e].toTheConceptId){let s=t[e].toTheConceptId,u=yield r.I.GetConcept(s);if(null!=u&&0!=u.id||null==s||null==s||(u=yield(0,o.r)(s)),0!=u.id&&null==(null==u?void 0:u.type)){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}let h="the_",p=(null!==(a=null===(c=null==u?void 0:u.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(p))){if(p){const e=yield A(u,t,n,i);l[p]=e}}else{const e=yield A(u,t,n,i);d[p]=e,l=d}}else console.log("this is the faulty connection ",t[e]);return l})}function S(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,a,l;const d=c.Logger.logfunction("recursiveFetchConceptNormal",[e]);(new Date).getTime();let u={},h=[],p=e.id;if(u.id=p,null===(s=null==e?void 0:e.type)||void 0===s?void 0:s.characterValue,!n.includes(p))return null==e?void 0:e.characterValue;if(i.includes(p))return"";i.push(p);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==p)if(p!=t[e].toTheConceptId){let s=t[e].toTheConceptId,c=yield r.I.GetConcept(s);if(null!=c&&0!=c.id||null==s||null==s||(c=yield(0,o.r)(s)),0!=c.id&&null==(null==c?void 0:c.type)){let e=c.typeId,t=yield r.I.GetConcept(e);c.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),c.type=t)}let d="the_",p=(null!==(l=null===(a=null==c?void 0:c.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"").replace(d,"");if(isNaN(Number(p))){if(p){const e=yield A(c,t,n,i);u[p]=e}}else{const e=yield A(c,t,n,i);h[p]=e,u=h}}else console.log("this is the faulty connection ",t[e]);return c.Logger.logUpdate(d),u})}function N(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,c,a;let l={},d=[];if(0==e)return null;let u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==u.type){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}if(null===(s=null==u?void 0:u.type)||void 0===s?void 0:s.characterValue,!n.includes(e))return null==u?void 0:u.characterValue;if(i.includes(e))return"";i.push(e);for(let s=0;s<t.length;s++)if((new Date).getTime(),t[s].ofTheConceptId==e)if(e!=t[s].toTheConceptId){let e=t[s].toTheConceptId,u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==(null==u?void 0:u.type)){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}let h="the_",p=(null!==(a=null===(c=null==u?void 0:u.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(p))){if(p){const o=yield N(e,t,n,i);l[p]=o}}else{const o=yield N(e,t,n,i);d[p]=o,l=d}}else console.log("this is the faulty connection ",t[s]);return l})}function b(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,c,a;let l={},d=[];if(0==e)return null;let u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==u.type){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}if(null===(s=null==u?void 0:u.type)||void 0===s?void 0:s.characterValue,!n.includes(e))return null==u?void 0:u.characterValue;if(i.includes(e))return"";i.push(e),l.id=e;for(let i=0;i<t.length;i++)if(t[i].ofTheConceptId==e){let e=t[i].toTheConceptId,s=yield r.I.GetConcept(e);if(null!=s&&0!=s.id||null==e||null==e||(s=yield(0,o.r)(e)),s&&null==(null==s?void 0:s.type)){let e=s.typeId,t=yield r.I.GetConcept(e);s.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),s.type=t)}let u="the_",h=(null!==(a=null===(c=null==s?void 0:s.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(u,"");if(isNaN(Number(h))){if(h){const o=yield b(e,t,n);l[h]=o}}else{const o=yield b(e,t,n);d[h]=o,l=d}}return l})}},9003:(e,t,n)=>{n.d(t,{S5:()=>l,kH:()=>u,qI:()=>a});var o=n(1863),i=n(8562),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};let s=10;class c{}function a(e){const t=i.Logger.logfunction("openDatabase",arguments);return new Promise(function(n,r){c.db&&(i.Logger.logUpdate(t),n(c.db));let l=i.BaseUrl.BASE_URL+"_FreeSchemaLocal"+i.BaseUrl.BASE_APPLICATION;const u=indexedDB.open(l,s);u.onupgradeneeded=e=>{var t=e.target.result,o="localconcept",r="localconnection",c="localid";console.log("this is the version upgrade",s),t.objectStoreNames.contains(o)&&t.deleteObjectStore(o),t.objectStoreNames.contains(r)&&t.deleteObjectStore(r),t.objectStoreNames.contains(c)&&t.deleteObjectStore(c),t.objectStoreNames.contains(o)||(t.createObjectStore(o,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(r)||(t.createObjectStore(r,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(c)||(t.createObjectStore(c,{keyPath:"id"}).transaction.oncomplete=e=>{d(c,{id:0,value:-100}),d(c,{id:1,value:-200}),d(c,{id:3,value:i.BaseUrl.getRandomizer()})}),n(t)},u.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(l),a(e),(0,o.ey)(t,"openDatabase",n),r(n)},u.onsuccess=function(e){var o=e.target;c.db=o.result,i.Logger.logUpdate(t),n(c.db)}})}function l(e){var t=arguments;return r(this,void 0,void 0,function*(){const n=i.Logger.logfunction("getObjectsFromLocalIndexDb",t);return new Promise(function(t,r){a(e).then(o=>{var r=[],s=o.transaction(e,"readwrite").objectStore(e).getAll();s.onsuccess=()=>{const e=s.result;for(var o=0;o<e.length;o++)r.push(e[o]);i.Logger.logUpdate(n),t(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot get objects from database because you cannot open the Local database",data:e};(0,o.ey)(n,"getObjectsFromLocalIndexDb",t),r(t)})})})}function d(e,t){const n=i.Logger.logfunction("storeToDatabase",[e,"localindexdb"]);return new Promise(function(r,s){a(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).add(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot store to the Local database "+e,data:i,body:t};(0,o.ey)(n,"storeToDatabase",r),s(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot store to database because you cannot open the Local database",data:e};(0,o.ey)(n,"storeToDatabase",t),s(t)})})}function u(e,t){const n=i.Logger.logfunction("UpdateToDatabase",arguments);return new Promise(function(r,s){a(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot Update to the Local database"+e,data:i,body:t};(0,o.ey)(n,"UpdateToDatabase",r),s(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the Local database",data:e};(0,o.ey)(n,"UpdateToDatabase",t),s(t)})})}},9371:(e,t,n)=>{let o=n(3152);class i extends o{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},9577:(e,t,n)=>{let o=n(7793),i=n(1106),r=n(8339);function s(e,t){let n=new i(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=s,s.default=s,o.registerParse(s)},9581:(e,t,n)=>{n.d(t,{B:()=>o});class o{static setRandomizer(e){console.log("set randomizer",e),this.BASE_RANDOMIZER=e}static getRandomizer(){return this.BASE_RANDOMIZER}static GetConceptUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/getConcept":this.NODE_CACHE_URL+"/api/getConcept"}static GetConnectionUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get-connection-by-id":this.NODE_CACHE_URL+"/api/get-connection-by-id"}static GetConceptBulkUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get_concept_bulk":this.NODE_CACHE_URL+"/api/get_concept_bulk"}static GetConnectionBulkUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get_connection_bulk":this.NODE_CACHE_URL+"/api/get_connection_bulk"}static GetAllConceptsOfUserUrl(){return this.BASE_URL+"/api/get_all_concepts_of_user"}static GetAllConnectionsOfUserUrl(){return this.BASE_URL+"/api/get_all_connections_of_user"}static GetAllConnectionsOfCompositionUrl(){return this.BASE_URL+"/api/get_all_connections_of_composition"}static GetAllConnectionsOfCompositionBulkUrl(){return this.BASE_URL+"/api/get_all_connections_of_composition_bulk"}static GetConceptByCharacterValueUrl(){return this.BASE_URL+"/api/get_concept_by_character_value"}static GetConceptByCharacterAndTypeUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_type"}static GetConceptByCharacterAndCategoryUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_category"}static GetConceptByCharacterAndCategoryDirectUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_category_direct"}static GetCharacterByCharacterUrl(){return this.BASE_URL+"/api/get_character_by_character"}static GetAllConceptsByTypeUrl(){return this.BASE_URL+"/api/get_all_concepts_by_type"}static GetAllConnectionsOfConceptUrl(){return this.BASE_URL+"/api/get-link-connections"}static GetAllConnectionsToConceptUrl(){return this.BASE_URL+"/api/get-link-reverse-connections"}static GetAllAiData(){return this.BASE_URL+"/api/get-preloaded-concepts"}static getAppConfig(){return this.NODE_URL+"/api/v1/config"}static PostPrefetchConceptConnections(){return this.NODE_URL+"/api/v1/access-tracker/sync-access-tracker"}static GetSuggestedConcepts(){return this.NODE_URL+"/api/v1/access-tracker/list-concepts-file"}static GetSuggestedConnections(){return this.NODE_URL+"/api/v1/access-tracker/list-connections-file"}static PostLogger(){return this.LOG_SERVER+"/api/logger"}static LogHealth(){return this.LOG_SERVER+"/api/check"}static GetAllPrefetchConnectionsUrl(){return this.BASE_URL+"/api/get_all_connections_of_user?inpage=500"}static GetAllLinkerConnectionOfConceptUrl(){return this.BASE_URL+"/api/get-all-linkers-from-concept"}static GetAllLinkerConnectionToConceptUrl(){return this.BASE_URL+"/api/get-all-linkers-to-concept"}static DeleteConceptUrl(){return this.BASE_URL+"/api/delete_concept"}static DeleteUserUrl(){return this.BASE_URL+"/api/deleteuser"}static RecursiveSearchUrl(){return this.BASE_URL+"/api/recursivesearch-concept-connection"}static SearchLinkMultipleAllApiUrl(){return this.BASE_URL+"/api/Connection/search-link-multiple-all-ccs"}static MakeTheNameInBackendUrl(){return this.BASE_URL+"/api/make-name-from-frontend"}static SearchAllTypeWithLinker(e=!0){return e?this.BASE_URL+"/api/search-all-with-linker-ccs":this.BASE_URL+"/api-search-compositions-internal-clean-ccs"}static LoginUrl(){return this.BASE_URL+"/api/auth/login"}static SignupUrl(){return this.BASE_URL+"/api/auth/signup"}static GetCompositionConnectionBetweenTwoConceptsUrl(){return this.BASE_URL+"/api/get-composition-connection-between-two-concepts"}static SearchCompositionsUrl(){return this.BASE_URL+"/api/search-compositions"}static SearchLinkMultipleAll(){return this.BASE_URL+"/api/Connection/search-link-multiple-all"}static CreateSessionId(){return this.BASE_URL+"/api/create-session-id-remote"}static CreateSessionVisitUrl(){return this.BASE_URL+"/api/create-remote-session-visit"}static ViewInternalDataUrl(){return this.BASE_URL+"/api/view-api-internal-data-ccs-id-bulk"}static SearchInternalWithAuthenticatedCcsUrl(){return this.BASE_URL+"/api/search-composition-internal-authenticated-ccs"}static SearchInternalWithCcsUrl(){return this.BASE_URL+"/api-search-compositions-internal-clean-ccs"}static CreateGhostConceptApiUrl(e=!0){return e?o.NODE_URL+"/api/v1/local-concepts":o.NODE_URL+"/api/v1/local-concepts-without-auth"}static CreateGhostConnectionApiUrl(){return o.NODE_URL+"/api/v1/local-connections"}static GetRealConceptById(){return o.NODE_URL+"/api/v1/local-concepts-translate"}static GetReservedIdUrl(){return this.BASE_URL+"/api/get_reserved_ids"}static GetReservedConnectionIdUrl(){return this.BASE_URL+"/api/get_reserved_connection_ids"}static CreateTheTextDataUrl(){return this.BASE_URL+"/api/create_text_data"}static CreateTheCharacterDataUrl(){return this.BASE_URL+"/api/create_character_data"}static CreateTheConceptUrl(){return this.BASE_URL+"/api/create_the_concept"}static CreateTheConnectionUrl(){return this.BASE_URL+"/api/create_the_connection"}static CreateTheConnectionNewUrl(){return this.BASE_URL+"/api/create_the_connection_new"}static MakeTheTypeConceptUrl(){return this.BASE_URL+"/api/make_the_type_concept"}static DeleteTheConnectionUrl(){return this.BASE_URL+"/api/delete_connection"}static DeleteTheConnectionBulkUrl(){return this.BASE_URL+"/api/delete_connection_bulk"}static GetTypeConceptBulk(){return this.BASE_URL+"/api/get_type_concept_by_character_bulk"}static UploadFileLimitUrl(){return this.BASE_URL+"/api/upload/limit"}static FreeschemaQueryUrl(){return this.BASE_URL+"/api/freeschema-query"}static uploadImageUrl(){return this.BASE_URL+"/api/Image/UploadImage"}static uploadImageUrlWithSmall(){return this.BASE_URL+"/api/Image/UploadImageV2"}static uploadFileUrl(){return this.BASE_URL+"/api/Image/UploadFile"}static sendMail(){return this.BASE_URL+"/api/sendmail"}static sendBulkMail(){return this.BASE_URL+"/api/sendmail/bulk"}static getWidgetData(){return this.BASE_URL+"/api/get-widget"}static getLatestWidgetData(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get-latest-widget":this.NODE_CACHE_URL+"/api/get-latest-widget"}static getRecentWidgetData(){return this.BASE_URL+"/api/get-recent-widget"}static getConnectionsByTypes(){return this.BASE_URL+"/api/get-connection-by-types"}static CreatePrototypeUrl(){return this.BASE_URL+"/api/create-prototype"}static GetCachedImage(e){return"https://cdn.boomconcole.com/freeschema/"+e}}o.BASE_URL="https://localhost:7053/",o.NODE_CACHE_URL="",o.AI_URL="https://ai.freeschema.com",o.MQTT_URL="192.168.1.249",o.NODE_URL="http://localhost:5001",o.LOG_SERVER="https://logdev.freeschema.com",o.BASE_APPLICATION="",o.DOCUMENTATION_WIDGET=0,o.isNearestCache=!0,o.ACCESS_CONTROL_BASE_URL="http://localhost:5001",o.FLAGS={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1},o.BASE_RANDOMIZER=999},9606:(e,t,n)=>{t.__esModule=!0,t.unesc=t.stripComments=t.getProp=t.ensureObject=void 0;var o=c(n(5286));t.unesc=o.default;var i=c(n(6291));t.getProp=i.default;var r=c(n(1557));t.ensureObject=r.default;var s=c(n(8354));function c(e){return e&&e.__esModule?e:{default:e}}t.stripComments=s.default},9635:(e,t,n)=>{n.d(t,{x:()=>o});const o=new BroadcastChannel("Freeschema_mftsccs_browser_channel")},9700:(e,t,n)=>{n.d(t,{V:()=>l});var o,i=n(8562),r=n(3278),s=n(1863),c=n(3518),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class l{static startAutoSync(){this.autoSyncInterval?console.warn("Auto-sync is already running."):(this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS,setInterval(()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&(this.nextSyncTime=e+this.SYNC_INTERVAL_MS,this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())},3e4))}static stopAutoSync(){null!==this.autoSyncInterval&&(clearInterval(this.autoSyncInterval),this.autoSyncInterval=null,this.nextSyncTime=null)}static setLogLevel(e){this.logLevel=e}static shouldLog(e){return this.LOG_LEVELS.indexOf(e)>=this.LOG_LEVELS.indexOf(this.logLevel)}static formatLogData(e,t,n){const o=Object.assign({timestamp:(new Date).toISOString(),level:e,message:t},n);return this.packageLogsData.push(o),"ERROR"==e&&(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer()),o}static log(e,t,n){if(this.logPackageActivationStatus)try{this.formatLogData(e,t,n||null)}catch(e){console.error("Error on Logger Log : ",e)}}static logUpdate(e){var t;try{if(!this.logPackageActivationStatus)return{};if(!e)return{};const n=Date.now();e.startTime=null!==(t=e.startTime)&&void 0!==t?t:n;const o=n-e.startTime;e.responseTime=`${o} ms`,1==!e.serviceWorker&&(e.serviceWorker=!1)}catch(t){(0,s.ey)(e,"Logger.logUpdate",t)}}static logfunction(e,...t){if(!this.logPackageActivationStatus)return{};const n=Date.now();let o=t;const s=i.BaseUrl.getRandomizer(),c=r.b.sessionId;let a={startTime:n,functionName:e,functionParameters:o,requestFrom:i.BaseUrl.BASE_APPLICATION,sessionId:c,applicationId:s};return this.formatLogData("INFO","function called",a)}static logError(e,t,n,o,i,s,c,a,l,d,u){try{const h=r.b.sessionId,p={startTime:e,userId:t,operationType:n,requestFrom:o,requestIP:i,responseStatus:s,responseTime:`${(performance.now()-e).toFixed(3)}ms`,responseSize:c?`${JSON.stringify(c).length}`:"0",sessionId:null==h?void 0:h.toString(),functionName:a,functionParameters:l,userAgent:d,conceptsUsed:u};this.formatLogData("ERROR",`Information logged for ${a}`,p)}catch(e){console.error("Error on logError")}}static logApplication(e,t,n){if(this.logApplicationActivationStatus)try{const o={timestamp:(new Date).toISOString(),level:e,message:t,data:n||null};this.applicationLogsData.push(o),"ROUTE"!=e&&"USER_EVENT"!=e||(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())}catch(e){console.error("Failed to log application activity:",e)}}static checkLoggerServerStatus(){return a(this,void 0,void 0,function*(){let e=1e4+o.checkInterval;const t=new Date;if(o.lastCheck&&t.getTime()-o.lastCheck.getTime()<e)console.log("still cooling down");else{try{let e=i.BaseUrl.LogHealth();o.lastCheck=new Date,(yield fetch(e,{method:"GET"})).ok&&(o.isLoggerActive=!0,o.checkInterval=0)}catch(e){console.warn("This is error in the logger check")}o.checkInterval=o.checkInterval+500}})}static sendApplicationLogsToServer(){return a(this,void 0,void 0,function*(){const e=this.applicationLogsData;try{if(!o.isLoggerActive)return void o.checkLoggerServerStatus();if(0===e.length)return;this.applicationLogsData=[],r.b.BearerAccessToken;const t=50;let n=(0,c.Xr)(),s=0;for(;0!=e.length;){const r=e.slice(0,t),c=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:n,body:JSON.stringify({logType:this.appLogs,logData:r})});c.ok||404===c.status&&(o.isLoggerActive=!1),e.splice(0,t),s+=t,s++}}catch(e){o.isLoggerActive=!1}})}static sendPackageLogsToServer(){return a(this,void 0,void 0,function*(){const e=this.packageLogsData;try{if(!o.isLoggerActive)return void o.checkLoggerServerStatus();if(0===e.length)return;this.packageLogsData=[];const t=300;let n=0;for(;0!=e.length;){const r=e.slice(0,t);let s=(0,c.Xr)();const a=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:s,body:JSON.stringify({logType:this.mftsccsBrowser,logData:r})});if(!a.ok)return void(404===a.status&&(o.isLoggerActive=!1));e.splice(0,t),n++}}catch(e){o.isLoggerActive=!1}})}static saveLogToLocalStorage(e,t){try{if(void 0===typeof localStorage)return void console.warn("Local Storage type undefined");{const n=JSON.parse((null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))||"[]");n.push(t),null===localStorage||void 0===localStorage||localStorage.setItem(e,JSON.stringify(n))}}catch(e){console.error("Error on saving log in localstorage"),this.log("ERROR","Error while saving log in local storage")}}static clearLogsFromLocalStorage(e){void 0!==typeof localStorage?null===localStorage||void 0===localStorage||localStorage.removeItem(e):console.warn("localStorage is not available")}}o=l,l.isLoggerActive=!0,l.lastCheck=new Date,l.checkInterval=0,l.logLevel="INFO",l.packageLogsData=[],l.applicationLogsData=[],l.LOG_LEVELS=["DEBUG","INFO","WARNING","ERROR","ROUTE"],l.SYNC_INTERVAL_MS=6e4,l.nextSyncTime=null,l.appLogs="app",l.mftsccsBrowser="mftsccs",l.logApplicationActivationStatus=!1,l.logPackageActivationStatus=!1,l.autoSyncInterval=null,o.startAutoSync()},9720:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3295))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.TAG,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},9736:(e,t,n)=>{n.d(t,{v:()=>C});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addConceptToTree(e){var t=new i.x(e.id,e,null,null);new i.x(e.characterValue,e,null,null),this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static getNodeFromTree(e){return r(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static getCharacterAndTypeFromTree(e,t){return this.root?this.root.getFromNodeWithCharacterAndType(e,t,this.root):this.root}static updateSyncStatus(e){return this.root?this.root.updateNodeSyncStatus(e,!0,this.root):this.root}static removeNodeFromTree(e){return r(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}}s.root=null;var c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalCharacterLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addNodeToTree(e){return c(this,void 0,void 0,function*(){return null==this.LocalCharacterRoot?(this.LocalCharacterRoot=e,this.LocalCharacterRoot):(this.LocalCharacterRoot=this.LocalCharacterRoot.addCharacterNode(e,this.LocalCharacterRoot,this.LocalCharacterRoot.height),this.LocalCharacterRoot)})}static addConceptToTree(e){if(""!=e.characterValue){var t=new i.x(e.characterValue,e,null,null);this.addNodeToTree(t)}}static getNodeFromTree(e){return this.LocalCharacterRoot?this.LocalCharacterRoot.getCharacterFromNode(e,this.LocalCharacterRoot):this.LocalCharacterRoot}static getCharacterAndTypeFromTree(e,t){return c(this,void 0,void 0,function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndType(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot})}static getCharacterAndCategoryFromTree(e,t){return c(this,void 0,void 0,function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndCategory(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot})}static removeConceptType(e,t){this.LocalCharacterRoot&&(this.LocalCharacterRoot=this.LocalCharacterRoot.removeNodeWithVariants(this.LocalCharacterRoot,e,t))}}a.LocalCharacterRoot=null;var l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class d{static addNodeToTree(e){return l(this,void 0,void 0,function*(){return null==this.LocalTypeRoot?(this.LocalTypeRoot=e,this.LocalTypeRoot):(this.LocalTypeRoot=this.LocalTypeRoot.addTypeNode(e,this.LocalTypeRoot,this.LocalTypeRoot.height),this.LocalTypeRoot)})}static addConceptToTree(e){if(0!=e.typeId){var t=new i.x(e.typeId,e,null,null);this.addNodeToTree(t)}}static removeConceptType(e,t){this.LocalTypeRoot&&(this.LocalTypeRoot=this.LocalTypeRoot.removeNodeWithVariants(this.LocalTypeRoot,e,t))}static getNodeFromTree(e){return this.LocalTypeRoot?this.LocalTypeRoot.getFromNode(e,this.LocalTypeRoot):this.LocalTypeRoot}static getTypeVariantsFromTree(e){var t=this.getNodeFromTree(e),n=[];if(t){n.push(null==t?void 0:t.value);for(let e=0;e<t.variants.length;e++)n.push(t.variants[e].value);return n}}static waitForDataToLoad(){return l(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalTypeLoaded)return e("done");setTimeout(d.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserId(e,t){return l(this,void 0,void 0,function*(){var n=[],o=this.getNodeFromTree(e);if(o){console.log("this is the node to type",o),o.value.userId!=t&&999!=o.value.userId||n.push(null==o?void 0:o.value);for(let e=0;e<o.variants.length;e++)o.variants[e].value.userId!=t&&999!=o.value.userId||n.push(o.variants[e].value)}return n})}}d.LocalTypeRoot=null;var u=n(6416),h=n(3026),p=n(7820),f=n(4864),v=n(628),y=n(8562),g=n(3278),m=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class C{constructor(){this.name="conceptsArray"}static AddConcept(e){0!=e.id&&(s.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e),this.localconceptsArray.push(e))}static AddPermanentConcept(e){0!=e.id&&(s.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId),p.G.addConceptToTree(e),h.I.AddConcept(e),(0,y.AddGhostConcept)(e,e.userId,g.b.sessionId))}static RemoveConcept(e){return m(this,void 0,void 0,function*(){try{0!=e.id&&(s.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId))}catch(e){throw e}})}static RemoveConceptById(e){return m(this,void 0,void 0,function*(){try{let t=yield C.GetConcept(e);0!=t.id&&(s.removeNodeFromTree(e),a.removeConceptType(t.characterValue,t.ghostId),d.removeConceptType(t.typeId,t.ghostId),v.H.RemoveConcept(t))}catch(e){throw e}})}static AddConceptToMemory(e){0!=e.id&&(s.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e))}static GetConcept(e){return m(this,void 0,void 0,function*(){var t=(0,u.u)(),n=yield s.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static UpdateConceptSyncStatus(e){return m(this,void 0,void 0,function*(){s.updateSyncStatus(e)})}static GetConceptByGhostId(e){return m(this,void 0,void 0,function*(){var t=(0,u.u)(),n=yield p.G.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static GetConceptByCharacter(e){return m(this,void 0,void 0,function*(){var t=(0,u.u)(),n=a.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterAndTypeLocal(e,t){return m(this,void 0,void 0,function*(){var n=(0,u.u)(),o=yield a.getCharacterAndTypeFromTree(e,t);return o&&(n=o.value),n})}static GetConceptByCharacterAndCategoryLocal(e,t){return m(this,void 0,void 0,function*(){var n=(0,u.u)(),o=yield a.getCharacterAndCategoryFromTree(e,t);return o&&(n=o.value),n})}static GetConceptsByTypeId(e){let t=[];for(var n=0;n<this.localconceptsArray.length;n++)this.localconceptsArray[n].typeId==e&&t.push(this.localconceptsArray[n]);return t}static GetConceptsByTypeIdAndUser(e,t){return m(this,void 0,void 0,function*(){let n=[];return n=yield d.getTypeVariantsFromTreeWithUserId(e,t),n})}static ClearData(){return m(this,void 0,void 0,function*(){this.localconceptsArray=[],f.G.connectionArray=[]})}getName(){return this.name}}C.localconceptsArray=[]},9746:()=>{},9934:(e,t,n)=>{function o(e,t){return-1===e.indexOf(t)&&e.push(t),e}n.d(t,{A:()=>o})},9975:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(8562),i=n(9736),r=n(3077),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e,t,n,c,a){return s(this,arguments,void 0,function*(e,t,n,s,c,a={concepts:[],connections:[]}){var l,d,u,h;if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("MakeTheConceptLocal",{referent:e,typeCharacter:t,userId:n,categoryId:s,typeId:c,actions:a});return(null===(d=null===(l=null==i?void 0:i.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(h=null===(u=null==i?void 0:i.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(a.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("MakeTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let p=yield i.v.GetConceptByCharacterAndTypeLocal(e,c),f=p;return"the"==t&&(s=1),0==f.id&&(p=yield(0,r.A)(e,t,n,s,c,4,void 0,null,a),f=p),f})}},9977:()=>{}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=n(8562),i=n(9635),r=n(205),s=n(3278),c=n(5020),a=n(7887),l=n(7869),d=n(3075),u=n(2803),h=n(7139),p=n(5284),f=n(8939),v=n(6687),y=n(2013),g=n(7876),m=n(1213),C=n(5328),w=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const I={GetConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,h.r)(e.id)}}),GetTheConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetTheConcept)(e.id,e.userId)}}),AddTypeConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,g.K)(e.concept)}}),GetConceptBulk:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptBulk)(e.passedConcepts)}}),GetLink:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetLink)(e.id,e.linker,e.inpage,e.page)}}),GetRelation:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetRelation)(e.id,e.relation,e.inpage,e.page,e.reverse)}}),GetRelationRaw:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetRelationRaw)(e.id,e.relation,e.inpage,e.page,e.reverse)}}),GetComposition:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.Nj)(e.id)}}),GetCompositionList:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionList)(e.compositionName,e.userId,e.inpage,e.page)}}),GetCompositionListWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListWithId)(e.compositionName,e.userId,e.inpage,e.page)}}),GetCompositionById:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.hL)(e.id)}}),GetCompositionWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.yz)(e.id)}}),GetCompositionListAllWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListAllWithId)(e.compositionName,e.userId,e.inpage,e.page)}}),GetConceptByCharacter:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptByCharacter)(e.characterValue)}}),GetConceptByCharacterUpdated:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,y.w)(e.characterValue)}}),GetConceptByCharacterAndType:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptByCharacterAndType)(e.characterValue,e.typeId)}}),GetCompositionFromConnectionsWithDataId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.p8)(e.conceptIds,e.connectionIds)}}),GetCompositionFromConnectionsWithDataIdIndex:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.Nt)(e.conceptIds,e.connectionIds)}}),GetCompositionConnectionsBetweenTwoConcepts:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,u.x)(e.ofConceptId,e.toConcept,e.mainKey)}}),GetConnectionDataPrefetch:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.QL)(e.connectionIds)}}),GetCompositionWithIdFromMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.RW)(e.id)}}),GetCompositionWithIdAndDateFromMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.Ez)(e.id)}}),GetCompositionFromMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.kx)(e.id)}}),GetCompositionFromMemoryNormal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.XI)(e.id)}}),GetCompositionWithIdFromMemoryNew:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.$N)(e.id)}}),FindConnectionsOfCompositionsBulkInMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,p.B)(e.composition_ids)}}),GetAllTheConnectionsByTypeAndOfTheConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetAllTheConnectionsByTypeAndOfTheConcept)(e.id,e.linker,e.reverse)}}),GetCompositionFromMemoryWithConnections:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.JA)(e.id,e.connectionList)}}),GetCompositionFromConnectionsWithIndexFromConnections:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.hG)(e.conceptIds,e.connectionIds)}}),GetCompositionFromConnectionsWithDataIdFromConnections:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.km)(e.conceptIds,e.connectionIds)}}),GetTheConceptLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,m.f)(e.id)}}),GetCompositionLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionLocal)(e.id)}}),GetCompositionLocalWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionLocalWithId)(e.id)}}),GetCompositionListLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListLocal)(e.compositionName,e.userId)}}),GetCompositionListLocalWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListLocalWithId)(e.compositionName,e.userId)}}),GetConceptByCharacterAndCategoryLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptByCharacterAndCategoryLocal)(e.character)}}),ConceptsData__AddConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.AddConcept(e.concept)}}),ConceptsData__AddWidget:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.AddWidget(e.widgetDetails)}}),ConceptsData__RemoveWidget:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.RemoveWidget(e.id)}}),ConceptsData__GetConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.GetConcept(e.id)}}),ConceptsData__GetWidget:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.GetWidget(e.id)}}),ConceptsData__GetConceptsByTypeIdAndUser:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.GetConceptsByTypeIdAndUser(e.typeId,e.userId)}}),ConnectionData__GetConnectionByOfTheConceptAndType:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e.ofTheConceptId,e.typeId)}}),ConnectionData__GetConnection:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnection(e.id)}}),ConnectionData__GetConnectionsOfCompositionLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnectionsOfCompositionLocal(e.id)}}),ConnectionData__GetConnectionsOfConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnectionsOfConcept(e.id)}}),GetLinkListener:e=>w(void 0,void 0,void 0,function*(){let t=!1;return new Promise((n,o)=>{(0,C.d)(e.id,e.linker,e.inpage,e.page,e.format).subscribe(o=>{var r,s;t?(console.log("isSubscribed",t),n({success:!0,data:o}),t=!0):(console.log("is not isSubscribed",t),i.x.postMessage({type:"GetLinkListener",payload:{id:null===(r=null==e?void 0:e.listener)||void 0===r?void 0:r.listenerId,listenerId:null===(s=null==e?void 0:e.listener)||void 0===s?void 0:s.listenerId,data:o}}))}).catch(e=>{console.log("Error : ",e),o("Error Occured")})})})};var T=n(1320),k=n(4310),A=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const S={SearchLinkMultipleAll:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.SearchLinkMultipleAll)(e.searchQuery,e.token,e.caller,e.format)}}),RecursiveSearchApi:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApi)(e.composition,e.listLinkers,e.textSearch,e.fullLinkers)}}),RecursiveSearchApiWithInternalConnections:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiWithInternalConnections)(e.composition,e.listLinkers,e.textSearch)}}),RecursiveSearchApiRaw:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiRaw)(e.composition,e.listLinkers,e.textSearch,e.fullLinkers)}}),RecursiveSearchApiRawFullLinker:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiRawFullLinker)(e.composition,e.fullLinkers,e.textSearch)}}),RecursiveSearchApiNewRawFullLinker:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiNewRawFullLinker)(e.composition,e.fullLinkers,e.textSearch)}}),formatConnectionsDataId:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.e$)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos,e.order)}}),formatConnectionsJustId:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.y6)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos,e.order)}}),formatConnectionsV2:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.rq)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos,e.order)}}),formatConnections:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.b6)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos)}}),BuildWidgetFromId:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,k.Cp)(e.id)}}),BuildWidgetFromIdForLatest:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,k.qj)(e.id)}}),BuildWidgetFromCache:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,k.xJ)(e.id)}})};var N=n(1218),b=n(3077),_=n(9975),L=n(5868),E=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const x={MakeTheInstanceConcept:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.MakeTheInstanceConcept)(e.type,e.referent,e.composition,e.userId,e.passedAccessId,e.passedSessionId,e.referentId)}}),MakeTheConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,_.A)(e.referent,e.typeCharacter,e.userId,e.categoryId,e.typeId,e.actions)}}),MakeTheTimestamp:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.MakeTheTimestamp)(e.type,e.referent,e.userId,e.accessId,e.sessionInformationId)}}),CreateTheComposition:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,N.A)(e.json,e.ofTheConceptId,e.ofTheConceptUserId,e.mainKey,e.userId,e.accessId,e.sessionInformationId)}}),MakeTheInstanceConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,L.k)(e.type,e.referent,e.composition,e.userId,e.accessId,e.sessionInformationId,e.referentId,e.actions),actions:e.actions}}),MakeTheTypeConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.MakeTheTypeConceptLocal)(e.typeString,e.sessionId,e.sessionUserId,e.userId,e.actions),actions:e.actions}}),CreateTheConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,b.A)(e.referent,e.typecharacter,e.userId,e.categoryId,e.typeId,e.accessId,e.isComposition,e.referentId,e.actions),actions:e.actions}}),CreateTheCompositionLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateTheCompositionLocal)(e.json,e.ofTheConceptId,e.ofTheConceptUserId,e.mainKey,e.userId,e.accessId,e.sessionInformationId,e.automaticSync,e.actions),actions:e.actions}}),CreateData:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateData)(e.json,e.ofConcept,e.typeConcept,e.actions),actions:e.actions}})};var B=n(3729),O=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const R={UpdateComposition:e=>O(void 0,void 0,void 0,function*(){return yield(0,o.UpdateComposition)(e.patcherStructure),{success:!0}}),UpdateCompositionLocal:e=>O(void 0,void 0,void 0,function*(){return yield(0,B.D)(e.patcherStructure,e.actions),{success:!0}})};var D=n(8095),G=n(4711),P=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const F={GetConnectionById:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionById)(e.id)}}),GetConnectionBulk:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionBulk)(e.connectionIds)}}),GetConnectionOfTheConcept:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionOfTheConcept)(e.typeId,e.ofTheConceptId,e.userId,e.inpage,e.page)}}),GetAllConnectionsOfCompositionBulk:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetAllConnectionsOfCompositionBulk)(e.composition_ids)}}),GetConnectionBetweenTwoConceptsLinker:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionBetweenTwoConceptsLinker)(e.ofTheConcept,e.toTheConcept,e.linker,e.fullLinker,e.forward)}}),CreateConnectionBetweenTwoConcepts:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateConnectionBetweenTwoConcepts)(e.ofTheConcept,e.toTheConcept,e.linker,e.both)}}),CreateConnectionBetweenTwoConceptsLocal:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,D.h)(e.ofTheConcept,e.toTheConcept,e.linker,e.both,e.actions),actions:e.actions}}),CreateTheConnectionLocal:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateTheConnectionLocal)(e.ofTheConceptId,e.toTheConceptId,e.typeId,e.orderId,e.typeString,e.userId,e.actions),actions:e.actions}}),CreateConnection:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,G.d)(e.ofTheConcept,e.toTheConcept,e.connectionTypeString,e.actions),actions:e.actions}}),CreateConnectionBetweenEntityLocal:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateConnectionBetweenEntityLocal)(e.concept1Data,e.concept2Data,e.linker,e.actions),actions:e.actions}})};var U=n(4818),M=n(2289),W=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const j={DeleteConceptById:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConceptById)(e.id)}}),DeleteConnectionById:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConnectionById)(e.id)}}),DeleteUser:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteUser)(e.id)}}),DeleteConnectionByType:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConnectionByType)(e.id,e.linker)}}),DeleteConnectionByTypeBulk:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,M.L0)(e.id,e.linkers)}}),DeleteConnectionByIdBulk:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,U.E)(e.ids)}}),DeleteConceptLocal:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConceptLocal)(e.id)}})};var V=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const $={SyncData__SyncDataOnline:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.SyncData.SyncDataOnline()}}),LocalSyncData__SyncDataOnline:e=>V(void 0,void 0,void 0,function*(){return console.log("This is the transaction inside syncing",e),{success:!0,data:yield o.LocalSyncData.SyncDataOnline(e.transactionId,void 0,e.withAuth)}}),LocalSyncData__initializeTransaction:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.LocalSyncData.initializeTransaction(e.transactionId)}}),LocalSyncData__markTransactionActions:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.LocalSyncData.markTransactionActions(e.transactionId,e.actions),actions:e.actions}}),LocalSyncData__rollbackTransaction:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.LocalSyncData.rollbackTransaction(e.transactionId,e.actions),actions:e.actions}})};var H=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};let q=!1,z=new Map,J=!1,Q=[];const Y=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({checkProcess:e=>H(void 0,void 0,void 0,function*(){return(null==e?void 0:e.checkMessageId)&&Q.includes(null==e?void 0:e.checkMessageId)?{success:!0,data:{processing:!0},name:"init"}:{success:!0,data:{processing:!1},name:"init"}}),init:e=>H(void 0,void 0,void 0,function*(){return q?(console.warn("Already Initialized"),{success:!0,name:"init"}):(console.log("init has started"),q=!0,console.log("init has set value"),console.log("Payload log in service worker : ",e),yield function(){return H(this,arguments,void 0,function*(e="",t="",n="",i="",u=!0,h="",p,f){var v,y;o.BaseUrl.BASE_URL=e,o.BaseUrl.AI_URL=t,o.BaseUrl.NODE_URL=i,o.BaseUrl.BASE_APPLICATION=h,n&&(s.b.BearerAccessToken=n);let g=Math.floor(1e8*Math.random());if(console.log("Flags came in init of service worker is ",p),o.BaseUrl.setRandomizer(g),o.BaseUrl.FLAGS=p,null===(v=o.BaseUrl.FLAGS)||void 0===v?void 0:v.isTest)return r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0,r.B.isLocalDataLoaded=!0,r.B.isLocalTypeLoaded=!0,r.B.isLocalCharacterLoaded=!0,r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0,r.B.isLocalConnectionLoaded=!0,!0;o.BaseUrl.ACCESS_CONTROL_BASE_URL=null!=f?f:"",console.log("This is the base url",o.BaseUrl.BASE_URL,g),console.log("service worker BaseUrl.FLAGS is ",o.BaseUrl.FLAGS),(null===(y=o.BaseUrl.FLAGS)||void 0===y?void 0:y.accessTracker)&&(console.log("From service worker, flag of Access Tracker."),o.AccessTracker.activateStatus=!0,console.log("Access Tracker Activation status from service worker",o.AccessTracker.activateStatus)),yield(0,l.A)();const m=(new Date).getTime();yield(0,c.A)().then(()=>{let e=(new Date).getTime()-m;console.log("The time taken to prepare concept data is ",e)}).catch(e=>{throw e}),yield(0,d.Ay)().then(()=>{let e=(new Date).getTime()-m;console.log("The time taken to prepare local concept ",e)}).catch(e=>{throw e}),yield(0,a.p)().then(()=>{r.B.isLocalConnectionLoaded=!0}).catch(e=>{throw e}),yield(0,d.xd)(),yield(0,a.a)().then(()=>{r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0;let e=(new Date).getTime()-m;console.log("The time taken to prepare connections ",e)}).catch(e=>{throw e})})}(null==e?void 0:e.url,null==e?void 0:e.aiurl,null==e?void 0:e.accessToken,null==e?void 0:e.nodeUrl,null==e?void 0:e.enableAi,null==e?void 0:e.applicationName,null==e?void 0:e.flags,null==e?void 0:e.accessControlUrl),console.log("init has completed"),{success:!0,data:void 0,name:"init"})}),updateAccessToken:e=>H(void 0,void 0,void 0,function*(){return yield(0,o.updateAccessToken)(e.accessToken,e.session),{success:!0,name:"updateAccessToken"}}),SESSION_DATA:e=>H(void 0,void 0,void 0,function*(){return console.log("this is the payload",e),o.BaseUrl.NODE_CACHE_URL=e.data,s.b.setSession(e.session),{success:!0,name:"SESSION_DATA"}})},I),S),x),R),F),j),$),X=()=>!!q||(i.x.postMessage({type:"checkInit",payload:{}}),!1);var Z=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};self.addEventListener("install",e=>{console.log("Service Worker installing... sw"),e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>Z(void 0,void 0,void 0,function*(){yield(0,o.setHasActivatedSW)(!0),console.log("Service Worker activating... sw"),e.waitUntil(new Promise((e,t)=>{try{self.clients.claim(),console.log("claimed"),X(),e(void 0)}catch(e){console.error("Error during service worker activation:",e),t(e)}}))})),self.addEventListener("fetch",e=>{e.clientId||e.respondWith(K(e))}),self.addEventListener("message",e=>{!function(e){H(this,void 0,void 0,function*(){var t,n;let i={success:!1,data:void 0};const{type:r,payload:s}=e.data,c=s.TABID;let a=!1;try{if(!r||!s.TABID)return;Q.push(s.messageId),"init"==r||X()||(console.warn("Message received before sw initialization",r,s.messageId),yield new Promise(e=>{console.log("is it stuck here???? type",r,s.messageId);const t=setInterval(()=>{console.log("Interval check 0",q,r,s.messageId),q?(console.log("Interval check 2",q,r,s.messageId),console.log(n,t),clearInterval(t),clearTimeout(n),e(void 0)):console.warn("Watring for init 1:",r)},200),n=setTimeout(()=>{console.warn("Tried waiting for init but couldn't complete in time: ",r,s.messageId),clearInterval(t),e(void 0)},9e4)}),console.log("After timeout promise",r,s.messageId,q),q||(console.log("wait failed",q,s.messageId,r),Q=yield Promise.all(Q.filter(e=>e!=s.messageId)),e.source.postMessage(i)),console.log("After timeout promise nice",r,q)),z.has(c)||z.set(c,{concepts:[],connections:[]});let l=z.get(c);if(Array.isArray(null===(t=null==s?void 0:s.actions)||void 0===t?void 0:t.concepts)&&Array.isArray(null===(n=null==s?void 0:s.actions)||void 0===n?void 0:n.connections)||(s.actions={concepts:[],connections:[]},a=!0),"LocalSyncData__SyncDataOnline"==r&&!s.transactionId&&l){console.log("this is the tab syncing for data",s);const e=o.LocalSyncData.SyncDataOnline(void 0,JSON.parse(JSON.stringify(l)),s.withAuth);z.delete(c),l=void 0,console.log("Syncing the tab here",r),i={success:!0,data:yield e,actions:{concepts:[],connections:[]}}}else Y[r]?i=yield Y[r](s):console.warn(`Unable to handle "${r}" case in service worker`);if(i.messageId=s.messageId,J&&console.warn("Race condition has been met",r),J=!0,l=z.get(c),i.actions&&l){let e={concepts:[...l.concepts,...i.actions.concepts],connections:[...l.connections,...i.actions.connections]};const[t,n]=yield Promise.all([Promise.all(Array.from(new Map(e.concepts.map(e=>[`${e.id}-${e.ghostId}`,e])).values())),Promise.all(Array.from(new Map(e.connections.map(e=>[`${e.id}-${e.ghostId}`,e])).values()))]);z.set(c,JSON.parse(JSON.stringify({concepts:t,connections:n})))}J=!1,a&&delete i.actions,Q=yield Promise.all(Q.filter(e=>e!=s.messageId)),e.source.postMessage(i)}catch(t){console.error("Service worker Message Handle Error: ",r,t),401!=(null==t?void 0:t.status)&&500!=(null==t?void 0:t.status)||(i={success:!1,data:{status:t.status,statusText:null==t?void 0:t.url},messageId:s.messageId}),Q=yield Promise.all(Q.filter(e=>e!=s.messageId)),e.source.postMessage(i)}})}(e)});const K=e=>Z(void 0,void 0,void 0,function*(){try{const t=yield fetch(e.request);if(401===t.status){const n=Math.random().toString(36).substring(2);return e.waitUntil(e.source.postMessage({type:"API_401",messageId:n,message:"Unauthorized",payload:{method:e.request.method,url:e.request.url,headers:Array.from(e.request.headers.entries()),body:yield e.request.clone().json()}})),yield new Promise(e=>{console.log("Re resolving 401",t.url),setTimeout(()=>e(t),6e4),navigator.serviceWorker.addEventListener("message",o=>{var i,r,s;o.data&&(null===(i=o.data)||void 0===i?void 0:i.messageId)==n&&"API_RESPONSE"===(null===(r=o.data)||void 0===r?void 0:r.type)&&((null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.response)?e(o.data.response):(console.log("Unable to resolve re 401",t.url),e(t)))})})}return t}catch(e){throw console.error("Error occured during 401 intercepting",e),e}});
2
+ var e={2:(e,t,n)=>{n.d(t,{s:()=>d});var o=n(8286),i=n(9581),r=n(1412),s=n(3518),c=n(1863),a=n(9311),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=a.Logger.logfunction("GetAllConnectionsOfComposition",t);var i=[];if(0==(i=yield o.d.GetConnectionsOfConcept(e)).length)i=yield u(e);else{var s=yield u(e);(0,r.e)(s,i),i=s}return a.Logger.logUpdate(n),i})}function u(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=a.Logger.logfunction("GetAllConnectionsOfCompositionOnline",t);var r=[];try{const t=new FormData;t.append("composition_id",e.toString());const d=yield(0,s.Xr)("","application/json"),u=yield fetch(i.B.GetAllConnectionsOfCompositionUrl(),{method:"POST",headers:d,body:t});if(console.log("this is getting connection from online",i.B.GetAllConnectionsOfCompositionUrl(),e),!u.ok)throw(0,c.ry)(u),new Error(`Error! status: ${u.status}`);const h=yield u.json();for(var l=0;l<h.length;l++)o.d.AddConnection(h[l]),r.push(h[l]);return a.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connection of composition error : ",e.message):console.log("Get all connection of composition error : ",e),(0,c.Mb)(e,i.B.GetAllConnectionsOfCompositionUrl()),(0,c.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}})}},38:e=>{class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},71:(e,t)=>{t.__esModule=!0,t.word=t.tilde=t.tab=t.str=t.space=t.slash=t.singleQuote=t.semicolon=t.plus=t.pipe=t.openSquare=t.openParenthesis=t.newline=t.greaterThan=t.feed=t.equals=t.doubleQuote=t.dollar=t.cr=t.comment=t.comma=t.combinator=t.colon=t.closeSquare=t.closeParenthesis=t.caret=t.bang=t.backslash=t.at=t.asterisk=t.ampersand=void 0,t.ampersand=38,t.asterisk=42,t.at=64,t.comma=44,t.colon=58,t.semicolon=59,t.openParenthesis=40,t.closeParenthesis=41,t.openSquare=91,t.closeSquare=93,t.dollar=36,t.tilde=126,t.caret=94,t.plus=43,t.equals=61,t.pipe=124,t.greaterThan=62,t.space=32,t.singleQuote=39,t.doubleQuote=34,t.slash=47,t.bang=33,t.backslash=92,t.cr=13,t.feed=12,t.newline=10,t.tab=9,t.str=39,t.comment=-1,t.word=-2,t.combinator=-3},145:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s},176:(e,t,n)=>{n.d(t,{F4:()=>s,P6:()=>a,dp:()=>c});var o=n(2155),i=n(7282),r=n(6416);function s(e){var t,n;const o=(0,r.u)();return o.id=e.id,o.ghostId=e.ghostId,o.userId=e.userId,o.accessId=e.accessId,o.categoryId=e.categoryId,o.characterValue=e.characterValue,o.entryTimeStamp=e.entryTimeStamp,o.typeId=e.typeId,o.type=e.type,o.isTemp=!1,o.typeCharacter=null!==(n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"",o}function c(e){const t=(0,i.o)();return t.id=e.id,t.ghostId=e.ghostId,t.userId=e.userId,t.accessId=e.accessId,t.entryTimeStamp=e.entryTimeStamp,t.typeId=e.typeId,t.categoryId=e.categoryId,t}function a(e){const t=new o.N(0,0,0,0,0,0,0);return t.id=e.id,t.ghostId=e.ghostId,t.accessId=e.accessId,t.ofTheConceptId=e.ofTheConceptId,t.toTheConceptId=e.toTheConceptId,t.entryTimeStamp=e.entryTimeStamp,t.typeId=e.typeId,t.isTemp=!1,t}},197:()=>{},205:(e,t,n)=>{n.d(t,{B:()=>o});class o{}o.isTypeLoaded=!1,o.isCharacterLoaded=!1,o.isDataLoaded=!1,o.isLocalDataLoaded=!1,o.isLocalCharacterLoaded=!1,o.isLocalTypeLoaded=!1,o.isConnectionLoaded=!1,o.isConnectionTypeLoaded=!1,o.isLocalConnectionLoaded=!1},263:(e,t)=>{t.__esModule=!0,t.default=function(e){return e.sort(function(e,t){return e-t})},e.exports=t.default},276:(e,t,n)=>{n.d(t,{y:()=>o});class o{constructor(){this.conceptId=0,this.connectionTypeId=0,this.connectionType="",this.count=0}}},339:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.SELECTOR,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},396:(e,t,n)=>{let o=n(7793);class i extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=i,i.default=i,o.registerAtRule(i)},425:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.COMMENT,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},442:(e,t,n)=>{n.d(t,{Y:()=>u});var o=n(1167),i=n(2155),r=n(9581),s=n(3518),c=n(1863),a=n(3026),l=n(8286),d=n(9311);class u{static CheckContains(e){for(var t=!1,n=0;n<this.conceptsSyncArray.length;n++)this.conceptsSyncArray[n].id==e.id&&(t=!0);return t}static SyncDataDelete(e){for(var t=0;t<this.conceptsSyncArray.length;t++)e==this.conceptsSyncArray[t].id&&this.conceptsSyncArray.splice(t,1);for(t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].ofTheConceptId!=e&&this.connectionSyncArray[t].toTheConceptId!=e&&this.connectionSyncArray[t].typeId!=e||this.connectionSyncArray.splice(t,1)}static CheckContainsConnection(e){for(var t=!1,n=0;n<this.connectionSyncArray.length;n++)this.connectionSyncArray[n].id==e.id&&(t=!0);return t}static AddConcept(e){this.conceptsSyncArray.push(e)}static RemoveConcept(e){for(var t=0;t<this.conceptsSyncArray.length;t++)this.conceptsSyncArray[t].id==e.id&&this.conceptsSyncArray.splice(t,1)}static AddConnection(e){this.connectionSyncArray.push(e)}static RemoveConnection(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e.id&&this.connectionSyncArray.splice(t,1)}static SyncDataOnline(){return e=this,t=void 0,u=function*(){if(d.serviceWorker)try{return(yield(0,d.sendMessage)("SyncData__SyncDataOnline",{})).data}catch(e){console.error("SyncData__SyncDataOnline sw error: ",e),(0,d.handleServiceWorkerException)(e)}for(let e=0;e<this.conceptsSyncArray.length;e++)a.I.AddConcept(this.conceptsSyncArray[e]);for(let e=0;e<this.connectionSyncArray.length;e++)l.d.AddConnection(this.connectionSyncArray[e]);if(this.conceptsSyncArray.length>0){let e=this.conceptsSyncArray.slice();this.conceptsSyncArray=[],(0,o.Y)(e)}if(this.connectionSyncArray.length>0){let e=this.connectionSyncArray.slice();this.connectionSyncArray=[],yield function(e){return t=this,n=void 0,a=function*(){let t=new i.N(0,0,0,0,0,0,0);try{var n=(0,s.Xr)(),o=JSON.stringify(e);const i=yield fetch(r.B.CreateTheConnectionUrl(),{method:"POST",headers:n,body:o});return i.ok?yield i.json():(console.log("Create the connection error message: ",i.status),(0,c.ry)(i)),t}catch(e){throw e instanceof Error?console.log("Create the connection error message: ",e.message):console.log(" Create the connection unexpected error: ",e),e}},new((o=void 0)||(o=Promise))(function(e,i){function r(e){try{c(a.next(e))}catch(e){i(e)}}function s(e){try{c(a.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(r,s)}c((a=a.apply(t,n||[])).next())});var t,n,o,a}(e)}return"done"},new((n=void 0)||(n=Promise))(function(o,i){function r(e){try{c(u.next(e))}catch(e){i(e)}}function s(e){try{c(u.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,s)}c((u=u.apply(e,t||[])).next())});var e,t,n,u}}u.conceptsSyncArray=[],u.connectionSyncArray=[]},490:(e,t,n)=>{function o(){var e,t,n,o;let i={entity:0,userConcept:0,userId:0,token:""};try{let r=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";if(r){const s=JSON.parse(r);i.entity=null!==(e=null==s?void 0:s.entityId)&&void 0!==e?e:0,i.userConcept=null!==(t=null==s?void 0:s.userConcept)&&void 0!==t?t:0,i.userId=null!==(n=null==s?void 0:s.userId)&&void 0!==n?n:0,i.token=null!==(o=null==s?void 0:s.token)&&void 0!==o?o:""}}catch(e){console.log("This is the exception in getting user details from local storage")}return i}n.d(t,{s:()=>o})},518:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.ROOT,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n);var i,a,l=o.prototype;return l.toString=function(){var e=this.reduce(function(e,t){return e.push(String(t)),e},[]).join(",");return this.trailingComma?e+",":e},l.error=function(e,t){return this._error?this._error(e,t):new Error(e)},i=o,(a=[{key:"errorGenerator",set:function(e){this._error=e}}])&&s(i.prototype,a),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=a,e.exports=t.default},628:(e,t,n)=>{n.d(t,{H:()=>v});var o=n(9581),i=n(3278),r=n(9311),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const a=(e,t,...n)=>c(void 0,[e,t,...n],void 0,function*(e,t,n=!0){let r={concepts:[],connections:[]};try{const c=new Headers;let a={concepts:e,connections:t};c.set("Content-Type","application/json"),c.set("Authorization","Bearer "+i.b.BearerAccessToken),c.set("Accept","application/json"),c.set("X-Session-Id",i.b.sessionId.toString()),c.set("Randomizer",o.B.getRandomizer().toString());const l=yield fetch(o.B.CreateGhostConceptApiUrl(n),{method:"POST",headers:c,body:JSON.stringify(a)});if(!l.ok)throw(0,s.ry)(l),new Error(`Error! status: ${l.status}`);const d=yield l.json();return r.concepts=d.concepts,r.connections=d.connections,r}catch(e){throw e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),e}});function l(e,t){const n=[];for(let o=0;o<e.length;o+=t){const i=e.slice(o,o+t);n.push(i)}return n}const d=(...e)=>c(void 0,[...e],void 0,function*(e=[]){return yield Promise.all(e.map(e=>{let t=JSON.parse(JSON.stringify(e));return delete t.type,delete t.ofConcept,delete t.toConcept,t}))});var u=n(9003),h=n(9736),p=n(4864),f=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class v{static CheckContains(e){for(var t=!1,n=0;n<this.conceptsSyncArray.length;n++)this.conceptsSyncArray[n].id==e.id&&(t=!0);return t}static SyncDataDelete(e){for(var t=0;t<this.conceptsSyncArray.length;t++)e==this.conceptsSyncArray[t].id&&this.conceptsSyncArray.splice(t,1);for(t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].ofTheConceptId!=e&&this.connectionSyncArray[t].toTheConceptId!=e&&this.connectionSyncArray[t].typeId!=e||this.connectionSyncArray.splice(t,1)}static CheckContainsConnection(e){for(var t=!1,n=0;n<this.connectionSyncArray.length;n++)this.connectionSyncArray[n].id==e.id&&(t=!0);return t}static AddConcept(e){try{let t=!1;0!=v.CheckIfTheConceptIdExists(e.id,this.conceptsSyncArray).id&&(t=!0),t||this.conceptsSyncArray.push(e)}catch(e){throw e}}static RemoveConcept(e){for(var t=0;t<this.conceptsSyncArray.length;t++)this.conceptsSyncArray[t].id==e.id&&this.conceptsSyncArray.splice(t,1)}static SyncDataOnlineWithoutAuth(e,t){return f(this,arguments,void 0,function*(e,t,n=!1){return v.SyncDataOnline(e,t,n)})}static SyncDataOnline(e,t){return f(this,arguments,void 0,function*(e,t,n=!0){let o=performance.now();console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker,n),setTimeout(()=>{console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker,n)},5e3);try{if(r.serviceWorker)try{return console.log("syncing in the service worker",e,n),(yield(0,r.sendMessage)("LocalSyncData__SyncDataOnline",{transactionId:e,withAuth:n})).data}catch(e){console.error("LocalSyncData__SyncDataOnline sw error: ",e),(0,r.handleServiceWorkerException)(e)}console.log("syncing in the without service worker syncing",e,n);let o=[],i=[];if(e&&this.transactionCollections.some(t=>t.id==e)){const t=this.transactionCollections.find(t=>t.id==e);if(this.transactionCollections=this.transactionCollections.filter(t=>t.id!=e),this.transactionCollections=this.transactionCollections.filter(e=>new Date(e.createdDate).getTime()>(new Date).getTime()-6048e5),!t)return;o=t.data.concepts.slice(),i=t.data.connections.slice()}else Array.isArray(null==t?void 0:t.concepts)&&Array.isArray(null==t?void 0:t.connections)?(console.log("this is the concepts and connections array",null==t?void 0:t.concepts,null==t?void 0:t.connections),o=t.concepts.slice(),i=t.connections.slice(),console.log("this is the concepts and connections array",o,i),this.conceptsSyncArray=this.conceptsSyncArray.filter(e=>{const n=t.concepts.some(t=>e.id==t.id||e.ghostId==t.ghostId);return n||console.warn(`Concept not found in sync array: ${e.id||e.ghostId}`),n}),this.connectionSyncArray=this.connectionSyncArray.filter(e=>{const n=t.connections.some(t=>e.id==t.id||e.ghostId==t.ghostId);return n||console.warn(`Connection not found in sync array: ${e.id||e.ghostId}`),n})):(console.warn("Syncing this way has been Depreceted in service worker."),console.info("Only if serive worker is not running"),o=this.conceptsSyncArray.slice()||[],i=this.connectionSyncArray.slice()||[],this.connectionSyncArray=[],this.conceptsSyncArray=[]);console.log("syncing... inside the syncer",n);let u=[];for(let e=0;e<o.length;e++)u.push(o[e]),yield h.v.UpdateConceptSyncStatus(o[e].id);console.log("syncing... inside the syncer 2",n,o),yield this.UpdateConceptListToIncludeRelatedConcepts(i,u);let f=yield function(e,t){return c(this,arguments,void 0,function*(e,t,n=!0){const o=r.Logger.logfunction("CreateTheGhostConceptApi",[e.length,t.length]);try{const i=1e3;let s={concepts:[],connections:[]};const c=yield d(e),u=yield d(t);if(e.length+t.length<=2*i){const e=yield a(c,u,n);return Array.isArray(null==e?void 0:e.concepts)&&(s.concepts=[...s.concepts,...e.concepts]),Array.isArray(null==e?void 0:e.connections)&&(s.connections=[...s.connections,...e.connections]),r.Logger.logUpdate(o),s}const h=l(c,i),p=l(u,i),f=[],v=[];console.log("This is the with auth in syncing",n);for(let e=0;e<h.length;e++){const t=h[e];f.push(a(t,[],n))}const y=yield Promise.all(f);for(let e=0;e<y.length;e++){const t=y[e];Array.isArray(null==t?void 0:t.concepts)&&(s.concepts=[...s.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(s.connections=[...s.connections,...t.connections])}for(let e=0;e<p.length;e++){const t=p[e];v.push(a([],t,n))}const g=yield Promise.all(v);for(let e=0;e<g.length;e++){const t=g[e];Array.isArray(null==t?void 0:t.concepts)&&(s.concepts=[...s.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(s.connections=[...s.connections,...t.connections])}return r.Logger.logUpdate(o),s}catch(e){throw console.log(e),(0,s.ey)(o,"CreateTheGhostConceptApi",e),e}})}(u,i,n);console.log("syncing... inside the syncer 3",n);let v=f.concepts,y=f.connections;for(let e=0;e<v.length;e++)h.v.AddPermanentConcept(v[e]);for(let e=0;e<y.length;e++)p.G.AddPermanentConnection(y[e]);return o}catch(e){throw r.Logger.logError(o,"unknown",void 0,"unknown",void 0,500,e,"SyncDataOnline",[],"unknown",void 0),e}})}static ConvertGhostIdsInConnections(e){var t,n,o;for(let i=0;i<e.length;i++){let r=e[i].ofTheConceptId,s=e[i].toTheConceptId,c=e[i].typeId,a=null!==(t=v.ghostIdMap.get(r))&&void 0!==t?t:r,l=null!==(n=v.ghostIdMap.get(s))&&void 0!==n?n:s,d=null!==(o=v.ghostIdMap.get(c))&&void 0!==o?o:c;e[i].ofTheConceptId=a,e[i].toTheConceptId=l,e[i].typeId=d}}static UpdateConceptListToIncludeRelatedConcepts(e,t){return f(this,void 0,void 0,function*(){for(let n=0;n<e.length;n++){let o=e[n].ofTheConceptId,i=e[n].toTheConceptId,r=e[n].typeId;if(o<0){let i=this.CheckIfTheConceptIdExists(o,t);0==i.id&&(i=yield h.v.GetConceptByGhostId(o),0!=i.id?i.id!=i.ghostId&&(e[n].ofTheConceptId=i.id):(i=yield h.v.GetConcept(o),this.AddConceptIfDoesNotExist(i,t)))}if(i<0){let o=this.CheckIfTheConceptIdExists(i,t);0==o.id&&(o=yield h.v.GetConceptByGhostId(i),0!=o.id?o.id!=o.ghostId&&(e[n].toTheConceptId=o.id):(o=yield h.v.GetConcept(i),this.AddConceptIfDoesNotExist(o,t)))}if(r<0){let o=this.CheckIfTheConceptIdExists(r,t);0==o.id&&(o=yield h.v.GetConceptByGhostId(r),0!=o.id?o.id!=o.ghostId&&(e[n].typeId=o.id):(o=yield h.v.GetConcept(r),this.AddConceptIfDoesNotExist(o,t)))}}})}static AddConceptIfDoesNotExist(e,t=[]){let n=!1;for(let o=0;o<t.length;o++)e.ghostId==t[o].ghostId&&(n=!0);n||t.push(e)}static CheckIfTheConceptIdExists(e,t=[]){let n=(0,r.CreateDefaultLConcept)();for(let o=0;o<t.length;o++)e!=t[o].ghostId&&e!=t[o].id||(n=t[o]);return n}static AddConnection(e){this.connectionSyncArray.push(e)}static RemoveConnection(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e.id&&this.connectionSyncArray.splice(t,1)}static RemoveConnectionById(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e&&this.connectionSyncArray.splice(t,1)}static syncDataLocalDb(){return f(this,void 0,void 0,function*(){if(this.conceptsSyncArray.length>0){for(let e=0;e<this.conceptsSyncArray.length;e++)(0,u.kH)("localconcept",this.conceptsSyncArray[e]);this.conceptsSyncArray=[]}if(this.connectionSyncArray.length>0){for(let e=0;e<this.connectionSyncArray.length;e++)(0,u.kH)("localconnection",this.connectionSyncArray[e]);this.connectionSyncArray=[]}return"done"})}static initializeTransaction(e){return f(this,void 0,void 0,function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__initializeTransaction",{transactionId:e})).data}catch(e){console.error("LocalSyncData__initializeTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some(t=>t.id==e))return;this.transactionCollections.push({id:e,data:{concepts:[],connections:[]},createdDate:(new Date).toISOString()})}catch(e){console.log("error in initializeTransaction",e)}})}static markTransactionActions(e,t){return f(this,void 0,void 0,function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__markTransactionActions",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__markTransactionActions sw error: ",e),(0,r.handleServiceWorkerException)(e)}this.transactionCollections=this.transactionCollections.map(n=>n.id==e?Object.assign(Object.assign({},n),{data:JSON.parse(JSON.stringify(t))}):n),this.conceptsSyncArray=this.conceptsSyncArray.filter(e=>!t.concepts.some(t=>t.id==e.id||t.ghostId==e.id)),this.connectionSyncArray=this.connectionSyncArray.filter(e=>!t.connections.some(t=>t.id==e.id||t.ghostId==e.id))}catch(e){console.log("error in markTransactionActions",e)}})}static rollbackTransaction(e,t){return f(this,void 0,void 0,function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__rollbackTransaction",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__rollbackTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some(t=>t.id==e))return;this.transactionCollections=this.transactionCollections.filter(t=>t.id!=e)}catch(e){console.log("LocalSyncData, roll",e)}})}}v.conceptsSyncArray=[],v.connectionSyncArray=[],v.ghostIdMap=new Map,v.transactionCollections=[]},680:(e,t,n)=>{t.__esModule=!0;var o=n(1581);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||(t[e]=o[e]))});var i=n(4451);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||(t[e]=i[e]))});var r=n(8500);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||(t[e]=r[e]))})},843:(e,t,n)=>{n.d(t,{Az:()=>p,Hi:()=>f});var o=n(8146),i=n(3026),r=n(9581),s=n(3518),c=n(9311),a=n(1863),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function p(e){return h(this,void 0,void 0,function*(){const t=c.Logger.logfunction("GetConceptByCharacterAndCategory",e);let n=(0,c.CreateDefaultConcept)();if("the"==e)return n.id=1,n.typeId=5,n.characterValue="the",n;let u=(0,c.SplitStrings)(e);if(u.length>1){let t=1,o=yield p(u[0]);0!=o.id&&(t=o.id),n=yield function(e,t){var n=arguments;return h(this,void 0,void 0,function*(){const o=c.Logger.logfunction("GetConceptByCharacterAndCategoryFromMemory",n);let u=yield c.ConceptsData.GetConceptByCharacterAndCategoryLocal(e,t);return 0==u.id&&(u=yield function(e,t){var n=arguments;return d(this,void 0,void 0,function*(){const o=c.Logger.logfunction("GetConceptByCharacterAndCategoryDirectApi",n);let d=(0,c.CreateDefaultConcept)();try{var u=(0,s.Xr)("application/x-www-form-urlencoded");const n=yield fetch(r.B.GetConceptByCharacterAndCategoryDirectUrl(),{method:"POST",headers:u,body:`character_value=${e}&category_id=${t}`});if(n.ok){let e=yield n.json();d=e,(0,l.K)(d).then(()=>{i.I.AddConcept(d)})}else console.log("This is the concept by category and character error",n.status),(0,a.ry)(n);c.Logger.logUpdate(o)}catch(e){e instanceof Error?console.log(" This is the concept by category and character error message: ",e.message):console.log(" This is the concept by category and character unexpected error: ",e),(0,a.Mb)(e,r.B.GetConceptByCharacterAndCategoryDirectUrl()),(0,a.ey)(o,"GetConceptByCharacterAndCategoryDirectApi",e)}return d})}(e,t)),c.Logger.logUpdate(o),u})}(e,t)}else u[0]==e&&(n=yield function(e){var t=arguments;return h(this,void 0,void 0,function*(){const n=c.Logger.logfunction("GetConceptByCharacter",t);let i=yield c.ConceptsData.GetConceptByCharacterAndTypeLocal(e,51);return 0==i.id&&(i=yield(0,o.Y)(e)),c.Logger.logUpdate(n),i})}(e));return c.Logger.logUpdate(t),n})}function f(e){return h(this,void 0,void 0,function*(){let t=[];try{t=yield function(e){return u(this,void 0,void 0,function*(){let t=[];try{let n=JSON.stringify(e),o=(0,s.Xr)();const i=yield fetch(c.BaseUrl.GetTypeConceptBulk(),{method:"POST",headers:o,body:n});if(i.ok){let e=yield i.json();t=yield(0,c.GetConceptBulk)(e)}else console.log("This is the GetTypeConceptByBulk error",i.status),(0,a.ry)(i)}catch(e){e instanceof Error?console.log(" This is the GetTypeConceptByBulk error message: ",e.message):console.log(" This is the GetTypeConceptByBulk unexpected error: ",e),(0,a.Mb)(e,c.BaseUrl.GetConceptByCharacterAndCategoryDirectUrl())}return t})}(e)}catch(e){console.log(" This is the GetTypeConceptsByCharacterAndCategoryBulk error message: ",e)}return t})}},991:(e,t,n)=>{n.d(t,{H:()=>c});var o=n(9311),i=n(3996);class r extends i.i{constructor(e,t,n,o){super(e,t,n,o),this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(this.getBalanceFactor(t.leftNode)>=0)return this.rightRotate(t);if(this.getBalanceFactor(t.leftNode)<0)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(this.getBalanceFactor(t.rightNode)<=0)return this.leftRotate(t);if(this.getBalanceFactor(t.rightNode)>0)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}}var s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class c{static CreateCompositionKey(e,t){return e}static GetConnectionByOfTheConceptAndTypeId(e,t){let n=this.CreateCompositionKey(e,t);if(this.node){let e=this.node.getFromNode(n,this.node);if(e)return e.value}return null}static addConnection(e){if(e.id>0){let t=this.CreateCompositionKey(e.ofTheConceptId,e.typeId);if(this.node){let n=this.node.getFromNode(t,this.node);if(n){let t=null==n?void 0:n.value;0==t.length&&(n.value=[]),t.includes(e.id)||t.push(e.id)}else{let n=[];n.push(e.id);let o=new r(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new r(t,n,null,null);this.addNodeToTree(o)}new Event(`${t}`)}else console.log("cannot insert key id with n 0 to the connection tree",e)}static addNodeToTree(e){return s(this,void 0,void 0,function*(){return null==this.node?(this.node=e,console.log("this is type dispatch in connection",e),(0,o.dispatchIdEvent)(e.key),this.node):(this.node=this.node.addNode(e,this.node,this.node.height),this.node)})}static removeNodeFromTree(e){return s(this,void 0,void 0,function*(){this.node&&(this.node=this.node.removeNode(this.node,e))})}}c.node=null},999:(e,t,n)=>{n.d(t,{R:()=>l});var o=n(9311),i=n(1863),r=n(6416),s=n(4711),c=n(5868),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e){return a(this,arguments,void 0,function*(e,t=null,n=null,a=null,d=null,u=null,h=null,p=!1,f={concepts:[],connections:[]}){var v,y,g,m;const C=o.Logger.logfunction("CreateTheCompositionLocal")||{};if(o.serviceWorker){C.serviceWorker=!0;try{const i=yield(0,o.sendMessage)("CreateTheCompositionLocal",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:a,userId:d,accessId:u,sessionInformationId:h,actions:f});return(null===(y=null===(v=null==i?void 0:i.actions)||void 0===v?void 0:v.concepts)||void 0===y?void 0:y.length)&&(f.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(m=null===(g=null==i?void 0:i.actions)||void 0===g?void 0:g.connections)||void 0===m?void 0:m.length)&&(f.connections=JSON.parse(JSON.stringify(i.actions.connections))),o.Logger.logUpdate(C),i.data}catch(e){console.error("CreateTheCompositionLocal error sw: ",e),(0,i.ey)(C,"CreateTheCompositionLocal",e),(0,o.handleServiceWorkerException)(e)}}let w=null!=d?d:999,I=null!=u?u:999,T=null!=h?h:999,k=null!=a?a:0,A=(0,r.u)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=k,n=yield(0,c.k)(o,"",!0,w,I,T,void 0,f);A=n,t=n.id,k=n.id,yield l(e[o],n.id,n.userId,t,d,u,h,void 0,f)}else{let n=null!=t?t:999,i=k,r=yield(0,c.k)(o,"",!0,w,I,T,void 0,f);yield(0,s.F)(n,r.id,i,void 0,void 0,void 0,f),yield l(e[o],r.id,r.userId,i,d,u,h,void 0,f)}else{let n=null!=t?t:999,i=k,r=yield(0,c.k)(o,e[o].toString(),!1,w,I,T,void 0,f);yield(0,s.F)(n,r.id,i,void 0,void 0,void 0,f)}return o.Logger.logUpdate(C),A})}},1106:(e,t,n)=>{let{nanoid:o}=n(5042),{isAbsolute:i,resolve:r}=n(197),{SourceMapConsumer:s,SourceMapGenerator:c}=n(1866),{fileURLToPath:a,pathToFileURL:l}=n(2739),d=n(3614),u=n(3878),h=n(9746),p=Symbol("lineToIndexCache"),f=Boolean(s&&c),v=Boolean(r&&i);function y(e){if(e[p])return e[p];let t=e.css.split("\n"),n=new Array(t.length),o=0;for(let e=0,i=t.length;e<i;e++)n[e]=o,o+=t[e].length+1;return e[p]=n,n}class g{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!v||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=r(t.from)),v&&f){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let i,r,s,c,a;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){c=e.offset;let o=this.fromOffset(c);t=o.line,n=o.col}else t=e.line,n=e.column,c=this.fromLineAndColumn(t,n);if("number"==typeof o.offset){s=o.offset;let e=this.fromOffset(s);r=e.line,i=e.col}else r=o.line,i=o.column,s=this.fromLineAndColumn(o.line,o.column)}else if(n)c=this.fromLineAndColumn(t,n);else{c=t;let e=this.fromOffset(c);t=e.line,n=e.col}let u=this.origin(t,n,r,i);return a=u?new d(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,o.plugin):new d(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,o.plugin),a.input={column:n,endColumn:i,endLine:r,endOffset:s,line:t,offset:c,source:this.css},this.file&&(l&&(a.input.url=l(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return y(this)[e-1]+t-1}fromOffset(e){let t=y(this),n=0;if(e>=t[t.length-1])n=t.length-1;else{let o,i=t.length-2;for(;n<i;)if(o=n+(i-n>>1),e<t[o])i=o-1;else{if(!(e>=t[o+1])){n=o;break}n=o+1}}return{col:e-t[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let r,s,c=this.map.consumer(),d=c.originalPositionFor({column:t,line:e});if(!d.source)return!1;"number"==typeof n&&(r=c.originalPositionFor({column:o,line:n})),s=i(d.source)?l(d.source):new URL(d.source,this.map.consumer().sourceRoot||l(this.map.mapFile));let u={column:d.column,endColumn:r&&r.column,endLine:r&&r.line,line:d.line,url:s.toString()};if("file:"===s.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");u.file=a(s)}let h=c.sourceContentFor(d.source);return h&&(u.source=h),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}e.exports=g,g.default=g,h&&h.registerInput&&h.registerInput(g)},1167:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(9581),i=n(3518),r=n(9311),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){return c(this,void 0,void 0,function*(){const t=r.Logger.logfunction("CreateTheConceptApi",e);let n=(0,r.CreateDefaultConcept)();try{var c=(0,i.Xr)();const a=yield fetch(o.B.CreateTheConceptUrl(),{method:"POST",headers:c,body:JSON.stringify(e)});if(!a.ok)throw(0,s.ry)(a),new Error(`Error! status: ${a.status}`);return n=yield a.json(),r.Logger.logUpdate(t),n}catch(e){e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),(0,s.Mb)(e,o.B.CreateTheConceptUrl()),(0,s.ey)(t,"CreateTheConceptApi",e)}})}},1213:(e,t,n)=>{n.d(t,{f:()=>a});var o=n(9736),i=n(7820),r=n(9311),s=n(176),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){return c(this,void 0,void 0,function*(){let t=performance.now();try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConceptLocal",{id:e})).data}catch(e){console.error("GetTheConceptLocal error sw: ",e),(0,r.handleServiceWorkerException)(e)}let t=(0,r.CreateDefaultLConcept)();if(e<0){if(t=yield o.v.GetConcept(e),0==t.id){let n=yield i.G.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}}}else{let n=yield(0,r.GetTheConcept)(e);t=(0,s.F4)(n)}return t}catch(n){throw r.Logger.logError(t,"unknown","read","unknown",void 0,200,void 0,"GetTheConceptLocal",[e],"unknown",void 0),n}})}},1218:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(9311),i=n(7282),r=n(1666),s=n(8407),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){return c(this,arguments,void 0,function*(e,t=null,n=null,c=null,l=null,d=null,u=null){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("CreateTheComposition",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:c,userId:l,accessId:d,sessionInformationId:u})).data}catch(e){console.error("CreateTheComposition sw error: ",e),(0,o.handleServiceWorkerException)(e)}let h=null!=l?l:999,p=null!=d?d:4,f=null!=u?u:999,v=null!=c?c:0,y=(0,i.o)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=v,n=yield(0,s.A)(o,"",!0,h,p,f);y=n,t=n.id,v=n.id,yield a(e[o],n.id,n.userId,t,l,d,u)}else{let i=null!=t?t:999,c=null!=n?n:999,g=v,m=yield(0,s.A)(o,"",!0,h,p,f);y=m,yield(0,r.q)(i,c,m.id,g),yield a(e[o],m.id,m.userId,g,l,d,u)}else{let i=null!=t?t:999,c=null!=n?n:10267,a=v,l=yield(0,s.A)(o,e[o].toString(),!1,h,p,f);yield(0,r.q)(i,c,l.id,a)}return y})}},1239:(e,t,n)=>{n.d(t,{I:()=>u,r:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(9311),a=n(1596),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){return l(this,void 0,void 0,function*(){const t=c.Logger.logfunction("GetConceptBulk",[e.length])||{};let n=[],d=((new Date).getTime(),performance.now()),u=Array.from(new Set(e));try{if(c.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("GetConceptBulk",{passedConcepts:e});return c.Logger.logUpdate(t),n.data}catch(e){console.error("GetConceptBulk sw error: ",e),(0,s.ey)(t,"GetConceptBulk",e),(0,c.handleServiceWorkerException)(e)}}if(u.length>0){let h=[];for(let e=0;e<u.length;e++)if(!o.I.GetNpc(u[e])){let t=yield o.I.GetConcept(u[e]);0==t.id?h.push(u[e]):n.push(t)}if(0==h.length)return c.Logger.logfunction(t),n;{let u;const p={method:"POST",headers:(0,r.Xr)("application/json"),body:JSON.stringify(h)};try{u=yield fetch(i.B.GetConceptBulkUrl(),p)}catch(e){u=yield(0,a.g)(p,"/api/get_concept_bulk")}yield function(e,t,n,i,r){return l(this,void 0,void 0,function*(){if(e.ok){let t=yield e.json();if(t.length>0)for(let e=0;e<t.length;e++){let i=t[e];o.I.AddConcept(i),n.push(i)}c.Logger.logUpdate(i)}else console.log("Get Concept Bulk error",e.status),c.Logger.logError(r,"unknown","read","unknown",void 0,e.status,e,"GetConceptBulk",[t],"unknown",void 0),(0,s.ry)(e)})}(u,e,n,t,d)}}}catch(n){n instanceof Error?console.log("Get Concept Bulk error message: ",n.message):console.log("Get Concept Bulk unexpected error: ",n),c.Logger.logError(d,"unknown","read","unknown",void 0,500,n,"GetConceptBulk",[e],"unknown",void 0),(0,s.Mb)(n,i.B.GetConceptBulkUrl()),(0,s.ey)(t,"GetConceptBulk",n)}return n})}function u(e){return l(this,void 0,void 0,function*(){const t=[];if(e.length>0){const n=(0,r.Xr)("application/json");try{const r=yield fetch(i.B.GetConceptBulkUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(r.ok){const e=yield r.json();if(e.length>0)for(let n=0;n<e.length;n++){const i=e[n];t.push(i),o.I.AddConcept(i)}}else console.log("bulk concept getter api error: ",r.status),(0,s.ry)(r)}catch(e){e instanceof Error?console.log("bulk concept getter api error: ",e.message):console.log("bulk concept getter api error: ",e),(0,s.Mb)(e,i.B.GetConceptBulkUrl())}}return t})}},1320:(e,t,n)=>{n.d(t,{zl:()=>g,b6:()=>w,e$:()=>T,y6:()=>I,rq:()=>k,yV:()=>m,_W:()=>C});var o=n(9311),i=n(6687);function r(e){return e.startsWith("the_")?e.slice(4):e}var s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e,t,n){return s(this,void 0,void 0,function*(){var i,r,s,c,a,l,d,u;let h=[];for(let t=0;t<e.length;t++)h.push(e[t].toTheConceptId),h.push(e[t].ofTheConceptId),h.push(e[t].typeId);for(let h=0;h<e.length;h++){let p=!1;n.includes(e[h].id)&&(p=!0);let f=yield(0,o.GetTheConcept)(e[h].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[h].toTheConceptId);if(1==p&&0!=f.id&&0!=v.id){let n,a=null!==(r=null===(i=v.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self";e[h].toTheConceptId in t?n=t[e[h].toTheConceptId]:(n={},n[a]={},t[e[h].toTheConceptId]=n);let l=yield(0,o.GetTheConcept)(e[h].typeId);try{let e=null!==(c=null===(s=null==f?void 0:f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",n=f.characterValue;l.characterValue,l.characterValue.includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[v.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=v.id){let n,i=null!==(l=null===(a=f.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[h].ofTheConceptId in t?n=t[e[h].ofTheConceptId]:(n={},n[i]={},t[e[h].ofTheConceptId]=n);let r=yield(0,o.GetTheConcept)(e[h].typeId);try{let e=null!==(u=null===(d=null==v?void 0:v.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",n=v.characterValue;r.characterValue.includes("_s_")&&(v.id in t||(t[v.id]={}),t[v.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}return t})}var a=n(5312),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function u(e,t,n){if(e in t){let o=t[e];o&&(n[o.connectionType+"_count"]=o.count)}}var h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},p=n(4698),f=n(6915),v=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},y=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function g(e,t){return y(this,arguments,void 0,function*(e,t,n=""){let r=yield(0,o.SearchWithTypeAndLinkerApi)(e,t,n),s=r.compositionIds,c=r.internalConnections,l=r.linkers,d=r.reverse,u=r.mainCompositionIds,h=yield(0,i.QL)(l),p=yield(0,i.MT)(s,c);return yield(0,a.NK)(h,p,u,d)})}function m(e,t,n,o,r){return y(this,void 0,void 0,function*(){let s=yield(0,i.QL)(e),c=yield(0,i.rv)(t,n);return yield(0,a.Ve)(s,c,t,o,r)})}function C(e,t,n,o,r){return y(this,void 0,void 0,function*(){let s=yield(0,i.QL)(e),c=yield(0,i.D)(t,n);return yield(0,a.NK)(s,c,o,r)})}function w(e,t,n,a,l){return y(this,void 0,void 0,function*(){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnections",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:a,countInfos:l})).data}catch(e){console.error("formatConnections error sw: ",e),(0,o.handleServiceWorkerException)(e)}let d=yield(0,i.QL)(e);d=(0,f.X)(d);let u=[];u=yield c(d,u,a),u=yield function(e,t,n){return s(this,void 0,void 0,function*(){var i,s,c,a,l,d,u,h;let p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let p=0;p<e.length;p++){let f=!1;n.includes(e[p].id)&&(f=!0);let v=yield(0,o.GetTheConcept)(e[p].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[p].toTheConceptId);if(1==f&&0!=v.id&&0!=y.id){let n,l=null!==(s=null===(i=y.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],l in n||(n[l]={})):(n={},n[l]={},t[e[p].toTheConceptId]=n);let d=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(a=null===(c=null==v?void 0:v.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",t=v.characterValue,o=d.characterValue;""==o&&(o=e,o=r(o));let i={[e]:t},s=o+"_reverse";d.characterValue.includes("_s_")||("string"==typeof n[l]&&(n[l]={}),n[l][s]=i)}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id){let n,i=null!==(d=null===(l=v.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);let s=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(h=null===(u=null==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",t=y.characterValue,o=s.characterValue,c=(s.characterValue,!1);""==o&&(o=e,o=r(o),c=!0);let a={[e]:t};isNaN(Number(o))?s.characterValue.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][o]=c?t:a):(Array.isArray(n[i])||(n[i]=[]),n[i].push(t))}catch(e){console.log("this is error",e)}}}return t})}(d,u,a);let h=yield function(e,t,n,i){return s(this,arguments,void 0,function*(e,t,n,i,r=[]){var s,c,a,l,d,u;let h=[],p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;r.includes(e[n].id)&&(i=!0);let h=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),p=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(1==i&&0!=h.id&&0!=p.id&&p.id in t){let i,r=null!==(c=null===(s=p.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[r]={},t[e[n].toTheConceptId]=i);let a=yield(0,o.GetTheConcept)(e[n].typeId);try{let o=a.characterValue+"_reverse",s=t[e[n].ofTheConceptId];s&&(Array.isArray(i[r][o])?i[r][o].push(s):a.characterValue.includes("_s_")?(i[r][o]=[],i[r][o].push(s)):i[r][o]=s)}catch(e){console.log("this is error",e)}}if(0!=h.id&&0!=p.id&&h.id in t){let i,r=null!==(l=null===(a=h.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[r]&&(i[r]={})):(i={},i[r]={},t[e[n].ofTheConceptId]=i);let s=!1,c=(yield(0,o.GetTheConcept)(e[n].typeId)).characterValue;""==c&&(c=p.characterValue,s=!0),""==c&&(c=null!==(u=null===(d=null==p?void 0:p.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"");try{let o=t[e[n].toTheConceptId];o&&(Array.isArray(i[r])?s?i[r].push(o[c]):i[r].push(o):Array.isArray(i[r][c])?i[r][c].push(o):c.includes("_s_")?(i[r][c]=[],s?i[r][c].push(o[c]):i[r][c].push(o)):i[r][c]=s?o[c]:o)}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i=t[n[e]];i?(i.id=n[e],h.push(i)):0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e],h.push(i))}return h})}(d,u,n,[],a);return h})}function I(e,t,n,s,a){return y(this,arguments,void 0,function*(e,t,n,s,a,h="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsJustId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:a,order:h})).data}catch(e){console.error("formatConnectionsJustId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let v=yield(0,i.QL)(e),y=yield(0,p.V)(a);v=(0,f.X)(v,h);let g=[];g=yield c(v,g,s),g=yield function(e,t){return d(this,arguments,void 0,function*(e,t,n=[]){var o,i,s,c,a,d,u,h;let p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);for(let p=0;p<e.length;p++){let f=!1,v=yield(0,l.A)(e[p].ofTheConceptId),y=yield(0,l.A)(e[p].toTheConceptId);if(n.includes(e[p].id)&&(f=!0),1==f&&0!=v.id&&0!=y.id){let n,a=yield(0,l.A)(e[p].typeId),d=null!==(i=null===(o=y.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],d in n||(n[d]={})):(n={},n[d]={},t[e[p].toTheConceptId]=n);try{let t=null!==(c=null===(s=null==v?void 0:v.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",o=v.characterValue,i=a.characterValue;""==i&&(i=t,i=r(i));let l={id:v.id,[t]:o,created_on:e[p].entryTimeStamp},u=i+"_reverse";u.includes("_s_")||("string"==typeof n[d]&&(n[d]={}),n[d][u]=l)}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id){let n,o=yield(0,l.A)(e[p].typeId),i=null!==(d=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);try{let t=null!==(h=null===(u=null==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",s=y.characterValue,c=o.characterValue,a=!1;""==c&&(c=t,c=r(c),a=!0);let l={};l[t]={id:y.id,data:s,created_on:e[p].entryTimeStamp},isNaN(Number(c))?c.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][c]=a?l[t]:l):(Array.isArray(n[i])||(n[i]=[]),n[i].push(l[t]))}catch(e){console.log("this is error",e)}}}return t})}(v,g,s);let m=yield function(e,t,n){return d(this,arguments,void 0,function*(e,t,n,i=[],r){var s,c,a,d,h,p,f;(new Date).getTime();let v=[],y=[];for(let t=0;t<e.length;t++)y.push(e[t].toTheConceptId),y.push(e[t].ofTheConceptId),y.push(e[t].typeId);for(let n=0;n<e.length;n++){let o=!1,v=yield(0,l.A)(e[n].ofTheConceptId),y=yield(0,l.A)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(o=!0),1==o&&0!=v.id&&0!=y.id&&y.id in t){let o,i=yield(0,l.A)(e[n].typeId),r=null!==(c=null===(s=y.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",a=!1;e[n].toTheConceptId in t&&(a=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[r]&&(o[r]={})):(o={},o[r]={},t[e[n].toTheConceptId]=o);try{if(t[e[n].ofTheConceptId]){let s=t[e[n].ofTheConceptId];s&&(s.id=v.id,s.created_on=v.entryTimeStamp);let c=i.characterValue+"_reverse";Array.isArray(o[r][c])?o[r][c].push(s):c.includes("_s_")?(o[r][c]=[],o[r][c].push(s)):o[r][c]=s}}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id&&v.id in t){let o,i=yield(0,l.A)(e[n].typeId),s=null!==(d=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self",c=!1;e[n].toTheConceptId in t&&(c=!0),e[n].ofTheConceptId in t?(o=t[e[n].ofTheConceptId],"string"==typeof o[s]&&(o[s]={})):(o={},o[s]={},t[e[n].ofTheConceptId]=o),u(v.id,r,o);let g=!1,m=i.characterValue;""==m&&(m=y.characterValue,g=!0),""==m&&(m=(null===(h=null==y?void 0:y.type)||void 0===h?void 0:h.characterValue)||"");try{let i=null!==(f=null===(p=null==y?void 0:y.type)||void 0===p?void 0:p.characterValue)&&void 0!==f?f:"none",c=t[e[n].toTheConceptId];if(c){let t={};t[i]={data:c[i],id:y.id,created_on:e[n].entryTimeStamp},Array.isArray(o[s])?g?o[s].push(c[m]):o[s].push(c):Array.isArray(o[s][m])?o[s][m].push(t):m.includes("_s_")?(o[s][m]=[],g?o[s][m].push(t[i]):o[s][m].push(t)):o[s][m]=g?t[i]:t,u(y.id,r,t)}}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i={};i=t[n[e]],i?i.id=n[e]:0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e]),v.push(i)}return v})}(v,g,n,s,y);return m})}function T(e,t,n,s,c){return y(this,arguments,void 0,function*(e,t,n,s,c,a="DESC"){try{if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsDataId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:c,order:a})).data}catch(e){console.error("formatConnectionsDataId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l,d;try{l=yield(0,i.QL)(e)}catch(e){throw console.error("Error in GetConnectionDataPrefetch:",e),new Error(`Failed to prefetch connections: ${e instanceof Error?e.message:String(e)}`)}try{d=yield(0,p.V)(c)}catch(e){throw console.error("Error in GetConnectionTypeForCount:",e),new Error(`Failed to get connection type for count: ${e instanceof Error?e.message:String(e)}`)}try{l=(0,f.X)(l,a)}catch(e){throw console.error("Error in orderTheConnections:",e),new Error(`Failed to order connections: ${e instanceof Error?e.message:String(e)}`)}let v,y=[],g=[];try{y=yield function(e,t){var n=arguments;return h(this,arguments,void 0,function*(e,t,i=[]){var r,s,c,a,l,d,u,h;try{const p=o.Logger.logfunction("FormatFunctionData",n);let f=[];for(let t=0;t<e.length;t++)f.push(e[t].toTheConceptId),f.push(e[t].ofTheConceptId),f.push(e[t].typeId);for(let n=0;n<e.length;n++)try{let p=!1,f=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(p=!0),1==p&&0!=f.id&&0!=v.id){let i,l=yield(0,o.GetTheConcept)(e[n].typeId),d=null!==(s=null===(r=v.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[d]={},t[e[n].toTheConceptId]=i);try{let e=null!==(a=null===(c=null==f?void 0:f.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",n=f.characterValue;(l.characterValue+"_reverse").includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[v.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=v.id){let i,r=yield(0,o.GetTheConcept)(e[n].typeId),s=null!==(d=null===(l=f.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[n].ofTheConceptId in t?i=t[e[n].ofTheConceptId]:(i={},i[s]={},t[e[n].ofTheConceptId]=i);try{let e=null!==(h=null===(u=null==v?void 0:v.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",n=v.characterValue;r.characterValue.includes("_s_")&&(v.id in t||(t[v.id]={}),t[v.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}catch(e){console.log("Error processing connection at index",n,e)}return o.Logger.logUpdate(p),t}catch(e){throw console.log("Error in FormatFunctionData",e),e}})}(l,y,s)}catch(e){throw console.error("Error in FormatFunctionData:",e),new Error(`Failed to format function data: ${e instanceof Error?e.message:String(e)}`)}try{y=yield function(e){var t=arguments;return h(this,arguments,void 0,function*(e,n=[],i=[]){var s,c,a,l,d,u,h,p;try{const f=o.Logger.logfunction("FormatFunctionDataForData",t);let v=[];for(let t=0;t<e.length;t++)v.push(e[t].toTheConceptId),v.push(e[t].ofTheConceptId),v.push(e[t].typeId);for(let t=0;t<e.length;t++)try{let f=!1,v=yield(0,o.GetTheConcept)(e[t].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[t].toTheConceptId);if(i.includes(e[t].id)&&(f=!0),1==f&&0!=v.id&&0!=y.id){let i,d=yield(0,o.GetTheConcept)(e[t].typeId),u=null!==(c=null===(s=y.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self";e[t].toTheConceptId in n?(i=n[e[t].toTheConceptId],u in i||(i[u]={})):(i={},i[u]={},n[e[t].toTheConceptId]=i);try{let e=null!==(l=null===(a=null==v?void 0:v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",t=v.characterValue,n=d.characterValue;""==n&&(n=e,n=r(n));let o={id:v.id,data:{[e]:t}},s=n+"_reverse";s.includes("_s_")||("string"==typeof i[u]&&(i[u]={}),i[u][s]=o)}catch(e){console.log("this is error",e)}}if(0!=v.id&&0!=y.id){let i,s=yield(0,o.GetTheConcept)(e[t].typeId),c=null!==(u=null===(d=v.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"self";e[t].ofTheConceptId in n?(i=n[e[t].ofTheConceptId],c in i||(i[c]={})):(i={},i[c]={},n[e[t].ofTheConceptId]=i);try{let e=null!==(p=null===(h=null==y?void 0:y.type)||void 0===h?void 0:h.characterValue)&&void 0!==p?p:"none",t=y.characterValue,n=s.characterValue,o=!1;""==n&&(n=e,n=r(n),o=!0);let a={id:y.id,data:{[e]:t}};isNaN(Number(n))?n.includes("_s_")||("string"==typeof i[c]&&(i[c]={}),i[c][n]=a):(Array.isArray(i[c])||(i[c]=[]),i[c].push(a))}catch(e){console.log("this is error",e)}}}catch(e){console.log("Error processing connection at index",t,e)}return o.Logger.logUpdate(f),n}catch(e){throw console.log("Error in FormatFunctionDataForData",e),e}})}(l,y,s)}catch(e){throw console.error("Error in FormatFunctionDataForData:",e),new Error(`Failed to format function data for data: ${e instanceof Error?e.message:String(e)}`)}try{v=yield function(e,t,n,i){var r=arguments;return h(this,arguments,void 0,function*(e,t,n,i,s=[],c){var a,l,d,h,p,f;try{const n=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",r);let v=[],y=[];for(let t=0;t<e.length;t++)y.push(e[t].toTheConceptId),y.push(e[t].ofTheConceptId),y.push(e[t].typeId);for(let n=0;n<e.length;n++)try{let i=!1,r=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(s.includes(e[n].id)&&(i=!0),1==i&&0!=r.id&&0!=v.id&&v.id in t){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),d=null!==(l=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self",h=!1;e[n].toTheConceptId in t&&(h=!0),e[n].toTheConceptId in t?(i=t[e[n].toTheConceptId],"string"==typeof i[d]&&(i[d]={})):(i={},i[d]={},t[e[n].toTheConceptId]=i),u(v.id,c,i);try{if(t[e[n].ofTheConceptId]){let o={id:r.id,data:t[e[n].ofTheConceptId],created_on:e[n].entryTimeStamp},c=s.characterValue+"_reverse";Array.isArray(i[d][c])?i[d][c].push(o):c.includes("_s_")?(i[d][c]=[],i[d][c].push(o)):i[d][c]=o}}catch(e){console.log("this is error",e)}}if(0!=r.id&&0!=v.id&&r.id in t){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),a=null!==(h=null===(d=r.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"self",l=!1;e[n].toTheConceptId in t&&(l=!0),e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[a]&&(i[a]={})):(i={},i[a]={},t[e[n].ofTheConceptId]=i),u(r.id,c,i);let y=!0,g=s.characterValue;""==g&&(g=v.characterValue,y=!0),""==g&&(g=(null===(p=null==v?void 0:v.type)||void 0===p?void 0:p.characterValue)||"");try{null===(f=null==v?void 0:v.type)||void 0===f||f.characterValue;let o=t[e[n].toTheConceptId];if(o){let r={id:v.id,data:t[e[n].toTheConceptId],created_on:e[n].entryTimeStamp};Array.isArray(i[a])?i[a].push(o):Array.isArray(i[a][g])?i[a][s.characterValue].push(r):g.includes("_s_")?(i[a][g]=[],i[a][g].push(r)):i[a][g]=r,u(v.id,c,r)}}catch(e){console.log("this is error",e)}}}catch(e){console.log("Error processing connection at index",n,e)}for(let e=0;e<i.length;e++)try{let n={};n.id=i[e];let r=yield(0,o.GetTheConcept)(n.id);n.data=t[i[e]],n.created_on=r.entryTimeStamp,v.push(n)}catch(t){console.log("Error processing main composition at index",e,t)}return o.Logger.logUpdate(n),v}catch(e){throw console.log("Error in FormatFromConnectionsAlteredArrayExternal",e),e}})}(l,y,g,n,s,d)}catch(e){throw console.error("Error in FormatFromConnectionsAlteredArrayExternal:",e),new Error(`Failed to format from connections altered array external: ${e instanceof Error?e.message:String(e)}`)}return v}catch(e){throw console.error("Error in formatConnectionsDataId:",e),e}})}function k(e,t,n,s,c){return y(this,arguments,void 0,function*(e,t,n,s,c,a="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsV2",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:c,order:a})).data}catch(e){console.error("formatConnectionsV2 error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l=yield(0,i.QL)(e),d=yield(0,p.V)(c);l=(0,f.X)(l,a);let h={};h=yield function(e){var t=arguments;return v(this,arguments,void 0,function*(e,n={},i=[]){var r,s,c,a,l;const d=o.Logger.logfunction("FormatFunctionDataV2",t);for(const t of e){const e=i.includes(t.id),d=yield(0,o.GetTheConcept)(t.ofTheConceptId),u=yield(0,o.GetTheConcept)(t.toTheConceptId),h=yield(0,o.GetTheConcept)(t.typeId);if(0===d.id||0===u.id)continue;const p=e?u:d,f=e?d:u,v=null!==(s=null===(r=p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self",y=null!==(a=null===(c=f.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",g=f.characterValue;null===(l=h.characterValue)||void 0===l||l.includes("_s_"),n[p.id]||(n[p.id]={}),n[p.id][v]||(n[p.id][v]={}),n[f.id]||(n[f.id]={}),n[f.id][y]=g}return o.Logger.logUpdate(d),n})}(l,h,s),h=yield function(e){var t=arguments;return v(this,arguments,void 0,function*(e,n={},i=[]){var s,c,a,l,d;const u=o.Logger.logfunction("FormatFunctionDataForDataV2",t);for(const t of e){const e=i.includes(t.id),u=yield(0,o.GetTheConcept)(t.ofTheConceptId),h=yield(0,o.GetTheConcept)(t.toTheConceptId),p=yield(0,o.GetTheConcept)(t.typeId);if(0===u.id||0===h.id)continue;const f=e?h:u,v=e?u:h,y=null!==(c=null===(s=f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",g=null!==(l=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",m=v.characterValue,C=null!==(d=p.characterValue)&&void 0!==d?d:"";let w=""===C?r(g):C;const I=w.includes("_s_"),T=!isNaN(Number(w)),k={id:v.id,data:{[g]:m}};n[f.id]||(n[f.id]={}),y in n[f.id]&&"string"!=typeof n[f.id][y]||(n[f.id][y]=T?[]:{});try{if(I)continue;T?n[f.id][y].push(k):n[f.id][y][e?`${w}_reverse`:w]=k}catch(e){console.error("Error formatting concept data:",e)}}return o.Logger.logUpdate(u),n})}(l,h,s);let y=yield function(e,t,n){var i=arguments;return v(this,arguments,void 0,function*(e,t,n,r=[],s){var c,a,l;const d=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",i),h=[];for(const n of e){const e=r.includes(n.id),i=yield(0,o.GetTheConcept)(n.ofTheConceptId),d=yield(0,o.GetTheConcept)(n.toTheConceptId),h=yield(0,o.GetTheConcept)(n.typeId);if(0===i.id||0===d.id)continue;const p=e?d:i,f=e?i:d,v=p.id,y=f.id,g=null!==(a=null===(c=p.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"self",m=h.characterValue+"_reverse",C=h.characterValue||f.characterValue||(null===(l=f.type)||void 0===l?void 0:l.characterValue)||"";if(t[v]){const o=t[v][g],i=t[y],r={id:f.id,data:i,created_on:n.entryTimeStamp};u(v,s,t[v]);try{e?Array.isArray(o[m])?o[m].push(r):o[m]=[r]:Array.isArray(o)?o.push(i):Array.isArray(o[C])?o[C].push(r):C.includes("_s_")?(o[C]=[],o[C].push(r)):o[C]=[r],u(y,s,r)}catch(e){console.error("Error processing connection:",e)}}else console.log("This is the error in the source")}for(const e of n){const n=yield(0,o.GetTheConcept)(e);h.push({id:e,data:t[e],created_on:n.entryTimeStamp})}return o.Logger.logUpdate(d),h})}(l,h,n,s,d);return y})}},1412:(e,t,n)=>{function o(e=[],t=[]){}n.d(t,{e:()=>o})},1534:(e,t,n)=>{let o=n(7793),i=n(1752);class r extends o{get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=r,r.default=r,o.registerRule(r)},1557:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();e[i]||(e[i]={}),e=e[i]}},e.exports=t.default},1581:(e,t)=>{t.__esModule=!0,t.UNIVERSAL=t.TAG=t.STRING=t.SELECTOR=t.ROOT=t.PSEUDO=t.NESTING=t.ID=t.COMMENT=t.COMBINATOR=t.CLASS=t.ATTRIBUTE=void 0,t.TAG="tag",t.STRING="string",t.SELECTOR="selector",t.ROOT="root",t.PSEUDO="pseudo",t.NESTING="nesting",t.ID="id",t.COMMENT="comment",t.COMBINATOR="combinator",t.CLASS="class",t.ATTRIBUTE="attribute",t.UNIVERSAL="universal"},1596:(e,t,n)=>{n.d(t,{g:()=>s});var o=n(9311),i=n(3278),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(e,t){return r(this,void 0,void 0,function*(){if("undefined"!=typeof self&&"undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope)throw new Error("Cannot switch server from service worker");try{!function(){const e=o.BaseUrl.NODE_CACHE_URL;let t=o.BaseUrl.BASE_APPLICATION+"_cacheServers";if(e===o.BaseUrl.BASE_URL)throw new Error("Base Server Down");let n=sessionStorage.getItem(t);n=JSON.parse(n);const r=n.indexOf(e);if(o.BaseUrl.isNearestCache=!1,n.includes(e)&&-1!==r&&n.splice(r,1),sessionStorage.setItem(t,JSON.stringify(n)),n.length){const e=n[0];o.BaseUrl.NODE_CACHE_URL=e}else o.BaseUrl.NODE_CACHE_URL=o.BaseUrl.BASE_URL;console.log("before the payload",i.b.sessionId),navigator.serviceWorker&&navigator.serviceWorker.controller&&(0,o.sendMessage)("SESSION_DATA",{type:"SESSION_DATA",data:o.BaseUrl.NODE_CACHE_URL,session:i.b.sessionId})}();try{return yield fetch(`${o.BaseUrl.NODE_CACHE_URL}${t}`,e)}catch(n){return yield s(e,t)}}catch(e){throw e}})}},1666:(e,t,n)=>{n.d(t,{q:()=>s});var o=n(2155),i=n(442),r=n(1863);function s(e,t,n,s){var c=t,a=new o.N(0,e,n,c,s,1,4);if(e==n)return a.ofTheConceptId=0,a.toTheConceptId=1,a;try{a.isTemp=!0,a.id=Math.floor(1e8*Math.random()),i.Y.AddConnection(a)}catch(e){(0,r.Mb)(e)}return a}},1669:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3295))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.UNIVERSAL,n.value="*",n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},1704:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.COMBINATOR,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},1735:(e,t,n)=>{n.d(t,{J:()=>c});var o,i=n(9311),r=n(3278),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class c{static incrementConcept(e){try{e&&(this.conceptsData[e]=(this.conceptsData[e]||0)+1)}catch(e){console.error("Failed on increment concept")}}static incrementConnection(e){try{e&&(this.connectionsData[e]=(this.connectionsData[e]||0)+1)}catch(e){console.error("Failed on increment connection")}}static getTopConcepts(e){return Object.entries(this.conceptsData).map(([e,t])=>[parseInt(e),t]).sort((e,t)=>t[1]-e[1]).slice(0,e)}static getTopConnections(e){return Object.entries(this.connectionsData).map(([e,t])=>[parseInt(e),t]).sort((e,t)=>t[1]-e[1]).slice(0,e)}static saveDataToLocalStorage(){const e={concepts:this.conceptsData,connections:this.connectionsData};null===localStorage||void 0===localStorage||localStorage.setItem(this.accessData,JSON.stringify(e))}static loadDataFromLocalStorage(){const e=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(this.accessData);if(e){const t=JSON.parse(e);this.conceptsData=t.concepts||{},this.connectionsData=t.connections||{}}}static sendToServer(){return s(this,void 0,void 0,function*(){try{yield this.syncToServer()}catch(e){console.error("Failed to process Access Tracker Sync with Server")}})}static syncToServer(){return s(this,void 0,void 0,function*(){try{if(!Object.keys(this.conceptsData).length&&!Object.keys(this.connectionsData).length)return;const e=r.b.BearerAccessToken;if(!e)return;const t=this.conceptsData&&Object.keys(this.conceptsData).length>0?this.conceptsData:{},n=this.connectionsData&&Object.keys(this.connectionsData).length>0?this.connectionsData:{},o=yield fetch(i.BaseUrl.PostPrefetchConceptConnections(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({concepts:t,connections:n})});if(!o.ok)throw new Error("Failed to sync data to the server.");yield o.json(),this.conceptsData={},this.connectionsData={},this.setNextSyncTime()}catch(e){console.error("Sync error:",e)}})}static setNextSyncTime(){this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS}static startAutoSync(){setInterval(()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&this.syncNow().catch(console.error)},6e4)}static syncNow(){return s(this,void 0,void 0,function*(){try{this.activateStatus?yield this.syncToServer():console.warn("Access Tracker inactive.")}catch(e){console.error("Error on sync access tracker")}})}static GetSuggestedConcepts(e){return s(this,void 0,void 0,function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConcepts());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load concepts: ${o.status} ${o.statusText}. Details: ${e}`)}const s=(yield o.json())||[];return yield this.addConceptToBinaryTree(s.data),s}catch(e){throw e instanceof Error?(console.error("Error fetching suggested concepts:",e.message),new Error("Unable to fetch suggested concepts. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested concepts."))}})}static GetSuggestedConnections(e){return s(this,void 0,void 0,function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConnections());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load connections: ${o.status} ${o.statusText}. Details: ${e}`)}const s=(yield o.json())||[];return yield this.addConnectionToBinaryTree(s.data),s}catch(e){throw e instanceof Error?(console.error("Error fetching suggested Connections:",e.message),new Error("Unable to fetch suggested connections. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested Connections."))}})}static addConceptToBinaryTree(e){return s(this,void 0,void 0,function*(){try{e.forEach(e=>{i.ConceptsData.AddConcept(e)})}catch(e){console.error("Error on adding Concepts Data into tree")}})}static addConnectionToBinaryTree(e){return s(this,void 0,void 0,function*(){try{e.forEach(e=>{i.ConnectionData.AddConnection(e)})}catch(e){console.error("Error on adding Connections Data into tree")}})}}o=c,c.conceptsData={},c.connectionsData={},c.SYNC_INTERVAL_MS=12e4,c.nextSyncTime=Date.now(),c.activateStatus=!1,c.accessData="Access Data",o.startAutoSync()},1752:e=>{let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let o=[],i="",r=!1,s=0,c=!1,a="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:c?n===a&&(c=!1):'"'===n||"'"===n?(c=!0,a=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(r=!0),r?(""!==i&&o.push(i.trim()),i="",r=!1):i+=n;return(n||""!==i)&&o.push(i.trim()),o}};e.exports=t,t.default=t},1863:(e,t,n)=>{n.d(t,{ER:()=>s,Mb:()=>c,ey:()=>a,ry:()=>r});var o=n(9311),i=n(7273);function r(e){if(o.Logger.log("ERROR",e.statusText,{code:e.status,data:e.statusText}),401==e.status||406==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}if(500==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}}function s(e,t={}){if(o.Logger.log("ERROR",t.statusText,{code:e.status,data:e.status}),401==e.status||406==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}if(500==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}}function c(e,t=""){if(o.Logger.log("ERROR",e.message,{code:e.status,data:e.stack}),e.status){let n=new i.z(e.message,!1,e.status,e.stack);throw n.setUrl(t),n}{let n=new i.z(e.message,!1,500,e.stack);throw n.setUrl(t),n}}function a(e,t,n){var o;try{if(!e)return void console.error(`Error in ${t}: logData is undefined`);const i=Date.now();e.startTime=null!==(o=e.startTime)&&void 0!==o?o:i,e.responseTime=i-e.startTime+" ms",e.level="ERROR",e.errorMessage=(null==n?void 0:n.message)||"Unknown error occurred",console.error(`Error in function ${t}:`,n)}catch(e){console.error("Failed to handle package function error:",e)}}},1866:()=>{},2013:(e,t,n)=>{n.d(t,{A:()=>a,w:()=>l});var o=n(8146),i=n(9311),r=n(3026),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){var t=arguments;return c(this,void 0,void 0,function*(){const n=i.Logger.logfunction("GetConceptByCharacter",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacter",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacter sw error: ",e),(0,s.ey)(n,"GetConceptByCharacter",e),(0,i.handleServiceWorkerException)(e)}}let c=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=c&&0!=(null==c?void 0:c.id)||!a||(yield(0,o.Y)(e),c=yield r.I.GetConceptByCharacterAndTypeLocal(e,51),0==c.id&&(c=yield r.I.GetConceptByCharacter(e))),i.Logger.logUpdate(n),c})}function l(e){var t=arguments;return c(this,void 0,void 0,function*(){const n=i.Logger.logfunction("GetConceptByCharacterUpdated",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacterUpdated",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacterUpdated error sw: ",e),(0,s.ey)(n,"GetConceptByCharacterUpdated",e),(0,i.handleServiceWorkerException)(e)}}let c=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=c&&0!=(null==c?void 0:c.id)||!a||(yield(0,o.Y)(e),c=yield r.I.GetConceptByCharacter(e)),i.Logger.logUpdate(n),c})}},2110:(e,t,n)=>{const{AtRule:o,Rule:i}=n(2895);let r=n(7149);function s(e,t){let n;try{r(e=>{n=e}).processSync(e)}catch(n){throw e.includes(":")?t?t.error("Missed semicolon"):n:t?t.error(n.message):n}return n.at(0)}function c(e,t){let n=!1;return e.each(e=>{if("nesting"===e.type){let o=t.clone({});"&"!==e.value?e.replaceWith(s(e.value.replace("&",o.toString()))):e.replaceWith(o),n=!0}else"nodes"in e&&e.nodes&&c(e,t)&&(n=!0)}),n}function a(e,t){let n=[];for(let o of e.selectors){let i=s(o,e);for(let e of t.selectors){if(!e)continue;let o=s(e,t);c(o,i)||(o.prepend(r.combinator({value:" "})),o.prepend(i.clone({}))),n.push(o.toString())}}return n}function l(e,t){if("comment"!==e.prev()?.type)return t.after(e),e;let n=e.prev();return e.parent.toString().match(/[*]\/ *\n.*{/)?t.after(e).after(n):t.after(e),e}function d(e,t,n,o=!0){return t.length?(n=function(e,t,n){let o=new i({nodes:[],selector:e});return o.append(t),n.after(o),o}(e,t,n),o&&(t=[]),[n,t]):[n,t]}function u(e,t=""){let n=e.concat(t),o={};for(let e of n)o[e.replace(/^@/,"")]=!0;return o}function h(e){let t=e[f];if(t){let n,i,r,s,c=e.nodes,a=-1,l=function(e){let t=[],n=e.parent;for(;n&&n instanceof o;)t.push(n),n=n.parent;return t}(e);if(l.forEach((e,o)=>{if(t(e.name))n=e,a=o,r=s;else{let t=s;s=e.clone({nodes:[]}),t&&s.append(t),i=i||s}}),n?r?(i.append(c),n.after(r)):n.after(c):e.after(c),e.next()&&n){let t;l.slice(0,a+1).forEach((n,o,i)=>{let r=t;t=n.clone({nodes:[]}),r&&t.append(r);let s=[],c=(i[o-1]||e).next();for(;c;)s.push(c),c=c.next();t.append(s)}),t&&(r||c[c.length-1]).after(t)}}else e.after(e.nodes);e.remove()}const p=Symbol("rootRuleMergeSel"),f=Symbol("rootRuleEscapes");const v=Symbol("hasRootRule");e.exports=(e={})=>{let t=u(["media","supports","layer","container","starting-style"],e.bubble),n=function(e){return function t(n,o,i,r=i){let s=[];if(o.each(c=>{"rule"===c.type&&i?r&&(c.selectors=a(n,c)):"atrule"===c.type&&c.nodes?e[c.name]?t(n,c,r):!1!==o[p]&&s.push(c):s.push(c)}),i&&s.length){let e=n.clone({nodes:[]});for(let t of s)e.append(t);o.prepend(e)}}}(t),o=u(["document","font-face","keyframes","-webkit-keyframes","-moz-keyframes"],e.unwrap),r=(e.rootRuleName||"at-root").replace(/^@/,""),s=e.preserveEmpty;return{Once(e){e.walkAtRules(r,t=>{(function(e){let{params:t}=e,{escapes:n,selector:o,type:r}=function(e){let t=(e=e.trim()).match(/^\((.*)\)$/);if(!t)return{selector:e,type:"basic"};let n=t[1].match(/^(with(?:out)?):(.+)$/);if(n){let e="with"===n[1],t=Object.fromEntries(n[2].trim().split(/\s+/).map(e=>[e,!0]));if(e&&t.all)return{type:"noop"};let o=e=>!!t[e];return t.all?o=()=>!0:e&&(o=e=>"all"!==e&&!t[e]),{escapes:o,type:"withrules"}}return{type:"unknown"}}(t);if("unknown"===r)throw e.error(`Unknown @${e.name} parameter ${JSON.stringify(t)}`);if("basic"===r&&o){let t=new i({nodes:e.nodes,selector:o});e.removeAll(),e.append(t)}e[f]=n,e[p]=n?!n("all"):"noop"===r})(t),e[v]=!0})},postcssPlugin:"postcss-nested",RootExit(e){e[v]&&(e.walkAtRules(r,h),e[v]=!1)},Rule(e){let i=!1,c=e,u=!1,h=[];e.each(s=>{switch(s.type){case"atrule":[c,h]=d(e.selector,h,c),s.name===r?(i=!0,n(e,s,!0,s[p]),c=l(s,c)):t[s.name]?(u=!0,i=!0,n(e,s,!0),c=l(s,c)):o[s.name]?(u=!0,i=!0,n(e,s,!1),c=l(s,c)):u&&h.push(s);break;case"decl":u&&h.push(s);break;case"rule":[c,h]=d(e.selector,h,c),u=!0,i=!0,s.selectors=a(e,s),c=l(s,c)}}),d(e.selector,h,c,!1),i&&!0!==s&&(e.raws.semicolon=!0,0===e.nodes.length&&e.remove())}}},e.exports.postcss=!0},2155:(e,t,n)=>{n.d(t,{N:()=>r});var o=n(7282),i=n(9581);class r{constructor(e=0,t,n,r,s,c,a){this.count=0,this.isTemp=!1,this.toUpdate=!1,this.applicationId=i.B.getRandomizer(),this.type=(0,o.o)(),this.ofConcept=(0,o.o)(),this.toConcept=(0,o.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.userId=r,this.typeId=s,this.ghostId=e,this.orderId=c,this.accessId=a,this.entryTimeStamp=(0,o.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date,this.typeCharacter=""}}},2202:(e,t,n)=>{n.d(t,{W:()=>a});var o=n(6963),i=n(6731),r=n(205),s=n(9311),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addConceptToTree(e){let t=new i.b(e.id,e,null,null),n=new i.b(e.characterValue,e,null,null);o.f.addNodeToTree(n),this.addNodeToTree(t)}static getNodeFromTree(e){return c(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return c(this,void 0,void 0,function*(){if(this.root){let t=new Event(`${e}`);console.log("this is the fired event after delete",t),(0,s.dispatchIdEvent)(e),this.root=this.root.removeNode(this.root,e)}})}static getConceptListFromIds(e,t,n){return c(this,void 0,void 0,function*(){this.root&&this.root.checkIfIdsInNode(this.root,e,t,n)})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}a.root=null},2212:(e,t,n)=>{n.d(t,{Ay:()=>l,N:()=>d});var o=n(1167),i=n(2615),r=n(5976),s=n(442),c=n(9311),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n,o,c,l,d){return a(this,void 0,void 0,function*(){let a=yield r.B.getId(),u=new Date,h=new Date,p=new i.j(a,t,o,n,c,e,l,!0,u,h,d);return p.isTemp=!1,s.Y.AddConcept(p),p})}function d(e,t,n,s,l,d,u){return a(this,void 0,void 0,function*(){let a=yield r.B.getId(),h=new Date,p=new Date,f=new i.j(a,t,s,n,l,e,d,!1,h,p,u);return c.ConceptsData.AddConcept(f),(0,o.Y)([f]),f})}},2289:(e,t,n)=>{n.d(t,{$S:()=>d,L0:()=>u,WC:()=>h});var o=n(8675),i=n(6058),r=n(9311),s=n(1863);n(3518);var c=n(843),a=n(4818),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e,t){var n=arguments;return l(this,void 0,void 0,function*(){const i=r.Logger.logfunction("DeleteConnectionByType",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByType",{id:e,linker:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByType sw error: ",e),(0,s.ey)(i,"DeleteConnectionByType",e),(0,r.handleServiceWorkerException)(e)}}let c=yield(0,o.l)(e);for(let e=0;e<c.length;e++)r.ConnectionData.AddConnection(c[e]);let a=yield r.ConnectionData.GetConnectionsOfConcept(e),l=yield(0,r.GetConceptByCharacter)(t),d=[];for(let e=0;e<a.length;e++)a[e].typeId==l.id&&d.push(a[e]);let u=!1;for(let e=0;e<d.length;e++)u=yield(0,r.DeleteConnectionById)(d[e].id);return r.Logger.logUpdate(i),u})}function u(e,t){var n=arguments;return l(this,void 0,void 0,function*(){const i=r.Logger.logfunction("DeleteConnectionByTypeBulk",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByTypeBulk",{id:e,linkers:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByTypeBulk sw error: ",e),(0,s.ey)(i,"DeleteConnectionByTypeBulk",e),(0,r.handleServiceWorkerException)(e)}}let l=yield(0,o.l)(e);for(let e=0;e<l.length;e++)r.ConnectionData.AddConnection(l[e]);let d=yield r.ConnectionData.GetConnectionsOfConcept(e),u=[];u=yield(0,c.Hi)(t);let h=[];console.log("this is all the connections for deleting taken",d,u,t);for(let e=0;e<d.length;e++)for(let t=0;t<u.length;t++)d[e].typeId==u[t].id&&h.push(d[e].id);return console.log("these are the to delete",h),r.Logger.logUpdate(i),yield(0,a.E)(h)})}function h(e,t){return l(this,arguments,void 0,function*(e,t,n=!1){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetAllTheConnectionsByTypeAndOfTheConcept",{id:e,linker:t,reverse:n})).data}catch(e){console.error("GetAllTheConnectionsByTypeAndOfTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let s=[];if(n){let n=yield(0,i.W)(e),o=yield(0,r.MakeTheTypeConceptApi)(t,999);for(let e=0;e<n.length;e++)n[e].typeId==o.id&&s.push(n[e])}else{let n=yield(0,o.l)(e);for(let e=0;e<n.length;e++)r.ConnectionData.AddConnection(n[e]);let i=yield r.ConnectionData.GetConnectionsOfConcept(e),c=yield(0,r.GetConceptByCharacter)(t);for(let e=0;e<i.length;e++)i[e].typeId==c.id&&s.push(i[e])}return s})}},2299:(e,t,n)=>{n.d(t,{B:()=>o});class o{constructor(e){this.id=1,this.isOnlineSync=!1,this.isOnlineSync=e}}},2515:(e,t,n)=>{n.d(t,{x:()=>o});class o{constructor(e,t,n,o){this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return e;var n=!1;for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}addNode(e,t,n){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}addCharacterNode(e,t,n){if(""!=e.value.characterValue){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addCharacterNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&""!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addCharacterNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}updateNodeSyncStatus(e,t,n){if(n){if(e==n.key){let e=n.value;return e.isSynced=t,n.value=e,n}return e<n.key?this.updateNodeSyncStatus(e,t,n.leftNode):e>n.key?this.updateNodeSyncStatus(e,t,n.rightNode):n}return n}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getFromNodeWithCharacterAndType(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.typeId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.typeId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndType(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndType(e,t,n.rightNode)}return null}return n}getFromNodeWithCharacterAndCategory(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.categoryId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.categoryId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.rightNode)}return null}return n}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var n=this.inOrderSuccessor(e.rightNode);return e.value=n.value,e.key=n.key,e.variants=n.variants,e.currentNode=n.currentNode,e.rightNode=this.removeNode(e.rightNode,n.key),e}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){var o=e.variants[0];if(o)return e.value=o.value,e.key=o.key,e.currentNode=o.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var i=this.inOrderSuccessor(e.rightNode);return e.value=i.value,e.key=i.key,e.variants=i.variants,e.currentNode=i.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,i.key,n),e}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}},2615:(e,t,n)=>{n.d(t,{j:()=>i});var o=n(9311);class i{constructor(e,t,n,i,r,s,c,a=!1,l,d,u){this.count=0,this.typeCharacter="",this.referent=null,this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=o.BaseUrl.getRandomizer(),this.x=0,this.y=0,this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=i,this.referentId=r,this.characterValue=`${s}`,this.accessId=c,this.typeCharacter=u,this.type=null,this.isNew=a,this.entryTimeStamp=l,this.updatedTimeStamp=d}getType(){console.log(this.typeId)}}},2648:(e,t,n)=>{t.__esModule=!0,t.FIELDS=void 0,t.default=function(e){var t,n,o,i,s,c,a,l,d,h,p,f,v=[],y=e.css.valueOf(),g=y.length,m=-1,C=1,w=0,I=0;function T(t,n){if(!e.safe)throw e.error("Unclosed "+t,C,w-m,w);l=(y+=n).length-1}for(;w<g;){switch((t=y.charCodeAt(w))===r.newline&&(m=w,C+=1),t){case r.space:case r.tab:case r.newline:case r.cr:case r.feed:l=w;do{l+=1,(t=y.charCodeAt(l))===r.newline&&(m=l,C+=1)}while(t===r.space||t===r.newline||t===r.tab||t===r.cr||t===r.feed);f=r.space,o=C,n=l-m-1,I=l;break;case r.plus:case r.greaterThan:case r.tilde:case r.pipe:l=w;do{l+=1,t=y.charCodeAt(l)}while(t===r.plus||t===r.greaterThan||t===r.tilde||t===r.pipe);f=r.combinator,o=C,n=w-m,I=l;break;case r.asterisk:case r.ampersand:case r.bang:case r.comma:case r.equals:case r.dollar:case r.caret:case r.openSquare:case r.closeSquare:case r.colon:case r.semicolon:case r.openParenthesis:case r.closeParenthesis:f=t,o=C,n=w-m,I=(l=w)+1;break;case r.singleQuote:case r.doubleQuote:p=t===r.singleQuote?"'":'"',l=w;do{for(i=!1,-1===(l=y.indexOf(p,l+1))&&T("quote",p),s=l;y.charCodeAt(s-1)===r.backslash;)s-=1,i=!i}while(i);f=r.str,o=C,n=w-m,I=l+1;break;default:t===r.slash&&y.charCodeAt(w+1)===r.asterisk?(0===(l=y.indexOf("*/",w+2)+1)&&T("comment","*/"),(c=(a=y.slice(w,l+1).split("\n")).length-1)>0?(d=C+c,h=l-a[c].length):(d=C,h=m),f=r.comment,C=d,o=d,n=l-h):t===r.slash?(f=t,o=C,n=w-m,I=(l=w)+1):(l=u(y,w),f=r.word,o=C,n=l-m),I=l+1}v.push([f,C,w-m,o,n,w,I]),h&&(m=h,h=null),w=I}return v};var o,i,r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(71));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}for(var c=((o={})[r.tab]=!0,o[r.newline]=!0,o[r.cr]=!0,o[r.feed]=!0,o),a=((i={})[r.space]=!0,i[r.tab]=!0,i[r.newline]=!0,i[r.cr]=!0,i[r.feed]=!0,i[r.ampersand]=!0,i[r.asterisk]=!0,i[r.bang]=!0,i[r.comma]=!0,i[r.colon]=!0,i[r.semicolon]=!0,i[r.openParenthesis]=!0,i[r.closeParenthesis]=!0,i[r.openSquare]=!0,i[r.closeSquare]=!0,i[r.singleQuote]=!0,i[r.doubleQuote]=!0,i[r.plus]=!0,i[r.pipe]=!0,i[r.tilde]=!0,i[r.greaterThan]=!0,i[r.equals]=!0,i[r.dollar]=!0,i[r.caret]=!0,i[r.slash]=!0,i),l={},d=0;d<22;d++)l["0123456789abcdefABCDEF".charCodeAt(d)]=!0;function u(e,t){var n,o=t;do{if(n=e.charCodeAt(o),a[n])return o-1;n===r.backslash?o=h(e,o)+1:o++}while(o<e.length);return o-1}function h(e,t){var n=t,o=e.charCodeAt(n+1);if(c[o]);else if(l[o]){var i=0;do{n++,i++,o=e.charCodeAt(n+1)}while(l[o]&&i<6);i<6&&o===r.space&&n++}else n++;return n}t.FIELDS={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6}},2739:()=>{},2803:(e,t,n)=>{n.d(t,{x:()=>l});var o=n(8286),i=n(9581),r=n(3518),s=n(1863),c=n(9311),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n){var l=arguments;return a(this,void 0,void 0,function*(){const a=c.Logger.logfunction("GetCompositionConnectionsBetweenTwoConcepts",l)||{};var d=[];try{if(c.serviceWorker){a.serviceWorker=!0;try{const o=yield(0,c.sendMessage)("GetCompositionConnectionsBetweenTwoConcepts",{ofConceptId:e,toConcept:t,mainKey:n});return c.Logger.logUpdate(a),o.data}catch(e){console.error("GetCompositionConnectionsBetweenTwoConcepts sw error: ",e),(0,s.ey)(a,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,c.handleServiceWorkerException)(e)}}var u=new FormData;u.append("ofConceptId",e.toString()),u.append("mainKey",n.toString()),u.append("toConceptId",t.toString());const l=yield(0,r.Xr)("","application/json"),p=yield fetch(i.B.GetCompositionConnectionBetweenTwoConceptsUrl(),{method:"POST",headers:l,body:u,redirect:"follow"});if(p.ok){const e=yield p.json();for(var h=0;h<e.length;h++)o.d.AddConnection(e[h]),d.push(e[h]);c.Logger.logUpdate(a)}else console.log("Get composition connection between two concepts",p.status),(0,s.ry)(p)}catch(e){e instanceof Error?console.log("Get composition connection between two concepts error message: ",e.message):console.log("Get composition connection between two concepts unexpected error: ",e),(0,s.Mb)(e,i.B.GetCompositionConnectionBetweenTwoConceptsUrl()),(0,s.ey)(a,"GetCompositionConnectionsBetweenTwoConcepts",e)}return d})}},2832:(e,t,n)=>{n.d(t,{j:()=>a});var o=n(9311),i=n(9581),r=n(1863),s=n(3518),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function a(e){var t=arguments;return c(this,arguments,void 0,function*(e,n=""){const c=o.Logger.logfunction("SearchLinkMultipleApi",t);let a=performance.now();var l=(0,s.ab)("application/json",n);const d=i.B.SearchLinkMultipleAllApiUrl(),u=JSON.stringify(e);try{const t=yield fetch(d,{method:"POST",headers:l,body:u});if(t.ok){let e=yield t.json();return o.Logger.logUpdate(c),e}return(0,r.ry)(t),console.log("This is the searching multiple error",t.status),o.Logger.logError(a,"unknown","search","unknown",void 0,t.status,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),[]}catch(t){console.log("This is the searching multiple error",t),o.Logger.logError(a,"unknown","search","unknown",void 0,500,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),(0,r.Mb)(t,d),(0,r.ey)(c,"SearchLinkMultipleApi",t)}})}},2895:(e,t,n)=>{let o=n(396),i=n(9371),r=n(7793),s=n(3614),c=n(5238),a=n(145),l=n(3438),d=n(1106),u=n(6966),h=n(1752),p=n(3152),f=n(9577),v=n(6846),y=n(3717),g=n(5644),m=n(1534),C=n(3303),w=n(38);function I(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new v(e)}I.plugin=function(e,t){let n,o=!1;function i(...n){console&&console.warn&&!o&&(o=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new v).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return I([i(n)]).process(e,t)},i},I.stringify=C,I.parse=f,I.fromJSON=l,I.list=h,I.comment=e=>new i(e),I.atRule=e=>new o(e),I.decl=e=>new c(e),I.rule=e=>new m(e),I.root=e=>new g(e),I.document=e=>new a(e),I.CssSyntaxError=s,I.Declaration=c,I.Container=r,I.Processor=v,I.Document=a,I.Comment=i,I.Warning=w,I.AtRule=o,I.Result=y,I.Input=d,I.Rule=m,I.Root=g,I.Node=p,u.registerPostcss(I),e.exports=I,I.default=I},2918:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.NESTING,n.value="&",n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},3026:(e,t,n)=>{n.d(t,{I:()=>f});var o=n(3655),i=n(2202),r=n(6963),s=n(5457),c=n(7282),a=n(9311);class l{constructor(e,t,n,o){this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.rightNode=this.removeNode(e.rightNode,t.key),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class u{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addWidgetToTree(e){let t=new l(e.widgetId,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return d(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return d(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}u.root=null;class h{constructor(){this.widgetId=0,this.mainId=0,this.conceptIds=[],this.linkers=[],this.reverse=[],this.mainCompositionIds=[],this.countinfo=[]}}var p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class f{constructor(){this.name="conceptsArray"}static CheckContains(e){for(var t=!1,n=0;n<this.conceptsArray.length;n++)this.conceptsArray[n].id==e.id&&(t=!0);return t}static AddNpc(e){this.NPC.includes(e)||(this.NPC.length>10&&(this.NPC=[]),this.NPC.push(e))}static GetNpc(e){return!!this.NPC.includes(e)}static AddConceptToStorage(e){e.id>0&&(0,o.kH)("concept",e)}static GetConceptBulkData(e,t,n){return p(this,void 0,void 0,function*(){yield i.W.getConceptListFromIds(e,t,n)})}static AddWidget(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddWidget",{widgetDetails:e})}catch(e){console.error("Concept Data, Add Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.widgetId>0&&u.addWidgetToTree(e)}static AddConcept(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddConcept",{concept:e})}catch(e){console.error("Concept Data, Add Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.id>0&&(i.W.addConceptToTree(e),s.c.addConceptToTree(e))}static AddConceptToMemory(e){e.id>0&&(i.W.addConceptToTree(e),s.c.addConceptToTree(e))}static AddConceptTemporary(e){var t=this.CheckContains(e);this.conceptDictionary[e.id]=e,t&&this.RemoveConcept(e),this.conceptsArray.push(e)}static RemoveConcept(e){for(var t=0;t<this.conceptsArray.length;t++)this.conceptsArray[t].id==e.id&&this.conceptsArray.splice(t,1);(0,o.wh)("concept",e.id)}static GetWidget(e){return p(this,void 0,void 0,function*(){let t=new h;if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetWidget",{id:e})).data}catch(e){console.error("Concept Data, Get Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}let n=yield u.getNodeFromTree(e);return null!=n&&(t=n.value),t})}static RemoveWidget(e){return p(this,void 0,void 0,function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__RemoveWidget",{id:e})).data}catch(e){console.error("Concept Data, Remove Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}yield u.removeNodeFromTree(e)})}static GetConcept(e){return p(this,void 0,void 0,function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConcept",{id:e})).data}catch(e){console.error("Concept Data, Get Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}if(0==e||null==e||null==e)return(0,c.o)();var t=(0,c.o)(),n=yield i.W.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static GetConceptByCharacter(e){return p(this,void 0,void 0,function*(){var t=(0,c.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterUpdated(e){return p(this,void 0,void 0,function*(){var t=(0,c.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterAndTypeLocal(e,t){return p(this,void 0,void 0,function*(){return(0,c.o)(),yield s.c.getTypeVariantsWithCharacterValueNew(e,t)})}static GetConceptByCharacterAndCategoryLocal(e,t){return p(this,void 0,void 0,function*(){var n=(0,c.o)(),o=yield r.f.getCharacterAndCategoryFromTree(e,t);return o&&(n=o.value),n})}static GetConceptsByTypeId(e){let t=[];for(var n=0;n<this.conceptsArray.length;n++)this.conceptsArray[n].typeId==e&&t.push(this.conceptsArray[n]);return t}static GetConceptsByTypeIdAndUser(e,t){var n=arguments;return p(this,void 0,void 0,function*(){if(a.Logger.logfunction("ConceptsData.GetConceptsByTypeIdAndUser",n),a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConceptsByTypeIdAndUser",{typeId:e,userId:t})).data}catch(e){console.error("Concept Data, Get Concpet sw error:",e),(0,a.handleServiceWorkerException)(e)}let o=[];return o=yield s.c.getTypeVariantsFromTreeWithUserIdNew(e,t),o})}static GetBinaryCharacterTree(){return r.f.characterRoot}getName(){return this.name}}f.conceptsArray=[],f.NPC=[],f.conceptDictionary=[]},3075:(e,t,n)=>{n.d(t,{Ay:()=>d,EO:()=>u,xd:()=>h});var o=n(205),i=n(9736),r=n(5257),s=n(9003),c=n(9311),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(){return l(this,void 0,void 0,function*(){const e=c.Logger.logfunction("CreateLocalBinaryTreeFromIndexDb");try{let t=[];if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];i.v.AddConceptToMemory(n)}o.B.isLocalDataLoaded=!0,o.B.isLocalTypeLoaded=!0,o.B.isLocalCharacterLoaded=!0,c.Logger.logUpdate(e)}catch(t){yield(0,c.DelayFunctionExecution)(2e3,d());let n={message:"Cannot create local binary tree from index db",data:t,ok:!1,status:400};throw(0,a.ey)(e,"CreateLocalBinaryTreeFromIndexDb",t),n}})}function u(){return l(this,void 0,void 0,function*(){var e;const t=c.Logger.logfunction("PopulateTheLocalConceptsToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",e=>l(this,void 0,void 0,function*(){let e=yield(0,s.S5)("localid");if(Array.isArray(e)){if(e[0]){let t=e[0].value;if(t)r.R.AddConceptId(e[0]),yield(0,s.kH)("localid",{id:0,value:t-10});else{t=-Math.floor(1e8*Math.random());let e={id:0,value:t},n={id:0,value:t-10};r.R.AddConceptId(e),yield(0,s.kH)("localid",n)}}e[2]}})),c.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConceptsToMemory",e),n}})}function h(){return l(this,void 0,void 0,function*(){var e;const t=c.Logger.logfunction("PopulateTheLocalConnectionToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",e=>l(this,void 0,void 0,function*(){let e=yield(0,s.S5)("localid");if(Array.isArray(e)){if(e[1]){let t=e[1].value;if(t)r.R.AddConnectionId(e[1]),yield(0,s.kH)("localid",{id:1,value:t-10});else{t=-Math.floor(1e8*Math.random());let e={id:0,value:t},n={id:0,value:t-10};r.R.AddConnectionId(e),yield(0,s.kH)("localid",n)}}e[2]}})),c.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConnectionToMemory",e),n}})}},3077:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(9311),i=n(2615),r=n(9736),s=n(5257),c=n(9700),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n,l,d,u){return a(this,arguments,void 0,function*(e,t,n,a,l,d,u=!1,h=0,p={concepts:[],connections:[]}){var f,v,y,g;let m=performance.now();try{if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("CreateTheConceptLocal",{referent:e,typecharacter:t,userId:n,categoryId:a,typeId:l,accessId:d,isComposition:u,referentId:h});return(null===(v=null===(f=null==i?void 0:i.actions)||void 0===f?void 0:f.concepts)||void 0===v?void 0:v.length)&&(p.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(g=null===(y=null==i?void 0:i.actions)||void 0===y?void 0:y.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("CreateTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let c=yield s.R.getConceptId(),m=!0,C=new Date,w=new Date;if("the"==e)return new i.j(1,999,5,5,h,e,d,m,C,w,t);let I=new i.j(c,n,l,a,h,e,d,m,C,w,t);return I.isTemp=!0,I.isComposition=u,r.v.AddConcept(I),p.concepts.push(I),I}catch(o){throw c.V.logError(m,n,"create","unknown","unknown",500,void 0,"createTheConceptLocal",[e,t,n,a,l,d,u],void 0),o}})}},3130:(e,t,n)=>{n.d(t,{BG:()=>a,SL:()=>l,XZ:()=>c,ZJ:()=>r,iw:()=>s,pU:()=>d,y0:()=>i,yv:()=>o});const o=1,i=2,r=3,s=4,c=5,a=6,l=7,d=8},3152:(e,t,n)=>{let o=n(3614),i=n(7668),r=n(3303),{isClean:s,my:c}=n(4151);function a(e,t){let n=new e.constructor;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;if("proxyCache"===o)continue;let i=e[o],r=typeof i;"parent"===o&&"object"===r?t&&(n[o]=t):"source"===o?n[o]=i:Array.isArray(i)?n[o]=i.map(e=>a(e,n)):("object"===r&&null!==i&&(i=a(i)),n[o]=i)}return n}function l(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,o=1,i=0;for(let r=0;r<e.length;r++){if(o===t.line&&n===t.column){i=r;break}"\n"===e[r]?(n=1,o+=1):n+=1}return i}class d{get proxyOf(){return this}constructor(e={}){this.raws={},this[s]=!1,this[c]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:o}=this.rangeBy(t);return this.source.input.error(e,{column:o.column,line:o.line},{column:n.column,line:n.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,o=n.slice(l(n,this.source.start),l(n,this.source.end)).indexOf(e.word);-1!==o&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,i=l(o,this.source.start),r=i+e;for(let e=i;e<r;e++)"\n"===o[e]?(t=1,n+=1):t+=1;return{column:t,line:n,offset:r}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:l(t,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:l(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let i=t.slice(l(t,this.source.start),l(t,this.source.end)).indexOf(e.word);-1!==i&&(n=this.positionInside(i),o=this.positionInside(i+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:l(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line,offset:l(t,e.end)}:"number"==typeof e.endIndex?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<n.line||o.line===n.line&&o.column<=n.column)&&(o={column:n.column+1,line:n.line,offset:n.offset+1}),{end:o,start:n}}raw(e,t){return(new i).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},o=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){if(null==o)continue;let r=t.get(o.input);null==r&&(r=i,t.set(o.input,i),i++),n[e]={end:o.end,inputId:r,start:o.start}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=r){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n={}){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}}e.exports=d,d.default=d},3256:(e,t,n)=>{n.d(t,{xJ:()=>v,Cp:()=>f,qj:()=>y,ml:()=>g,ix:()=>m});var o=n(9311),i=n(1596),r=n(4698),s=n(1863),c=n(1320),a=n(3518);class l{static getWidget(e){return this._get(this.WIDGET_PREFIX+e)}static setWidget(e,t){this._set(this.WIDGET_PREFIX+e,t)}static getLatest(e){return this._get(this.LATEST_PREFIX+e)}static setLatest(e,t){this._set(this.LATEST_PREFIX+e,t)}static getRecent(e){return this._get(this.RECENT_PREFIX+e)}static setRecent(e,t){this._set(this.RECENT_PREFIX+e,t)}static removeWidget(e){localStorage.removeItem(this.WIDGET_PREFIX+e)}static removeLatest(e){localStorage.removeItem(this.LATEST_PREFIX+e)}static removeRecent(e){localStorage.removeItem(this.RECENT_PREFIX+e)}static clearAll(){const e=[this.WIDGET_PREFIX,this.LATEST_PREFIX,this.RECENT_PREFIX];Object.keys(localStorage).filter(t=>e.some(e=>t.startsWith(e))).forEach(e=>localStorage.removeItem(e))}static _get(e){const t=localStorage.getItem(e);return t?JSON.parse(t):null}static _set(e,t){const n=JSON.stringify(t);localStorage.getItem(e)!==n&&localStorage.setItem(e,n)}}l.WIDGET_PREFIX="WIDGET_CACHE_",l.LATEST_PREFIX="WIDGET_LATEST_CACHE_",l.RECENT_PREFIX="WIDGET_RECENT_CACHE_";var d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const u=new Map,h=new Map,p=new Map;function f(e){var t=arguments;return d(this,void 0,void 0,function*(){o.Logger.logfunction("BuildWidgetFromId",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromId",{id:e})).data}catch(e){console.error("BuildWidgetFromId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(u.has(e))return u.get(e)||n;let i=(0,a.Xr)("application/json"),h=o.BaseUrl.getWidgetData()+"?id="+e;const p=l.getWidget(e);if(p){fetch(h,{method:"GET",headers:i}).then(t=>d(this,void 0,void 0,function*(){if(t.ok){const n=yield t.json();l.setWidget(e,n)}else(0,s.ry)(t)})).catch(()=>{});let t=(0,r.w)(p.countinfo);return yield(0,c.e$)(p.linkers,p.conceptIds,p.mainCompositionIds,p.reverse,t,"DESC")}const f=(()=>d(this,void 0,void 0,function*(){try{const t=yield fetch(h,{method:"GET",headers:i});if(t.ok){let o=yield t.json();l.setWidget(e,o);let i=(0,r.w)(o.countinfo);return n=yield(0,c.e$)(o.linkers,o.conceptIds,o.mainCompositionIds,o.reverse,i,"DESC"),n}return(0,s.ry)(t),[]}catch(e){throw e}finally{u.delete(e)}}))();return u.set(e,f),f})}function v(e){return d(this,void 0,void 0,function*(){try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromCache",{id:e})).data}catch(e){console.error("BuildWidgetFromCache error sw: ",e),(0,o.handleServiceWorkerException)(e)}let t={data:null,mainId:0},n=yield o.ConceptsData.GetWidget(e);if(n.widgetId>0){let e="DESC",o=n.conceptIds,i=n.linkers,s=n.reverse,a=n.mainCompositionIds,l=n.countinfo,d=(0,r.w)(l);t={data:yield(0,c.e$)(i,o,a,s,d,e),mainId:n.mainId}}return t})}function y(e){var t=arguments;return d(this,void 0,void 0,function*(){o.Logger.logfunction("BuildWidgetFromIdForLatest",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromIdForLatest",{id:e})).data}catch(e){console.error("BuildWidgetFromIdForLatest error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(h.has(e))return h.get(e)||n;let u=(0,a.Xr)("application/json");const p=l.getLatest(e);if(p){(()=>d(this,void 0,void 0,function*(){let t;try{let n=o.BaseUrl.getLatestWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:u})}catch(n){t=yield(0,i.g)({method:"GET",headers:u},"?id="+e)}if(t.ok){const n=yield t.json();l.setLatest(e,n)}else(0,s.ry)(t)}))().catch(()=>{});let t=(0,r.w)(p.countinfo);return{data:yield(0,c.e$)(p.linkers,p.conceptIds,p.mainCompositionIds,p.reverse,t,"DESC"),mainId:p.mainId}}const f=(()=>d(this,void 0,void 0,function*(){try{let t;try{let n=o.BaseUrl.getLatestWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:u})}catch(n){t=yield(0,i.g)({method:"GET",headers:u},"?id="+e)}if(t.ok){let o=yield t.json();l.setLatest(e,o);let i=(0,r.w)(o.countinfo);return n=yield(0,c.e$)(o.linkers,o.conceptIds,o.mainCompositionIds,o.reverse,i,"DESC"),{data:n,mainId:o.mainId}}return(0,s.ry)(t),[]}catch(e){throw e}finally{h.delete(e)}}))();return h.set(e,f),f})}function g(e){var t=arguments;return d(this,void 0,void 0,function*(){o.Logger.logfunction("BuildWidgetFromIdForRecent",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromIdForRecent",{id:e})).data}catch(e){console.error("BuildWidgetFromIdForRecent error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(p.has(e))return p.get(e)||n;let u=(0,a.Xr)("application/json");const h=l.getRecent(e);if(h){(()=>d(this,void 0,void 0,function*(){let t;try{let n=o.BaseUrl.getRecentWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:u})}catch(n){t=yield(0,i.g)({method:"GET",headers:u},"?id="+e)}if(t.ok){const n=yield t.json();l.setRecent(e,n)}else(0,s.ry)(t)}))().catch(()=>{});let t=(0,r.w)(h.countinfo);return{data:yield(0,c.e$)(h.linkers,h.conceptIds,h.mainCompositionIds,h.reverse,t,"DESC"),mainId:h.mainId}}const f=(()=>d(this,void 0,void 0,function*(){try{let t;try{let n=o.BaseUrl.getRecentWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:u})}catch(n){t=yield(0,i.g)({method:"GET",headers:u},"?id="+e)}if(t.ok){let o=yield t.json();l.setRecent(e,o);let i=(0,r.w)(o.countinfo);return n=yield(0,c.e$)(o.linkers,o.conceptIds,o.mainCompositionIds,o.reverse,i,"DESC"),{data:n,mainId:o.mainId}}return(0,s.ry)(t),[]}catch(e){throw e}finally{p.delete(e)}}))();return p.set(e,f),f})}function m(e,t){for(let n=0;n<e.length;n++)if(e[n].id==t)return e[n]}},3278:(e,t,n)=>{n.d(t,{b:()=>o});class o{static setSession(e){e&&(o.sessionId=e)}}o.BearerAccessToken="",o.sessionId=998},3295:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=r(n(8937)),i=n(9606);function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var a=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n);var a,l,d=r.prototype;return d.qualifiedName=function(e){return this.namespace?this.namespaceString+"|"+e:e},d.valueToString=function(){return this.qualifiedName(e.prototype.valueToString.call(this))},a=r,(l=[{key:"namespace",get:function(){return this._namespace},set:function(e){if(!0===e||"*"===e||"&"===e)return this._namespace=e,void(this.raws&&delete this.raws.namespace);var t=(0,o.default)(e,{isIdentifier:!0});this._namespace=e,t!==e?((0,i.ensureObject)(this,"raws"),this.raws.namespace=t):this.raws&&delete this.raws.namespace}},{key:"ns",get:function(){return this._namespace},set:function(e){this.namespace=e}},{key:"namespaceString",get:function(){if(this.namespace){var e=this.stringifyProperty("namespace");return!0===e?"":e}return""}}])&&s(a.prototype,l),Object.defineProperty(a,"prototype",{writable:!1}),r}(r(n(4646)).default);t.default=a,e.exports=t.default},3303:(e,t,n)=>{let o=n(7668);function i(e,t){new o(t).stringify(e)}e.exports=i,i.default=i},3438:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(1106),c=n(3878),a=n(5644),l=n(1534);function d(e,t){if(Array.isArray(e))return e.map(e=>d(e));let{inputs:n,...u}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:s.prototype};n.map&&(n.map={...n.map,__proto__:c.prototype}),t.push(n)}}if(u.nodes&&(u.nodes=e.nodes.map(e=>d(e,t))),u.source){let{inputId:e,...n}=u.source;u.source=n,null!=e&&(u.source.input=t[e])}if("root"===u.type)return new a(u);if("decl"===u.type)return new r(u);if("rule"===u.type)return new l(u);if("comment"===u.type)return new i(u);if("atrule"===u.type)return new o(u);throw new Error("Unknown node type: "+e.type)}e.exports=d,d.default=d},3518:(e,t,n)=>{n.d(t,{BZ:()=>c,Xr:()=>r,ab:()=>s});var o=n(3278),i=n(490);function r(e="application/json",t="application/json"){var n;const i={},r=o.b.BearerAccessToken,s=null===(n=o.b.sessionId)||void 0===n?void 0:n.toString();return r&&(i.Authorization=`Bearer ${r}`),e&&(i["Content-Type"]=e),t&&(i.Accept=t),i["X-Session-id"]=s,i}function s(e="application/json",t="",n="application/json"){var i;""==t&&(t=o.b.BearerAccessToken);let r={},s=null===(i=o.b.sessionId)||void 0===i?void 0:i.toString();return r=""!=t?{"Content-Type":e,Authorization:"Bearer "+t,Accept:n,"X-Session-id":s}:{"Content-Type":e,Accept:n,"X-Session-id":s},r}function c(){var e;let t=o.b.BearerAccessToken,n=null===(e=o.b.sessionId)||void 0===e?void 0:e.toString();if(""==t){let e=(0,i.s)();""!=e.token&&(o.b.BearerAccessToken=e.token,t=e.token)}let r=new Headers;return r.append("Authorization","Bearer "+t),r.append("X-Session-Id",n),r}},3604:(e,t,n)=>{let{dirname:o,relative:i,resolve:r,sep:s}=n(197),{SourceMapConsumer:c,SourceMapGenerator:a}=n(1866),{pathToFileURL:l}=n(2739),d=n(1106),u=Boolean(c&&a),h=Boolean(o&&r&&i&&s);e.exports=class{constructor(e,t,n,o){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),i=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new c(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),h&&u&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=a.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new a({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new a({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,o=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,c,a)=>{if(this.css+=s,c&&"end"!==a&&(r.generated.line=n,r.generated.column=o-1,c.source&&c.source.start?(r.source=this.sourcePath(c),r.original.line=c.source.start.line,r.original.column=c.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),o=s.length-e):o+=s.length,c&&"start"!==a){let e=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===e.last&&!e.raws.semicolon||(c.source&&c.source.end?(r.source=this.sourcePath(c),r.original.line=c.source.end.line,r.original.column=c.source.end.column-1,r.generated.line=n,r.generated.column=o-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=n,r.generated.column=o-1,this.map.addMapping(r)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(r(n,this.mapOpts.annotation)));let s=i(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new d(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let o=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(o,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(l){let t=l(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===s&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},3614:(e,t,n)=>{let o=n(8633),i=n(9746);class r extends Error{constructor(e,t,n,o,i,s){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),o&&(this.source=o),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported);let n=e=>e,r=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:c}=o.createColors(!0);r=t=>e(c(t)),n=e=>t(e),i&&(s=e=>i(e))}let c=t.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,c.length),d=String(l).length;return c.slice(a,l).map((e,t)=>{let o=a+1+t,i=" "+(" "+o).slice(-d)+" | ";if(o===this.line){if(e.length>160){let t=20,o=Math.max(0,this.column-t),c=Math.max(this.column+t,this.endColumn+t),a=e.slice(o,c),l=n(i.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return r(">")+n(i)+s(a)+"\n "+l+r("^")}let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+s(e)+"\n "+t+r("^")}return" "+n(i)+s(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=r,r.default=r},3631:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(1581));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var d=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).nodes||(n.nodes=[]),n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n);var i,s,d=o.prototype;return d.append=function(e){return e.parent=this,this.nodes.push(e),this},d.prepend=function(e){for(var t in e.parent=this,this.nodes.unshift(e),this.indexes)this.indexes[t]++;return this},d.at=function(e){return this.nodes[e]},d.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},d.removeChild=function(e){var t;for(var n in e=this.index(e),this.at(e).parent=void 0,this.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this},d.removeAll=function(){for(var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.nodes);!(e=t()).done;)e.value.parent=void 0;return this.nodes=[],this},d.empty=function(){return this.removeAll()},d.insertAfter=function(e,t){var n;t.parent=this;for(var o,i=this.index(e),r=[],s=2;s<arguments.length;s++)r.push(arguments[s]);for(var c in(n=this.nodes).splice.apply(n,[i+1,0,t].concat(r)),t.parent=this,this.indexes)i<(o=this.indexes[c])&&(this.indexes[c]=o+arguments.length-1);return this},d.insertBefore=function(e,t){var n;t.parent=this;for(var o,i=this.index(e),r=[],s=2;s<arguments.length;s++)r.push(arguments[s]);for(var c in(n=this.nodes).splice.apply(n,[i,0,t].concat(r)),t.parent=this,this.indexes)(o=this.indexes[c])>=i&&(this.indexes[c]=o+arguments.length-1);return this},d._findChildAtPosition=function(e,t){var n=void 0;return this.each(function(o){if(o.atPosition){var i=o.atPosition(e,t);if(i)return n=i,!1}else if(o.isAtPosition(e,t))return n=o,!1}),n},d.atPosition=function(e,t){return this.isAtPosition(e,t)?this._findChildAtPosition(e,t)||this:void 0},d._inferEndPosition=function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},d.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var t=this.lastEach;if(this.indexes[t]=0,this.length){for(var n,o;this.indexes[t]<this.length&&(n=this.indexes[t],!1!==(o=e(this.at(n),n)));)this.indexes[t]+=1;return delete this.indexes[t],!1!==o&&void 0}},d.walk=function(e){return this.each(function(t,n){var o=e(t,n);if(!1!==o&&t.length&&(o=t.walk(e)),!1===o)return!1})},d.walkAttributes=function(e){var t=this;return this.walk(function(n){if(n.type===r.ATTRIBUTE)return e.call(t,n)})},d.walkClasses=function(e){var t=this;return this.walk(function(n){if(n.type===r.CLASS)return e.call(t,n)})},d.walkCombinators=function(e){var t=this;return this.walk(function(n){if(n.type===r.COMBINATOR)return e.call(t,n)})},d.walkComments=function(e){var t=this;return this.walk(function(n){if(n.type===r.COMMENT)return e.call(t,n)})},d.walkIds=function(e){var t=this;return this.walk(function(n){if(n.type===r.ID)return e.call(t,n)})},d.walkNesting=function(e){var t=this;return this.walk(function(n){if(n.type===r.NESTING)return e.call(t,n)})},d.walkPseudos=function(e){var t=this;return this.walk(function(n){if(n.type===r.PSEUDO)return e.call(t,n)})},d.walkTags=function(e){var t=this;return this.walk(function(n){if(n.type===r.TAG)return e.call(t,n)})},d.walkUniversals=function(e){var t=this;return this.walk(function(n){if(n.type===r.UNIVERSAL)return e.call(t,n)})},d.split=function(e){var t=this,n=[];return this.reduce(function(o,i,r){var s=e.call(t,i);return n.push(i),s?(o.push(n),n=[]):r===t.length-1&&o.push(n),o},[])},d.map=function(e){return this.nodes.map(e)},d.reduce=function(e,t){return this.nodes.reduce(e,t)},d.every=function(e){return this.nodes.every(e)},d.some=function(e){return this.nodes.some(e)},d.filter=function(e){return this.nodes.filter(e)},d.sort=function(e){return this.nodes.sort(e)},d.toString=function(){return this.map(String).join("")},i=o,(s=[{key:"first",get:function(){return this.at(0)}},{key:"last",get:function(){return this.at(this.length-1)}},{key:"length",get:function(){return this.nodes.length}}])&&a(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=d,e.exports=t.default},3655:(e,t,n)=>{n.d(t,{El:()=>h,b8:()=>u,kH:()=>d,qI:()=>l,wh:()=>p});var o=n(2299),i=n(9581),r=n(9311),s=n(1863);let c=10;class a{}function l(e){const t=r.Logger.logfunction("openDatabase",[e,"indexdb"]);return new Promise(function(n,o){a.db&&(r.Logger.logUpdate(t),n(a.db));let d=i.B.BASE_URL+"_FreeSchema"+i.B.BASE_APPLICATION;const u=indexedDB.open(d,c);console.log("this is the update version",c,u),u.onupgradeneeded=e=>{let o=e.target.result,i="concept",s="connection",a="settings";console.log("this is the version update for index",c),o.objectStoreNames.contains(i)&&o.deleteObjectStore(i),o.objectStoreNames.contains(s)&&o.deleteObjectStore(s),o.objectStoreNames.contains(a)&&o.deleteObjectStore(a),o.objectStoreNames.contains(i)||(o.createObjectStore(i,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(s)||(o.createObjectStore(s,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(a)||(o.createObjectStore(a,{keyPath:"id"}).transaction.oncomplete=e=>{}),r.Logger.logUpdate(t),n(o)},u.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(d),l(e),(0,s.ey)(t,"openDatabase",n),o(n)},u.onsuccess=function(e){let o=e.target;a.db=o.result,r.Logger.logUpdate(t),n(a.db)}})}function d(e,t){const n=r.Logger.logfunction("UpdateToDatabase",[e,"indexdb"]);return new Promise(function(o,i){l(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{r.Logger.logUpdate(n),o(t)},a.onerror=o=>{let r={status:400,ok:!1,message:"Cannot Update to the database"+e,data:o,body:t};(0,s.ey)(n,"UpdateToDatabase",r),i(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the database",data:e};(0,s.ey)(n,"UpdateToDatabase",t),i(t)})})}function u(){const e=r.Logger.logfunction("GetLastSettingsFromDatabase",["indexdb"]);return new Promise(function(t,n){let i="settings";l(i).then(c=>{let a=c.transaction(i,"readwrite").objectStore(i).getAll();a.onsuccess=()=>{let n=new o.B(!1),i=a.result;for(let e=0;e<i.length;e++)n=i[e];r.Logger.logUpdate(e),t(n)},a.onerror=t=>{(0,s.ey)(e,"GetLastSettingsFromDatabase",t),n(t)}}).catch(t=>{let o={status:400,ok:!1,message:"Cannot get last object from database because you cannot open the database",data:t};(0,s.ey)(e,"GetLastSettingsFromDatabase",o),n(o)})})}function h(e){const t=r.Logger.logfunction("AiUpdateFlag",["indexdb"]);return new Promise(function(n,o){let i="settings";l(i).then(c=>{const a=c.transaction(i,"readwrite").objectStore(i).put(e);a.onsuccess=o=>{r.Logger.logUpdate(t),n(e)},a.onerror=n=>{let i={status:400,ok:!1,message:"Cannot update AI flag",data:n,body:e};(0,s.ey)(t,"AiUpdateFlag",i),o(i)}}).catch(e=>{let n={status:400,ok:!1,message:"Cannot update AI flag because you cannot open the database",data:e};(0,s.ey)(t,"AiUpdateFlag",n),o(n)})})}function p(e,t){const n=r.Logger.logfunction("removeFromDatabase",[e,"indexdb"]);return new Promise(function(o,i){l(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).delete(Number(t));a.onsuccess=function(e){r.Logger.logUpdate(n),o(t)},a.onerror=t=>{let o={status:400,ok:!1,message:"Cannot remove from the database"+e,data:t};(0,s.ey)(n,"removeFromDatabase",o),i(o)}}).catch(e=>{let o={status:400,ok:!1,message:"Cannot remove from the database because you cannot open the database",data:e,body:t};(0,s.ey)(n,"removeFromDatabase",o),i(o)})})}},3717:(e,t,n)=>{let o=n(38);class i{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new o(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}e.exports=i,i.default=i},3729:(e,t,n)=>{n.d(t,{D:()=>p});var o=n(9934),i=n(4485),r=n(2),s=n(7876),c=n(4818),a=n(999),l=n(5868),d=n(9311),u=n(176),h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function p(e){return h(this,arguments,void 0,function*(e,t={concepts:[],connections:[]}){var n,h,p,f;if(performance.now(),d.serviceWorker)try{const o=yield(0,d.sendMessage)("UpdateCompositionLocal",{patcherStructure:e,actions:t});return(null===(h=null===(n=null==o?void 0:o.actions)||void 0===n?void 0:n.concepts)||void 0===h?void 0:h.length)&&(t.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.connections)||void 0===f?void 0:f.length)&&(t.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.error("UpdateCompositionLocal error sw: ",e),(0,d.handleServiceWorkerException)(e)}const v=e.userId,y=e.sessionId,g=e.accessId;let m=[];const C=[];let w=(0,d.CreateDefaultLConcept)(),I=(0,d.CreateDefaultLConcept)();const T=[],k=e.compositionId,A=e.ofTheCompositionId;let S=[],N=yield(0,r.s)(k);for(let e=0;e<N.length;e++)m.push((0,u.P6)(N[e]));const _=[],b=[];let L=[];for(let e=0;e<m.length;e++)(0,o.A)(b,m[e].ofTheConceptId),(0,o.A)(_,m[e].ofTheConceptId),(0,o.A)(_,m[e].toTheConceptId),L.push(m[e].ofTheConceptId);for(let e=0;e<_.length;e++){const t=yield(0,s.A)(_[e]);k==_[e]&&(w=(0,u.F4)(t)),A==_[e]&&(I=(0,u.F4)(t)),C.push((0,u.F4)(t))}const E=e.patchObject;for(const e in E){let n=(0,d.CreateDefaultLConcept)();const o=E[e];let r=w;I.id>0&&(r=I),Array.isArray(o)||"object"==typeof o?(n=yield(0,l.k)(e,"",!0,w.userId,4,999,void 0,t),yield(0,a.R)(E[e],n.id,n.userId,w.id,w.userId,4,999,void 0,t)):n=yield(0,l.k)(e,o,!1,v,g,y,void 0,t);const s=(0,i.nm)(C,n);for(let e=0;e<s.length;e++)if(s[e].id>0){const t=(0,i.gt)(m,s[e].id);S=S.concat(t),T.push(s[e])}yield(0,d.CreateTheConnectionLocal)(r.id,n.id,w.id,2,void 0,void 0,t),C.push(n)}for(let e=0;e<S.length;e++)yield(0,c.m)(S[e].id);yield d.LocalSyncData.SyncDataOnline(void 0,t)})}},3878:(e,t,n)=>{let{existsSync:o,readFileSync:i}=n(9977),{dirname:r,join:s}=n(197),{SourceMapConsumer:c,SourceMapGenerator:a}=n(1866);class l{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,o=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new c(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return o=e.substr(n[0].length),Buffer?Buffer.from(o,"base64").toString():window.atob(o);var o;let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),o=e.indexOf("*/",n);n>-1&&o>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,o)))}loadFile(e){if(this.root=r(e),o(e))return this.mapFile=e,i(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof c)return a.fromSourceMap(t).toString();if(t instanceof a)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=s(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=l,l.default=l},3996:(e,t,n)=>{n.d(t,{i:()=>o});class o{constructor(e,t,n,o){this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}},4151:e=>{e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},4195:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=c(n(8937)),i=n(9606),r=c(n(4646)),s=n(1581);function c(e){return e&&e.__esModule?e:{default:e}}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var d=function(e){var t,n,r,c;function d(t){var n;return(n=e.call(this,t)||this).type=s.CLASS,n._constructed=!0,n}return n=e,(t=d).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n),d.prototype.valueToString=function(){return"."+e.prototype.valueToString.call(this)},r=d,(c=[{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=(0,o.default)(e,{isIdentifier:!0});t!==e?((0,i.ensureObject)(this,"raws"),this.raws.value=t):this.raws&&delete this.raws.value}this._value=e}}])&&a(r.prototype,c),Object.defineProperty(r,"prototype",{writable:!1}),d}(r.default);t.default=d,e.exports=t.default},4211:(e,t,n)=>{let o=n(3604),i=n(9577);const r=n(3717);let s=n(3303);n(6156);class c{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=i;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){let i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let c=s;this.result=new r(this._processor,i,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new o(c,i,this._opts,t);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}e.exports=c,c.default=c},4287:(e,t,n)=>{n.d(t,{w:()=>s});var o=n(9311),i=n(3130),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{constructor(){this.subscribers=[],this.mainConcept=0,this.compositionIds=[],this.conceptIds=[],this.internalConnections=[],this.reverse=[],this.linkers=[],this.newIds=[],this.dependency=[],this.isDataLoaded=!1,this.isUpdating=!1,this.fetched=!1,this.format=i.yv,this.eventHandlers={}}listenToEventType(e){if(this.eventHandlers[e])return;const t=e=>r(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return r(this,void 0,void 0,function*(){try{let n=e;if(!t.compositionIds.includes(null==n?void 0:n.detail)){t.compositionIds.unshift(null==n?void 0:n.detail),t.listenToEvent(null==n?void 0:n.detail);let e=null==n?void 0:n.detail,i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)yield o.ConnectionData.GetConnection(i[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||t.compositionIds.push(e.ofTheConceptId)})}t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw console.error("Error in typeHandler event listener:",e),t.isUpdating=!1,e}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}listenToEvent(e){if(this.eventHandlers[e])return;const t=t=>r(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return r(this,void 0,void 0,function*(){try{let n=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield o.ConnectionData.GetConnection(n[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||(t.compositionIds.push(e.ofTheConceptId),t.newIds.includes(e.ofTheConceptId)||t.newIds.push(e.ofTheConceptId))});t.isUpdating=!1,yield t.bind(),t.notify()}catch(n){throw console.error("Error in event listener for concept",e,":",n),t.isUpdating=!1,n}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}removeListenToEvent(e){const t=this.eventHandlers[e];t&&(window.removeEventListener(`${e}`,t),delete this.eventHandlers[e])}listenToEventConnectionType(e,t){const n=`${e}_type_${t}`;if(this.eventHandlers[n])return;const i=n=>r(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let n=this;setTimeout(function(){return r(this,void 0,void 0,function*(){try{let i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)i[e].typeId==t&&(yield o.ConnectionData.GetConnection(i[e]).then(e=>{e.typeId==n.mainConcept?n.internalConnections.includes(e.id)||n.internalConnections.push(e.id):n.linkers.includes(e.id)||n.linkers.push(e.id),n.conceptIds.includes(e.toTheConceptId)||n.conceptIds.push(e.toTheConceptId),n.compositionIds.includes(e.ofTheConceptId)||n.compositionIds.push(e.ofTheConceptId)}));n.isUpdating=!1,yield n.bind(),n.notify()}catch(e){throw console.error("Error in connectionType handler:",e),n.isUpdating=!1,e}})},200)}});this.eventHandlers[n]=i,window.addEventListener(`${e}`,i)}bind(){return r(this,void 0,void 0,function*(){console.log("this is the old execute data")})}run(){return r(this,void 0,void 0,function*(){console.log("this is non subscriber data")})}update(){return r(this,void 0,void 0,function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()})}subscribe(e,t){return r(this,void 0,void 0,function*(){this.subscribers.push(e);try{return yield this.bind(),e(this.data,this)}catch(e){throw console.error("Error in subscribe:",e),t&&t(e),e}})}execute(){return r(this,void 0,void 0,function*(){return yield this.run()})}unsubscribe(e){return this.subscribers.filter(t=>t!=e),this.subscribers.length}notify(){this.subscribers.map(e=>{e(this.data,this)})}}},4364:(e,t,n)=>{n.d(t,{s:()=>s});var o=n(1239),i=n(9311),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(){return r(this,arguments,void 0,function*(e=[]){const t=i.Logger.logfunction("FindConceptsFromConnections",[e.length]);let n=[];if(e.length>0){for(let t=0;t<e.length;t++)n.includes(e[t].ofTheConceptId)||n.push(e[t].ofTheConceptId),n.includes(e[t].toTheConceptId)||n.push(e[t].toTheConceptId),n.includes(e[t].typeId)||n.push(e[t].typeId);yield(0,o.r)(n)}i.Logger.logUpdate(t)})}},4402:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(9311),a=n(7876),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e,t){var n=arguments;return l(this,void 0,void 0,function*(){const l=c.Logger.logfunction("GetConceptByCharacterAndType",n);try{if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetConceptByCharacterAndType",{characterValue:e,typeId:t})).data}catch(e){console.error("GetConceptByCharacterAndType sw error: ",e),(0,c.handleServiceWorkerException)(e)}let n=yield o.I.GetConceptByCharacterAndTypeLocal(e,t);if(null==n||0==n.id){var d={character_value:`${e}`,type_id:t},u=JSON.stringify(d),h=(0,r.Xr)("application/json");const c=yield fetch(i.B.GetConceptByCharacterAndTypeUrl(),{method:"POST",headers:h,body:u});if(c.ok){let e=yield c.json();n=e,(0,a.K)(n).then(e=>{o.I.AddConcept(n)})}else(0,s.ry)(c),console.log("This is the concept by type and character error",c.status)}return c.Logger.logUpdate(l),n}catch(e){e instanceof Error?console.log(" This is the concept by type and character error message: ",e.message):console.log(" This is the concept by type and character unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptByCharacterAndTypeUrl()),(0,s.ey)(l,"GetConceptByCharacterAndType",e)}})}},4451:(e,t,n)=>{t.__esModule=!0,t.universal=t.tag=t.string=t.selector=t.root=t.pseudo=t.nesting=t.id=t.comment=t.combinator=t.className=t.attribute=void 0;var o=v(n(5588)),i=v(n(4195)),r=v(n(1704)),s=v(n(425)),c=v(n(7071)),a=v(n(2918)),l=v(n(7324)),d=v(n(518)),u=v(n(339)),h=v(n(5799)),p=v(n(9720)),f=v(n(1669));function v(e){return e&&e.__esModule?e:{default:e}}t.attribute=function(e){return new o.default(e)},t.className=function(e){return new i.default(e)},t.combinator=function(e){return new r.default(e)},t.comment=function(e){return new s.default(e)},t.id=function(e){return new c.default(e)},t.nesting=function(e){return new a.default(e)},t.pseudo=function(e){return new l.default(e)},t.root=function(e){return new d.default(e)},t.selector=function(e){return new u.default(e)},t.string=function(e){return new h.default(e)},t.tag=function(e){return new p.default(e)},t.universal=function(e){return new f.default(e)}},4485:(e,t,n)=>{function o(e=[],t){var n,o;let i=[],r=null===(n=t.type)||void 0===n?void 0:n.characterValue;if((null==r?void 0:r.startsWith("the_"))||(r="the_"+r),Array.isArray(e))for(let n=0;n<e.length;n++){let s=null===(o=e[n].type)||void 0===o?void 0:o.characterValue;(null==s?void 0:s.startsWith("the_"))||(s="the_"+s),t.typeId!=e[n].typeId&&r!=s||i.push(e[n])}return i}function i(e=[],t){let n=[],o=t.typeCharacter;if((null==o?void 0:o.startsWith("the_"))||(o="the_"+o),Array.isArray(e))for(let i=0;i<e.length;i++){let r=e[i].typeCharacter;(null==r?void 0:r.startsWith("the_"))||(r="the_"+r),t.typeId!=e[i].typeId&&o!=r||n.push(e[i])}return n}function r(e=[],t){let n=[];if(Array.isArray(e)){const o=e.find(e=>e.toTheConceptId==t);o&&n.push(o);const i=e.find(e=>e.ofTheConceptId==t);i&&n.push(i)}return n}function s(e=[],t){let n=[];if(Array.isArray(e)){const o=e.find(e=>e.toTheConceptId==t);o&&n.push(o);const i=e.find(e=>e.ofTheConceptId==t);i&&n.push(i)}return n}n.d(t,{gt:()=>s,nm:()=>i,vo:()=>o,wS:()=>r}),n(2155),n(7282)},4643:(e,t,n)=>{function o(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(o("noDeprecation"))return e;var n=!1;return function(){if(!n){if(o("throwDeprecation"))throw new Error(t);o("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},4646:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=n(9606);function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var r=function e(t,n){if("object"!=typeof t||null===t)return t;var o=new t.constructor;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];"parent"===i&&"object"==typeof r?n&&(o[i]=n):o[i]=r instanceof Array?r.map(function(t){return e(t,o)}):e(r,o)}return o},s=function(){function e(e){void 0===e&&(e={}),Object.assign(this,e),this.spaces=this.spaces||{},this.spaces.before=this.spaces.before||"",this.spaces.after=this.spaces.after||""}var t,n,s=e.prototype;return s.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},s.replaceWith=function(){if(this.parent){for(var e in arguments)this.parent.insertBefore(this,arguments[e]);this.remove()}return this},s.next=function(){return this.parent.at(this.parent.index(this)+1)},s.prev=function(){return this.parent.at(this.parent.index(this)-1)},s.clone=function(e){void 0===e&&(e={});var t=r(this);for(var n in e)t[n]=e[n];return t},s.appendToPropertyAndEscape=function(e,t,n){this.raws||(this.raws={});var o=this[e],i=this.raws[e];this[e]=o+t,i||n!==t?this.raws[e]=(i||o)+n:delete this.raws[e]},s.setPropertyAndEscape=function(e,t,n){this.raws||(this.raws={}),this[e]=t,this.raws[e]=n},s.setPropertyWithoutEscape=function(e,t){this[e]=t,this.raws&&delete this.raws[e]},s.isAtPosition=function(e,t){if(this.source&&this.source.start&&this.source.end)return!(this.source.start.line>e||this.source.end.line<e||this.source.start.line===e&&this.source.start.column>t||this.source.end.line===e&&this.source.end.column<t)},s.stringifyProperty=function(e){return this.raws&&this.raws[e]||this[e]},s.valueToString=function(){return String(this.stringifyProperty("value"))},s.toString=function(){return[this.rawSpaceBefore,this.valueToString(),this.rawSpaceAfter].join("")},t=e,(n=[{key:"rawSpaceBefore",get:function(){var e=this.raws&&this.raws.spaces&&this.raws.spaces.before;return void 0===e&&(e=this.spaces&&this.spaces.before),e||""},set:function(e){(0,o.ensureObject)(this,"raws","spaces"),this.raws.spaces.before=e}},{key:"rawSpaceAfter",get:function(){var e=this.raws&&this.raws.spaces&&this.raws.spaces.after;return void 0===e&&(e=this.spaces.after),e||""},set:function(e){(0,o.ensureObject)(this,"raws","spaces"),this.raws.spaces.after=e}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s,e.exports=t.default},4698:(e,t,n)=>{n.d(t,{V:()=>a,w:()=>c});var o=n(7139),i=n(9311),r=n(276),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e=[]){let t=[];if(e.length>0)for(let n=0;n<e.length;n++){let o=l(e[n]);t.push(o)}return t}function a(e){var t=arguments;return s(this,void 0,void 0,function*(){const n=i.Logger.logfunction("GetConnectionTypeForCount",t);let r={};for(let t=0;t<e.length;t++){let n=yield(0,o.r)(e[t].connectionTypeId);e[t].connectionType=n.characterValue,r[e[t].conceptId]=e[t]}return i.Logger.logUpdate(n),r})}function l(e){const t=e.split("_");if(3===t.length){let e=new r.y;return e.conceptId=Number(t[0]),e.connectionTypeId=Number(t[1]),e.count=Number(t[2]),e}throw new Error("Input string must contain exactly three parts separated by underscores.")}},4711:(e,t,n)=>{n.d(t,{F:()=>l,d:()=>d});var o=n(2155),i=n(4864),r=n(5257),s=n(9700),c=n(9311),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t,n){return a(this,arguments,void 0,function*(e,t,n,a=1,l="",d=999,u={concepts:[],connections:[]}){var h,p,f,v;let y=performance.now();if(c.serviceWorker)try{const o=yield(0,c.sendMessage)("CreateTheConnectionLocal",{ofTheConceptId:e,toTheConceptId:t,typeId:n,orderId:a,typeString:l,userId:d,actions:u});return(null===(p=null===(h=null==o?void 0:o.actions)||void 0===h?void 0:h.concepts)||void 0===p?void 0:p.length)&&(u.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(v=null===(f=null==o?void 0:o.actions)||void 0===f?void 0:f.connections)||void 0===v?void 0:v.length)&&(u.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.log("CreateTheConnectionLocal error sw: ",e),(0,c.handleServiceWorkerException)(e)}try{let s=4,h=yield r.R.getConnectionId(),p=0,f=0,v=0;p=e,f=t,v=n;let y=new o.N(0,0,0,0,0,0,0);return e!=t&&(y=new o.N(h,p,f,d,n,a,s),y.isTemp=!0,y.typeCharacter=l,c.LocalSyncData.AddConnection(y),i.G.AddConnection(y),u.connections.push(y)),y}catch(o){throw s.V.logError(y,d,"create","Unknown","Unknown",500,void 0,"CreateTheConnectionLocal",[e,t,n,a,l,d],"UnknownUserAgent",[]),o}})}function d(e,t,n){return a(this,arguments,void 0,function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,a;if(c.serviceWorker)try{const l=yield(0,c.sendMessage)("CreateConnection",{ofTheConcept:e,toTheConcept:t,connectionTypeString:n,actions:o});return(null===(r=null===(i=null==l?void 0:l.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(l.actions.concepts))),(null===(a=null===(s=null==l?void 0:l.actions)||void 0===s?void 0:s.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(l.actions.connections))),l.data}catch(e){console.log("CreateConnection error sw: ",e),(0,c.handleServiceWorkerException)(e)}let d=yield(0,c.MakeTheTypeConceptLocal)(n,999,999,999),u=e.userId;return yield l(e.id,t.id,d.id,1e3,n,u,o)})}},4818:(e,t,n)=>{n.d(t,{m:()=>h,E:()=>p});var o=n(9311),i=n(1863),r=n(3518),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},c=n(9581),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},l=n(5239),d=n(4864),u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function h(e){var t=arguments;return u(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteConnectionById",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionById",{id:e})).data}catch(e){console.error("DeleteConnectionById sw error: ",e),(0,o.handleServiceWorkerException)(e)}let s=!0;return e>0?(s=yield function(e){var t=arguments;return a(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteTheConnection",t);let s=!1;try{const t=new FormData;t.append("id",e.toString());let a=(0,r.BZ)();const l=yield fetch(c.B.DeleteTheConnectionUrl(),{method:"POST",headers:a,body:t,redirect:"follow"});o.Logger.logUpdate(n),l.ok?s=(yield l.json()).success:(console.log("Delete connection error status: ",l.status),(0,i.ry)(l)),s&&o.ConnectionData.AddNpConn(e)}catch(e){e instanceof Error?console.log("Delete connection error message: ",e.message):console.log("Delete connection unexpected error: ",e),(0,i.Mb)(e,c.B.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnection",e)}return s})}(e),l.O.removeNodeFromTree(e)):d.G.RemoveConnectionById(e),o.Logger.logUpdate(n),s})}function p(e){var t=arguments;return u(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteConnectionByIdBulk",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionByIdBulk",{ids:e})).data}catch(e){console.error("DeleteConnectionByIdBulk sw error: ",e),(0,o.handleServiceWorkerException)(e)}let c=yield function(e){var t=arguments;return s(this,void 0,void 0,function*(){const n=o.Logger.logfunction("DeleteTheConnectionBulkApi",t);let s=!1;try{let t=(0,r.BZ)();t.append("Content-Type","application/json");const c=yield fetch(o.BaseUrl.DeleteTheConnectionBulkUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(o.Logger.logUpdate(n),c.ok?s=(yield c.json()).success:(console.log("Delete connection Bulk Api error status: ",c.status),(0,i.ry)(c)),s)for(let t=0;t<e.length;t++){let n=e[t];o.ConnectionData.AddNpConn(n)}}catch(e){e instanceof Error?console.log("Delete connection Bulk Api error message: ",e.message):console.log("Delete connection Bulk Api unexpected error: ",e),(0,i.Mb)(e,o.BaseUrl.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnectionBulkApi",e)}return s})}(e);if(c)for(let t=0;t<e.length;t++){let n=e[t];n>0?l.O.removeNodeFromTree(n):d.G.RemoveConnectionById(n)}return o.Logger.logUpdate(n),c})}},4864:(e,t,n)=>{n.d(t,{G:()=>a});var o=n(2155),i=n(8286),r=n(205),s=n(628),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{constructor(){this.name="Connection Array"}static CheckContains(e){for(var t=!1,n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e.id&&(t=!0);return t}static AddConnection(e){this.CheckContains(e)&&this.RemoveConnection(e),e.id,this.connectionArray.push(e)}static AddConnectionToMemory(e){this.CheckContains(e)&&this.RemoveConnection(e),this.connectionArray.push(e)}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){for(var t=0;t<this.connectionArray.length;t++)this.connectionArray[t].id==e.id&&this.connectionArray.splice(t,1);e.id}static RemoveConnectionById(e){for(var t=0;t<this.connectionArray.length;t++)this.connectionArray[t].id==e&&this.connectionArray.splice(t,1);s.H.RemoveConnectionById(e)}static AddPermanentConnection(e){e.id>0&&i.d.AddConnection(function(e){let t=new o.N(0,0,0,0,0,0,0);return t.ofTheConceptId=e.ofTheConceptId,t.toTheConceptId=e.toTheConceptId,t.typeId=e.typeId,t.orderId=e.orderId,t.id=e.id,t}(e))}static GetConnection(e){var t;t=null;for(var n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e&&(t=this.connectionArray[n]);return t}static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isLocalConnectionLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static GetConnectionsOfCompositionLocal(e){return c(this,void 0,void 0,function*(){var t=[];try{for(var n=0;n<this.connectionArray.length;n++)this.connectionArray[n].typeId==e&&t.push(this.connectionArray[n]);return t}catch(e){return t}})}static GetConnectionOfCompositionAndTypeLocal(e,t){return c(this,void 0,void 0,function*(){var n=[];try{for(var o=0;o<this.connectionArray.length;o++)this.connectionArray[o].typeId==e&&this.connectionArray[o].ofTheConceptId==t&&n.push(this.connectionArray[o]);return n}catch(e){return n}})}getName(){return this.name}}a.connectionArray=[],a.connectionDictionary=[]},5020:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(9311),i=n(3026),r=n(205),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(){return s(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++){let n=e[t];i.I.AddConceptToMemory(n)}r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0}catch(e){throw yield(0,o.DelayFunctionExecution)(2e3,c()),{message:"Cannot create Binary Tree Concept",ok:!1,status:400,data:e}}})}},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",i=0|n;for(;i--;)o+=e[Math.random()*e.length|0];return o}}},5170:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i,r=A(n(518)),s=A(n(339)),c=A(n(4195)),a=A(n(425)),l=A(n(7071)),d=A(n(9720)),u=A(n(5799)),h=A(n(7324)),p=k(n(5588)),f=A(n(1669)),v=A(n(1704)),y=A(n(2918)),g=A(n(263)),m=k(n(2648)),C=k(n(71)),w=k(n(1581)),I=n(9606);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function k(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function A(e){return e&&e.__esModule?e:{default:e}}function S(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var N=((o={})[C.space]=!0,o[C.cr]=!0,o[C.feed]=!0,o[C.newline]=!0,o[C.tab]=!0,o),_=Object.assign({},N,((i={})[C.comment]=!0,i));function b(e){return{line:e[m.FIELDS.START_LINE],column:e[m.FIELDS.START_COL]}}function L(e){return{line:e[m.FIELDS.END_LINE],column:e[m.FIELDS.END_COL]}}function E(e,t,n,o){return{start:{line:e,column:t},end:{line:n,column:o}}}function x(e){return E(e[m.FIELDS.START_LINE],e[m.FIELDS.START_COL],e[m.FIELDS.END_LINE],e[m.FIELDS.END_COL])}function O(e,t){if(e)return E(e[m.FIELDS.START_LINE],e[m.FIELDS.START_COL],t[m.FIELDS.END_LINE],t[m.FIELDS.END_COL])}function B(e,t){var n=e[t];if("string"==typeof n)return-1!==n.indexOf("\\")&&((0,I.ensureObject)(e,"raws"),e[t]=(0,I.unesc)(n),void 0===e.raws[t]&&(e.raws[t]=n)),e}function R(e,t){for(var n=-1,o=[];-1!==(n=e.indexOf(t,n+1));)o.push(n);return o}var D=function(){function e(e,t){void 0===t&&(t={}),this.rule=e,this.options=Object.assign({lossy:!1,safe:!1},t),this.position=0,this.css="string"==typeof this.rule?this.rule:this.rule.selector,this.tokens=(0,m.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var n=O(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new r.default({source:n}),this.root.errorGenerator=this._errorGenerator();var o=new s.default({source:{start:{line:1,column:1}},sourceIndex:0});this.root.append(o),this.current=o,this.loop()}var t,n,o=e.prototype;return o._errorGenerator=function(){var e=this;return function(t,n){return"string"==typeof e.rule?new Error(t):e.rule.error(t,n)}},o.attribute=function(){var e=[],t=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[m.FIELDS.TYPE]!==C.closeSquare;)e.push(this.currToken),this.position++;if(this.currToken[m.FIELDS.TYPE]!==C.closeSquare)return this.expected("closing square bracket",this.currToken[m.FIELDS.START_POS]);var n=e.length,o={source:E(t[1],t[2],this.currToken[3],this.currToken[4]),sourceIndex:t[m.FIELDS.START_POS]};if(1===n&&!~[C.word].indexOf(e[0][m.FIELDS.TYPE]))return this.expected("attribute",e[0][m.FIELDS.START_POS]);for(var i=0,r="",s="",c=null,a=!1;i<n;){var l=e[i],d=this.content(l),u=e[i+1];switch(l[m.FIELDS.TYPE]){case C.space:if(a=!0,this.options.lossy)break;if(c){(0,I.ensureObject)(o,"spaces",c);var h=o.spaces[c].after||"";o.spaces[c].after=h+d;var f=(0,I.getProp)(o,"raws","spaces",c,"after")||null;f&&(o.raws.spaces[c].after=f+d)}else r+=d,s+=d;break;case C.asterisk:u[m.FIELDS.TYPE]===C.equals?(o.operator=d,c="operator"):o.namespace&&("namespace"!==c||a)||!u||(r&&((0,I.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=r,s=""),o.namespace=(o.namespace||"")+d,(0,I.getProp)(o,"raws","namespace")&&(o.raws.namespace+=d),c="namespace"),a=!1;break;case C.dollar:if("value"===c){var v=(0,I.getProp)(o,"raws","value");o.value+="$",v&&(o.raws.value=v+"$");break}case C.caret:u[m.FIELDS.TYPE]===C.equals&&(o.operator=d,c="operator"),a=!1;break;case C.combinator:if("~"===d&&u[m.FIELDS.TYPE]===C.equals&&(o.operator=d,c="operator"),"|"!==d){a=!1;break}u[m.FIELDS.TYPE]===C.equals?(o.operator=d,c="operator"):o.namespace||o.attribute||(o.namespace=!0),a=!1;break;case C.word:if(u&&"|"===this.content(u)&&e[i+2]&&e[i+2][m.FIELDS.TYPE]!==C.equals&&!o.operator&&!o.namespace)o.namespace=d,c="namespace";else if(!o.attribute||"attribute"===c&&!a)r&&((0,I.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=s,s=""),o.attribute=(o.attribute||"")+d,(0,I.getProp)(o,"raws","attribute")&&(o.raws.attribute+=d),c="attribute";else if(!o.value&&""!==o.value||"value"===c&&!a&&!o.quoteMark){var y=(0,I.unesc)(d),g=(0,I.getProp)(o,"raws","value")||"",w=o.value||"";o.value=w+y,o.quoteMark=null,(y!==d||g)&&((0,I.ensureObject)(o,"raws"),o.raws.value=(g||w)+d),c="value"}else{var T="i"===d||"I"===d;!o.value&&""!==o.value||!o.quoteMark&&!a?(o.value||""===o.value)&&(c="value",o.value+=d,o.raws.value&&(o.raws.value+=d)):(o.insensitive=T,T&&"I"!==d||((0,I.ensureObject)(o,"raws"),o.raws.insensitiveFlag=d),c="insensitive",r&&((0,I.ensureObject)(o,"spaces","insensitive"),o.spaces.insensitive.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","insensitive"),o.raws.spaces.insensitive.before=s,s=""))}a=!1;break;case C.str:if(!o.attribute||!o.operator)return this.error("Expected an attribute followed by an operator preceding the string.",{index:l[m.FIELDS.START_POS]});var k=(0,p.unescapeValue)(d),A=k.unescaped,S=k.quoteMark;o.value=A,o.quoteMark=S,c="value",(0,I.ensureObject)(o,"raws"),o.raws.value=d,a=!1;break;case C.equals:if(!o.attribute)return this.expected("attribute",l[m.FIELDS.START_POS],d);if(o.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:l[m.FIELDS.START_POS]});o.operator=o.operator?o.operator+d:d,c="operator",a=!1;break;case C.comment:if(c)if(a||u&&u[m.FIELDS.TYPE]===C.space||"insensitive"===c){var N=(0,I.getProp)(o,"spaces",c,"after")||"",_=(0,I.getProp)(o,"raws","spaces",c,"after")||N;(0,I.ensureObject)(o,"raws","spaces",c),o.raws.spaces[c].after=_+d}else{var b=o[c]||"",L=(0,I.getProp)(o,"raws",c)||b;(0,I.ensureObject)(o,"raws"),o.raws[c]=L+d}else s+=d;break;default:return this.error('Unexpected "'+d+'" found.',{index:l[m.FIELDS.START_POS]})}i++}B(o,"attribute"),B(o,"namespace"),this.newNode(new p.default(o)),this.position++},o.parseWhitespaceEquivalentTokens=function(e){e<0&&(e=this.tokens.length);var t=this.position,n=[],o="",i=void 0;do{if(N[this.currToken[m.FIELDS.TYPE]])this.options.lossy||(o+=this.content());else if(this.currToken[m.FIELDS.TYPE]===C.comment){var r={};o&&(r.before=o,o=""),i=new a.default({value:this.content(),source:x(this.currToken),sourceIndex:this.currToken[m.FIELDS.START_POS],spaces:r}),n.push(i)}}while(++this.position<e);if(o)if(i)i.spaces.after=o;else if(!this.options.lossy){var s=this.tokens[t],c=this.tokens[this.position-1];n.push(new u.default({value:"",source:E(s[m.FIELDS.START_LINE],s[m.FIELDS.START_COL],c[m.FIELDS.END_LINE],c[m.FIELDS.END_COL]),sourceIndex:s[m.FIELDS.START_POS],spaces:{before:o,after:""}}))}return n},o.convertWhitespaceNodesToSpace=function(e,t){var n=this;void 0===t&&(t=!1);var o="",i="";return e.forEach(function(e){var r=n.lossySpace(e.spaces.before,t),s=n.lossySpace(e.rawSpaceBefore,t);o+=r+n.lossySpace(e.spaces.after,t&&0===r.length),i+=r+e.value+n.lossySpace(e.rawSpaceAfter,t&&0===s.length)}),i===o&&(i=void 0),{space:o,rawSpace:i}},o.isNamedCombinator=function(e){return void 0===e&&(e=this.position),this.tokens[e+0]&&this.tokens[e+0][m.FIELDS.TYPE]===C.slash&&this.tokens[e+1]&&this.tokens[e+1][m.FIELDS.TYPE]===C.word&&this.tokens[e+2]&&this.tokens[e+2][m.FIELDS.TYPE]===C.slash},o.namedCombinator=function(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]),t=(0,I.unesc)(e).toLowerCase(),n={};t!==e&&(n.value="/"+e+"/");var o=new v.default({value:"/"+t+"/",source:E(this.currToken[m.FIELDS.START_LINE],this.currToken[m.FIELDS.START_COL],this.tokens[this.position+2][m.FIELDS.END_LINE],this.tokens[this.position+2][m.FIELDS.END_COL]),sourceIndex:this.currToken[m.FIELDS.START_POS],raws:n});return this.position=this.position+3,o}this.unexpected()},o.combinator=function(){var e=this;if("|"===this.content())return this.namespace();var t=this.locateNextMeaningfulToken(this.position);if(!(t<0||this.tokens[t][m.FIELDS.TYPE]===C.comma||this.tokens[t][m.FIELDS.TYPE]===C.closeParenthesis)){var n,o=this.currToken,i=void 0;if(t>this.position&&(i=this.parseWhitespaceEquivalentTokens(t)),this.isNamedCombinator()?n=this.namedCombinator():this.currToken[m.FIELDS.TYPE]===C.combinator?(n=new v.default({value:this.content(),source:x(this.currToken),sourceIndex:this.currToken[m.FIELDS.START_POS]}),this.position++):N[this.currToken[m.FIELDS.TYPE]]||i||this.unexpected(),n){if(i){var r=this.convertWhitespaceNodesToSpace(i),s=r.space,c=r.rawSpace;n.spaces.before=s,n.rawSpaceBefore=c}}else{var a=this.convertWhitespaceNodesToSpace(i,!0),l=a.space,d=a.rawSpace;d||(d=l);var u={},h={spaces:{}};l.endsWith(" ")&&d.endsWith(" ")?(u.before=l.slice(0,l.length-1),h.spaces.before=d.slice(0,d.length-1)):l.startsWith(" ")&&d.startsWith(" ")?(u.after=l.slice(1),h.spaces.after=d.slice(1)):h.value=d,n=new v.default({value:" ",source:O(o,this.tokens[this.position-1]),sourceIndex:o[m.FIELDS.START_POS],spaces:u,raws:h})}return this.currToken&&this.currToken[m.FIELDS.TYPE]===C.space&&(n.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(n)}var p=this.parseWhitespaceEquivalentTokens(t);if(p.length>0){var f=this.current.last;if(f){var y=this.convertWhitespaceNodesToSpace(p),g=y.space,w=y.rawSpace;void 0!==w&&(f.rawSpaceAfter+=w),f.spaces.after+=g}else p.forEach(function(t){return e.newNode(t)})}},o.comma=function(){if(this.position===this.tokens.length-1)return this.root.trailingComma=!0,void this.position++;this.current._inferEndPosition();var e=new s.default({source:{start:b(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][m.FIELDS.START_POS]});this.current.parent.append(e),this.current=e,this.position++},o.comment=function(){var e=this.currToken;this.newNode(new a.default({value:this.content(),source:x(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++},o.error=function(e,t){throw this.root.error(e,t)},o.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[m.FIELDS.START_POS]})},o.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[m.FIELDS.START_POS])},o.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[m.FIELDS.START_POS])},o.unexpected=function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[m.FIELDS.START_POS])},o.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[m.FIELDS.START_POS])},o.namespace=function(){var e=this.prevToken&&this.content(this.prevToken)||!0;return this.nextToken[m.FIELDS.TYPE]===C.word?(this.position++,this.word(e)):this.nextToken[m.FIELDS.TYPE]===C.asterisk?(this.position++,this.universal(e)):void this.unexpectedPipe()},o.nesting=function(){if(this.nextToken&&"|"===this.content(this.nextToken))this.position++;else{var e=this.currToken;this.newNode(new y.default({value:this.content(),source:x(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++}},o.parentheses=function(){var e=this.current.last,t=1;if(this.position++,e&&e.type===w.PSEUDO){var n=new s.default({source:{start:b(this.tokens[this.position])},sourceIndex:this.tokens[this.position][m.FIELDS.START_POS]}),o=this.current;for(e.append(n),this.current=n;this.position<this.tokens.length&&t;)this.currToken[m.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[m.FIELDS.TYPE]===C.closeParenthesis&&t--,t?this.parse():(this.current.source.end=L(this.currToken),this.current.parent.source.end=L(this.currToken),this.position++);this.current=o}else{for(var i,r=this.currToken,c="(";this.position<this.tokens.length&&t;)this.currToken[m.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[m.FIELDS.TYPE]===C.closeParenthesis&&t--,i=this.currToken,c+=this.parseParenthesisToken(this.currToken),this.position++;e?e.appendToPropertyAndEscape("value",c,c):this.newNode(new u.default({value:c,source:E(r[m.FIELDS.START_LINE],r[m.FIELDS.START_COL],i[m.FIELDS.END_LINE],i[m.FIELDS.END_COL]),sourceIndex:r[m.FIELDS.START_POS]}))}if(t)return this.expected("closing parenthesis",this.currToken[m.FIELDS.START_POS])},o.pseudo=function(){for(var e=this,t="",n=this.currToken;this.currToken&&this.currToken[m.FIELDS.TYPE]===C.colon;)t+=this.content(),this.position++;return this.currToken?this.currToken[m.FIELDS.TYPE]!==C.word?this.expected(["pseudo-class","pseudo-element"],this.currToken[m.FIELDS.START_POS]):void this.splitWord(!1,function(o,i){t+=o,e.newNode(new h.default({value:t,source:O(n,e.currToken),sourceIndex:n[m.FIELDS.START_POS]})),i>1&&e.nextToken&&e.nextToken[m.FIELDS.TYPE]===C.openParenthesis&&e.error("Misplaced parenthesis.",{index:e.nextToken[m.FIELDS.START_POS]})}):this.expected(["pseudo-class","pseudo-element"],this.position-1)},o.space=function(){var e=this.content();0===this.position||this.prevToken[m.FIELDS.TYPE]===C.comma||this.prevToken[m.FIELDS.TYPE]===C.openParenthesis||this.current.nodes.every(function(e){return"comment"===e.type})?(this.spaces=this.optionalSpace(e),this.position++):this.position===this.tokens.length-1||this.nextToken[m.FIELDS.TYPE]===C.comma||this.nextToken[m.FIELDS.TYPE]===C.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(e),this.position++):this.combinator()},o.string=function(){var e=this.currToken;this.newNode(new u.default({value:this.content(),source:x(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++},o.universal=function(e){var t=this.nextToken;if(t&&"|"===this.content(t))return this.position++,this.namespace();var n=this.currToken;this.newNode(new f.default({value:this.content(),source:x(n),sourceIndex:n[m.FIELDS.START_POS]}),e),this.position++},o.splitWord=function(e,t){for(var n=this,o=this.nextToken,i=this.content();o&&~[C.dollar,C.caret,C.equals,C.word].indexOf(o[m.FIELDS.TYPE]);){this.position++;var r=this.content();if(i+=r,r.lastIndexOf("\\")===r.length-1){var s=this.nextToken;s&&s[m.FIELDS.TYPE]===C.space&&(i+=this.requiredSpace(this.content(s)),this.position++)}o=this.nextToken}var a=R(i,".").filter(function(e){var t="\\"===i[e-1],n=/^\d+\.\d+%$/.test(i);return!t&&!n}),u=R(i,"#").filter(function(e){return"\\"!==i[e-1]}),h=R(i,"#{");h.length&&(u=u.filter(function(e){return!~h.indexOf(e)}));var p=(0,g.default)(function(){var e=Array.prototype.concat.apply([],arguments);return e.filter(function(t,n){return n===e.indexOf(t)})}([0].concat(a,u)));p.forEach(function(o,r){var s,h=p[r+1]||i.length,f=i.slice(o,h);if(0===r&&t)return t.call(n,f,p.length);var v=n.currToken,y=v[m.FIELDS.START_POS]+p[r],g=E(v[1],v[2]+o,v[3],v[2]+(h-1));if(~a.indexOf(o)){var C={value:f.slice(1),source:g,sourceIndex:y};s=new c.default(B(C,"value"))}else if(~u.indexOf(o)){var w={value:f.slice(1),source:g,sourceIndex:y};s=new l.default(B(w,"value"))}else{var I={value:f,source:g,sourceIndex:y};B(I,"value"),s=new d.default(I)}n.newNode(s,e),e=null}),this.position++},o.word=function(e){var t=this.nextToken;return t&&"|"===this.content(t)?(this.position++,this.namespace()):this.splitWord(e)},o.loop=function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},o.parse=function(e){switch(this.currToken[m.FIELDS.TYPE]){case C.space:this.space();break;case C.comment:this.comment();break;case C.openParenthesis:this.parentheses();break;case C.closeParenthesis:e&&this.missingParenthesis();break;case C.openSquare:this.attribute();break;case C.dollar:case C.caret:case C.equals:case C.word:this.word();break;case C.colon:this.pseudo();break;case C.comma:this.comma();break;case C.asterisk:this.universal();break;case C.ampersand:this.nesting();break;case C.slash:case C.combinator:this.combinator();break;case C.str:this.string();break;case C.closeSquare:this.missingSquareBracket();case C.semicolon:this.missingBackslash();default:this.unexpected()}},o.expected=function(e,t,n){if(Array.isArray(e)){var o=e.pop();e=e.join(", ")+" or "+o}var i=/^[aeiou]/.test(e[0])?"an":"a";return n?this.error("Expected "+i+" "+e+', found "'+n+'" instead.',{index:t}):this.error("Expected "+i+" "+e+".",{index:t})},o.requiredSpace=function(e){return this.options.lossy?" ":e},o.optionalSpace=function(e){return this.options.lossy?"":e},o.lossySpace=function(e,t){return this.options.lossy?t?" ":"":e},o.parseParenthesisToken=function(e){var t=this.content(e);return e[m.FIELDS.TYPE]===C.space?this.requiredSpace(t):t},o.newNode=function(e,t){return t&&(/^ +$/.test(t)&&(this.options.lossy||(this.spaces=(this.spaces||"")+t),t=!0),e.namespace=t,B(e,"namespace")),this.spaces&&(e.spaces.before=this.spaces,this.spaces=""),this.current.append(e)},o.content=function(e){return void 0===e&&(e=this.currToken),this.css.slice(e[m.FIELDS.START_POS],e[m.FIELDS.END_POS])},o.locateNextMeaningfulToken=function(e){void 0===e&&(e=this.position+1);for(var t=e;t<this.tokens.length;){if(!_[this.tokens[t][m.FIELDS.TYPE]])return t;t++}return-1},t=e,(n=[{key:"currToken",get:function(){return this.tokens[this.position]}},{key:"nextToken",get:function(){return this.tokens[this.position+1]}},{key:"prevToken",get:function(){return this.tokens[this.position-1]}}])&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=D,e.exports=t.default},5238:(e,t,n)=>{let o=n(3152);class i extends o{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=i,i.default=i},5239:(e,t,n)=>{n.d(t,{O:()=>c});var o=n(205),i=n(9311);class r{constructor(e,t,n,o){this.leftNode=null,this.rightNode=null,this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return e;let n=!1;e.value.id==t.value.id&&(n=!0);for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}getMax(e,t){return e>t?e:t}addNode(e,t,n){if(null==t)return(0,i.dispatchIdEvent)(e.value.ofTheConceptId),e;let o=t.leftNode,r=t.rightNode;if(e.key<t.key)t.leftNode=this.addNode(e,o,n);else{if(!(e.key>t.key))return t;t.rightNode=this.addNode(e,r,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let s=this.getBalanceFactor(t);if(s>1&&t.leftNode){if(this.getBalanceFactor(t.leftNode)>=0)return this.rightRotate(t);if(this.getBalanceFactor(t.leftNode)<0)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(s<-1&&t.rightNode){if(this.getBalanceFactor(t.rightNode)<=0)return this.leftRotate(t);if(this.getBalanceFactor(t.rightNode)>0)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=this.getMax(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}throw console.log("this is the error in right rotation",e,t),new Error("Cannot perform right rotation: left node is null.")}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=this.getMax(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=this.getMax(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}throw console.log("this is the error in left rotation",e,t),new Error("Cannot perform left rotation: right node is null.")}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){try{if(t)return e==t.key?(t.value.count?t.value.count++:t.value.count=1,t):e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t}catch(n){console.log("this is the exception",e,t,null==t?void 0:t.leftNode,null==t?void 0:t.rightNode)}return t}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}checkIfIdsInNode(e,t,n,o){if(e){if(t.includes(e.key)){n.push(e.value);let o=t.indexOf(e.key);t.splice(o,1)}e.leftNode&&this.checkIfIdsInNode(e.leftNode,t,n,o),e.rightNode&&this.checkIfIdsInNode(e.rightNode,t,n,o)}}traverse(e){let t=0;return e&&(t+=1,(null==e?void 0:e.leftNode)&&(t+=this.traverse(e.leftNode)),e.rightNode&&(t+=this.traverse(e.rightNode))),t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(new Event(`${e.value.ofTheConceptId}`),(0,i.dispatchIdEvent)(e.value.ofTheConceptId),null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){let t=e.variants[0];if(t)return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class c{static addNodeToTree(e){try{if(null==this.connectionroot)return this.connectionroot=e,this.connectionroot;this.connectionroot=this.connectionroot.addNode(e,this.connectionroot,this.connectionroot.height)}catch(e){throw console.log("This is the error in making the tree",e),e}}static addConnectionToTree(e){let t=new r(e.id,e,null,null);this.addNodeToTree(t)}static traverse(){var e;return null===(e=this.connectionroot)||void 0===e?void 0:e.traverse(this.connectionroot)}static waitForDataToLoad(){return s(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isConnectionLoaded)return e("done");setTimeout(c.checkFlag,1e3,e)}static removeNodeFromTree(e){return s(this,void 0,void 0,function*(){this.connectionroot&&(this.connectionroot=this.connectionroot.removeNode(this.connectionroot,e))})}static getNodeFromTree(e){return s(this,void 0,void 0,function*(){try{return this.connectionroot?this.connectionroot.getFromNode(e,this.connectionroot):this.connectionroot}catch(t){console.log("this is the getNodeFromTree",e,this.connectionroot)}})}static getConnectionListFromIds(e,t,n){return s(this,void 0,void 0,function*(){this.connectionroot&&this.connectionroot.checkIfIdsInNode(this.connectionroot,e,t,n)})}}c.connectionroot=null},5257:(e,t,n)=>{n.d(t,{R:()=>s});var o=n(9003),i=n(3075),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static AddConceptId(e){this.localId=e.value,(0,o.kH)("localid",e)}static getConceptId(){return r(this,void 0,void 0,function*(){try{if(this.localId){if(this.ReservedLocalId.length<5){yield(0,i.EO)().then(()=>{let e=this.localId;for(let t=1;t<10;t++){let n=this.localId-t;this.ReservedLocalId.push(n),e=n}this.AddConceptId({id:0,value:e})}).catch(e=>(console.log(" getid: cannot get the id from indexdb"),-Math.floor(1e8*Math.random())));let e=this.ReservedLocalId[0];return this.ReservedLocalId.shift(),e}{let e=this.ReservedLocalId[0];return this.ReservedLocalId.shift(),e}}return yield(0,i.EO)().then(()=>{let e=this.localId;for(let t=1;t<10;t++){let n=this.localId-t;this.ReservedLocalId.push(n),e=n}this.AddConceptId({id:0,value:e})}),this.getConceptId()}catch(e){return console.log(" getid: this is the eror in concept",e),-Math.floor(1e8*Math.random())}})}static AddConnectionId(e){this.localConnectionId=e.value}static getConnectionId(){return r(this,void 0,void 0,function*(){try{if(this.localConnectionId){if(this.ReservedConnectionId.length<5){yield(0,i.xd)().then(()=>{let e=this.localConnectionId;for(let t=1;t<10;t++){let n=this.localConnectionId-t;this.ReservedConnectionId.push(n),e=n}}).catch(e=>(console.log("this is the new event",e),-Math.floor(1e8*Math.random())));let e=this.ReservedConnectionId[0];return this.ReservedConnectionId.shift(),e}{let e=this.ReservedConnectionId[0];return this.ReservedConnectionId.shift(),e}}return yield(0,i.xd)().then(()=>{let e=this.localConnectionId;for(let t=1;t<10;t++){let n=this.localConnectionId-t;this.ReservedConnectionId.push(n),e=n}this.AddConnectionId({id:1,value:e})}),this.getConnectionId()}catch(e){return-Math.floor(1e8*Math.random())}})}}s.ReservedLocalId=[],s.ReservedConnectionId=[]},5284:(e,t,n)=>{n.d(t,{B:()=>c});var o=n(9311),i=n(8286),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(){return s(this,arguments,void 0,function*(e=[]){const t=o.Logger.logfunction("FindConnectionsOfCompositionsBulkInMemory",[e.length])||{};let n=[];try{if(o.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,o.sendMessage)("FindConnectionsOfCompositionsBulkInMemory",{composition_ids:e});return o.Logger.logUpdate(t),n.data}catch(e){console.error("FindConnectionsOfCompositionsBulkInMemory sw error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),(0,o.handleServiceWorkerException)(e)}}for(let t=0;t<e.length;t++){let o=yield i.d.GetConnectionsOfConcept(e[t]);n.push(...o)}return o.Logger.logUpdate(t),n}catch(e){return console.error("FindConnectionsOfCompositionsBulkInMemory error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),n}})}},5286:(e,t)=>{function n(e){for(var t=e.toLowerCase(),n="",o=!1,i=0;i<6&&void 0!==t[i];i++){var r=t.charCodeAt(i);if(o=32===r,!(r>=97&&r<=102||r>=48&&r<=57))break;n+=t[i]}if(0!==n.length){var s=parseInt(n,16);return s>=55296&&s<=57343||0===s||s>1114111?["�",n.length+(o?1:0)]:[String.fromCodePoint(s),n.length+(o?1:0)]}}t.__esModule=!0,t.default=function(e){if(!o.test(e))return e;for(var t="",i=0;i<e.length;i++)if("\\"!==e[i])t+=e[i];else{var r=n(e.slice(i+1,i+7));if(void 0!==r){t+=r[0],i+=r[1];continue}if("\\"===e[i+1]){t+="\\",i++;continue}e.length===i+1&&(t+=e[i])}return t};var o=/\\/;e.exports=t.default},5312:(e,t,n)=>{n.d(t,{NK:()=>h,Ve:()=>p,cf:()=>d,vw:()=>f,y8:()=>u});var o=n(2832),i=n(3130),r=n(9311),s=n(1863),c=n(6687),a=n(1320),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,arguments,void 0,function*(e,n="",d=null,h=i.y0){var p,v,y,g,m,C,w,I;const T=r.Logger.logfunction("SearchLinkMultipleAll",t)||{};try{try{if(r.serviceWorker){T.serviceWorker=!0;const t=yield(0,r.sendMessage)("SearchLinkMultipleAll",{searchQuery:e,token:n,caller:d,format:h});return r.Logger.logUpdate(T),t.data}}catch(e){console.error("SearchLinkMultipleAll error sw: ",e),(0,s.ey)(T,"SearchLinkMultipleAll",e),(0,r.handleServiceWorkerException)(e)}let t=[],k=[],A=[],S=[],N=e[0].composition,_={},b={};(null==d?void 0:d.isDataLoaded)?(_.compositionIds=null===(p=d.conceptIds)||void 0===p?void 0:p.slice(),_.internalConnections=null===(v=d.internalConnections)||void 0===v?void 0:v.slice(),_.linkers=null===(y=d.linkers)||void 0===y?void 0:y.slice(),_.reverse=null===(g=d.reverse)||void 0===g?void 0:g.slice(),b=_,t=b.compositionIds,A=b.internalConnections,k=b.linkers,S=b.reverse):(_=yield(0,o.j)(e,n),d&&(d.conceptIds=null===(m=_.compositionIds)||void 0===m?void 0:m.slice(),d.internalConnections=null===(C=_.internalConnections)||void 0===C?void 0:C.slice(),d.linkers=null===(w=_.linkers)||void 0===w?void 0:w.slice(),d.reverse=null===(I=_.reverse)||void 0===I?void 0:I.slice(),d.isDataLoaded=!0),b=_,t=b.compositionIds,A=b.internalConnections,k=b.linkers,S=b.reverse);let L=yield function(e,t,n,o,r,s){return l(this,arguments,void 0,function*(e,t,n,o,r,s,l=i.y0){try{let d,h,p=yield(0,c.QL)(e);return l==i.ZJ?(d=yield(0,c.MT)(t,n),h=yield f(e,d,r,o)):l==i.yv?(d=yield(0,c.D)(t,n),h=yield f(e,d,r,o)):100==l?(d=yield(0,c.nr)(t,n),h=yield u(p,d,r,o)):l==i.SL?h=yield(0,a._W)(e,t,n,s.ofCompositions,o):(d=yield(0,c.rv)(t,n),h=yield u(p,d,r,o)),h}catch(e){return void console.log("Error Occured in build layer",e)}})}(k,t,A,S,N,e[0],h);return r.Logger.logUpdate(T),L}catch(e){throw console.log("this is the error in the search link multiple",e),(0,s.ey)(T,"SearchLinkMultipleAll",e),e}})}function u(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){(new Date).getTime();let i={},s=[];for(let t=0;t<e.length;t++)s.push(e[t].toTheConceptId),s.push(e[t].ofTheConceptId),s.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;if(o.includes(e[n].id)&&(i=!0),1==i){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{let o=i.characterValue+"_reverse";"string"==typeof s&&(s={}),Array.isArray(s[c][o])||("string"==typeof s[c]&&(s[c]={}),s[c][o]=[]),s[c][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{"string"==typeof s&&(s={}),Array.isArray(s[c][i.characterValue])||("string"==typeof s[c]&&(s[c]={}),s[c][i.characterValue]=[]),s[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i})}function h(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){let i=[],s=[];for(let t=0;t<e.length;t++)s.push(e[t].toTheConceptId),s.push(e[t].ofTheConceptId),s.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;if(o.includes(e[n].id)&&(i=!0),1==i){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=Object.keys(o)[0];try{let r=i.characterValue+"_reverse";"string"==typeof o&&(o={}),Array.isArray(o[s][r])||("string"==typeof o[s]&&(o[s]={}),o[s][r]=[]),o[s][r].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=Object.keys(o)[0];try{"string"==typeof o&&(o={}),Array.isArray(o[s][i.characterValue])||("string"==typeof o[s]&&(o[s]={}),o[s][i.characterValue]=[]),o[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let o=t[n[e]];o&&i.push(o)}return i})}function p(e,t,n,o){return l(this,arguments,void 0,function*(e,t,n,o,i=[]){(new Date).getTime();let s=[],c=[];for(let t=0;t<e.length;t++)c.push(e[t].toTheConceptId),c.push(e[t].ofTheConceptId),c.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let o=!1;if(i.includes(e[n].id)&&(o=!0),1==o){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{let o=i.characterValue+"_reverse";"string"==typeof s&&(s={}),Array.isArray(s[c][o])||("string"==typeof s[c]&&(s[c]={}),s[c][o]=[]),s[c][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{"string"==typeof s&&(s={}),Array.isArray(s[c][i.characterValue])||("string"==typeof s[c]&&(s[c]={}),s[c][i.characterValue]=[]),s[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<o.length;e++){let n=t[o[e]];n&&s.push(n)}return s})}function f(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){let i={},s=yield(0,r.GetConnectionBulk)(e),c=[];for(let e=0;e<s.length;e++)c.push(s[e].toTheConceptId),c.push(s[e].ofTheConceptId),c.push(s[e].typeId);yield(0,r.GetConceptBulk)(c),s.sort(function(e,t){return t.id-e.id});for(let e=0;e<s.length;e++){let n=!1;if(o.includes(s[e].id)&&(n=!0),1==n){if(t[s[e].ofTheConceptId]&&t[s[e].toTheConceptId]){let n=t[s[e].toTheConceptId],o=yield(0,r.GetTheConcept)(s[e].typeId),i=n,c=Object.keys(i)[0];try{let n=o.characterValue+"_reverse";"string"==typeof i&&(i={}),Array.isArray(i[c][n])||("string"==typeof i[c]&&(i[c]={}),i[c][n]=[]),i[c][n].push(t[s[e].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[s[e].ofTheConceptId]&&t[s[e].toTheConceptId]){let n=t[s[e].ofTheConceptId],o=yield(0,r.GetTheConcept)(s[e].typeId),i=n,c=Object.keys(i)[0];try{"string"==typeof i&&(i={}),Array.isArray(i[c][o.characterValue])||("string"==typeof i[c]&&(i[c]={}),i[c][o.characterValue]=[]),i[c][o.characterValue].push(t[s[e].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i})}},5328:(e,t,n)=>{n.d(t,{d:()=>l});var o=n(9311),i=n(3130),r=n(8939),s=n(4287),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a extends s.w{constructor(e,t,n,o,i){super(),this.connections=[],this.data=[],this.mainConcept=e,this.linker=t,this.inpage=n,this.page=o,this.format=i}bind(){return c(this,void 0,void 0,function*(){var e;if(!this.isDataLoaded){let i=yield(0,o.GetTheConcept)(this.mainConcept),r=(null===(e=i.type)||void 0===e?void 0:e.characterValue)+"_s_"+this.linker,s=yield(0,o.GetConceptByCharacterAndType)(r,16);if(s.id>0){let e=yield(0,o.GetConnectionOfTheConcept)(s.id,i.id,i.userId,this.inpage,this.page);this.connections=e;for(var t=[],n=0;n<this.connections.length;n++)t.push(this.connections[n].toTheConceptId),this.linkers.push(this.connections[n].id),this.listenToEvent(this.connections[n].toTheConceptId);yield(0,o.GetAllConnectionsOfCompositionBulk)(t)}this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return c(this,void 0,void 0,function*(){this.data=[],this.connections=yield(0,o.GetConnectionBulk)(this.linkers);for(var e=0;e<this.connections.length;e++){let t=this.connections[e].toTheConceptId,n=yield(0,o.GetTheConcept)(t);if(console.log("this is the format",this.format),this.format==i.yv){let e=yield(0,r.RW)(n.id);this.data.push(e)}else if(this.format==i.ZJ){let e=yield(0,r.kx)(n.id);this.data.push(e)}else if(this.format==i.iw){let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}else{let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}}return this.data})}}function l(e,t,n,o,r=i.yv){return new a(e,t,n,o,r)}},5457:(e,t,n)=>{n.d(t,{c:()=>a});var o=n(9311),i=n(7282),r=n(205);class s{constructor(e,t){this.value=[],this.height=1,this.key=e,this.value.push(t),this.leftNode=null,this.rightNode=null,this.currentNode=null}addType(e,t,n){var i,r,c,a;if(null==e)return(0,o.dispatchIdEvent)(t,{detail:n}),new s(t,n);if(t<e.key)e.leftNode=this.addType(e.leftNode,t,n);else{if(!(t>e.key))return e.value.includes(n)||((0,o.dispatchIdEvent)(t,{detail:n}),e.value.push(n)),e;e.rightNode=this.addType(e.rightNode,t,n)}e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1;const l=this.getBalanceFactor(e);return l>1&&t<(null===(i=e.leftNode)||void 0===i?void 0:i.key)?this.rightRotate(e):l<-1&&t>(null===(r=e.rightNode)||void 0===r?void 0:r.key)?this.leftRotate(e):l>1&&t>(null===(c=e.leftNode)||void 0===c?void 0:c.key)?(e.leftNode=this.leftRotate(e.leftNode),this.rightRotate(e)):l<-1&&t<(null===(a=e.rightNode)||void 0===a?void 0:a.key)?(e.rightNode=this.rightRotate(e.rightNode),this.leftRotate(e)):e}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.value.length>0)for(let t=0;t<e.value.length;t++)if(n==e.value[t])return e.value.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static addType(e){return c(this,void 0,void 0,function*(){return null==this.root?(this.root=e,new CustomEvent(`${e.key}`,{detail:e.value[0]}),(0,o.dispatchIdEvent)(e.key,{detail:e.value[0]}),this.root):(this.root=this.root.addType(this.root,e.key,e.value[0]),this.root)})}static addConceptToTree(e){if(0!=e.typeId){let t=new s(e.typeId,e.id);this.addType(t)}}static removeTypeConcept(e,t){this.root&&(this.root=this.root.removeNodeWithVariants(this.root,e,t))}static getNodeFromTreeNew(e){return this.root?this.root.getFromNode(e,this.root):this.root}static getTypeVariantsFromTreeNew(e){return c(this,void 0,void 0,function*(){let t=this.getNodeFromTreeNew(e),n=[],i=[];if(t){n=t.value;for(let e=0;e<n.length;e++){let t=!1;for(let o=0;o<i.length;o++)i[o].id==n[e]&&(t=!0);t||i.push(yield(0,o.GetTheConcept)(n[e]))}}return i})}static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isTypeLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserIdNew(e,t){return c(this,void 0,void 0,function*(){let n=[],o=yield this.getTypeVariantsFromTreeNew(e);console.log("these are all the concepts",o);for(let e=0;e<o.length;e++)o[e].userId==t&&n.push(o[e]);return n})}static getTypeVariantsWithCharacterValueNew(e,t){return c(this,void 0,void 0,function*(){let n=yield this.getTypeVariantsFromTreeNew(t);console.log("this is all the concepts for character",n);let o=(0,i.o)();for(let t=0;t<n.length;t++)n[t].characterValue==e&&(o=n[t]);return o})}static countNumberOfNodes(){return this.typeRoot?this.typeRoot.countNodeBelow(this.typeRoot):0}}a.typeRoot=null,a.root=null},5588:(e,t,n)=>{t.__esModule=!0,t.default=void 0,t.unescapeValue=y;var o,i=a(n(8937)),r=a(n(5286)),s=a(n(3295)),c=n(1581);function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var u=n(4643),h=/^('|")([^]*)\1$/,p=u(function(){},"Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."),f=u(function(){},"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."),v=u(function(){},"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");function y(e){var t=!1,n=null,o=e,i=o.match(h);return i&&(n=i[1],o=i[2]),(o=(0,r.default)(o))!==e&&(t=!0),{deprecatedUsage:t,unescaped:o,quoteMark:n}}var g=function(e){var t,n;function o(t){var n;return void 0===t&&(t={}),n=e.call(this,function(e){if(void 0!==e.quoteMark)return e;if(void 0===e.value)return e;v();var t=y(e.value),n=t.quoteMark,o=t.unescaped;return e.raws||(e.raws={}),void 0===e.raws.value&&(e.raws.value=e.value),e.value=o,e.quoteMark=n,e}(t))||this,n.type=c.ATTRIBUTE,n.raws=n.raws||{},Object.defineProperty(n.raws,"unquoted",{get:u(function(){return n.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:u(function(){return n.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")}),n._constructed=!0,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,d(t,n);var r,s,a=o.prototype;return a.getQuotedValue=function(e){void 0===e&&(e={});var t=this._determineQuoteMark(e),n=m[t];return(0,i.default)(this._value,n)},a._determineQuoteMark=function(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)},a.setValue=function(e,t){void 0===t&&(t={}),this._value=e,this._quoteMark=this._determineQuoteMark(t),this._syncRawValue()},a.smartQuoteMark=function(e){var t=this.value,n=t.replace(/[^']/g,"").length,r=t.replace(/[^"]/g,"").length;if(n+r===0){var s=(0,i.default)(t,{isIdentifier:!0});if(s===t)return o.NO_QUOTE;var c=this.preferredQuoteMark(e);if(c===o.NO_QUOTE){var a=this.quoteMark||e.quoteMark||o.DOUBLE_QUOTE,l=m[a];if((0,i.default)(t,l).length<s.length)return a}return c}return r===n?this.preferredQuoteMark(e):r<n?o.DOUBLE_QUOTE:o.SINGLE_QUOTE},a.preferredQuoteMark=function(e){var t=e.preferCurrentQuoteMark?this.quoteMark:e.quoteMark;return void 0===t&&(t=e.preferCurrentQuoteMark?e.quoteMark:this.quoteMark),void 0===t&&(t=o.DOUBLE_QUOTE),t},a._syncRawValue=function(){var e=(0,i.default)(this._value,m[this.quoteMark]);e===this._value?this.raws&&delete this.raws.value:this.raws.value=e},a._handleEscapes=function(e,t){if(this._constructed){var n=(0,i.default)(t,{isIdentifier:!0});n!==t?this.raws[e]=n:delete this.raws[e]}},a._spacesFor=function(e){var t=this.spaces[e]||{},n=this.raws.spaces&&this.raws.spaces[e]||{};return Object.assign({before:"",after:""},t,n)},a._stringFor=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=C);var o=this._spacesFor(t);return n(this.stringifyProperty(e),o)},a.offsetOf=function(e){var t=1,n=this._spacesFor("attribute");if(t+=n.before.length,"namespace"===e||"ns"===e)return this.namespace?t:-1;if("attributeNS"===e)return t;if(t+=this.namespaceString.length,this.namespace&&(t+=1),"attribute"===e)return t;t+=this.stringifyProperty("attribute").length,t+=n.after.length;var o=this._spacesFor("operator");t+=o.before.length;var i=this.stringifyProperty("operator");if("operator"===e)return i?t:-1;t+=i.length,t+=o.after.length;var r=this._spacesFor("value");t+=r.before.length;var s=this.stringifyProperty("value");return"value"===e?s?t:-1:(t+=s.length,t+=r.after.length,t+=this._spacesFor("insensitive").before.length,"insensitive"===e&&this.insensitive?t:-1)},a.toString=function(){var e=this,t=[this.rawSpaceBefore,"["];return t.push(this._stringFor("qualifiedAttribute","attribute")),this.operator&&(this.value||""===this.value)&&(t.push(this._stringFor("operator")),t.push(this._stringFor("value")),t.push(this._stringFor("insensitiveFlag","insensitive",function(t,n){return!(t.length>0)||e.quoted||0!==n.before.length||e.spaces.value&&e.spaces.value.after||(n.before=" "),C(t,n)}))),t.push("]"),t.push(this.rawSpaceAfter),t.join("")},r=o,(s=[{key:"quoted",get:function(){var e=this.quoteMark;return"'"===e||'"'===e},set:function(e){f()}},{key:"quoteMark",get:function(){return this._quoteMark},set:function(e){this._constructed?this._quoteMark!==e&&(this._quoteMark=e,this._syncRawValue()):this._quoteMark=e}},{key:"qualifiedAttribute",get:function(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function(){return this.insensitive?"i":""}},{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=y(e),n=t.deprecatedUsage,o=t.unescaped,i=t.quoteMark;if(n&&p(),o===this._value&&i===this._quoteMark)return;this._value=o,this._quoteMark=i,this._syncRawValue()}else this._value=e}},{key:"insensitive",get:function(){return this._insensitive},set:function(e){e||(this._insensitive=!1,!this.raws||"I"!==this.raws.insensitiveFlag&&"i"!==this.raws.insensitiveFlag||(this.raws.insensitiveFlag=void 0)),this._insensitive=e}},{key:"attribute",get:function(){return this._attribute},set:function(e){this._handleEscapes("attribute",e),this._attribute=e}}])&&l(r.prototype,s),Object.defineProperty(r,"prototype",{writable:!1}),o}(s.default);t.default=g,g.NO_QUOTE=null,g.SINGLE_QUOTE="'",g.DOUBLE_QUOTE='"';var m=((o={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}}).null={isIdentifier:!0},o);function C(e,t){return""+t.before+e+t.after}},5644:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s,r.registerRoot(s)},5781:e=>{const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),i="/".charCodeAt(0),r="\n".charCodeAt(0),s=" ".charCodeAt(0),c="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),d="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),v="}".charCodeAt(0),y=";".charCodeAt(0),g="*".charCodeAt(0),m=":".charCodeAt(0),C="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,I=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,T=/.[\r\n"'(/\\]/,k=/[\da-f]/i;e.exports=function(e,A={}){let S,N,_,b,L,E,x,O,B,R,D=e.css.valueOf(),G=A.ignoreErrors,P=D.length,F=0,U=[],M=[];function W(t){throw e.error("Unclosed "+t,F)}return{back:function(e){M.push(e)},endOfFile:function(){return 0===M.length&&F>=P},nextToken:function(e){if(M.length)return M.pop();if(F>=P)return;let A=!!e&&e.ignoreUnclosed;switch(S=D.charCodeAt(F),S){case r:case s:case a:case l:case c:b=F;do{b+=1,S=D.charCodeAt(b)}while(S===s||S===r||S===a||S===l||S===c);E=["space",D.slice(F,b)],F=b-1;break;case d:case u:case f:case v:case m:case y:case p:{let e=String.fromCharCode(S);E=[e,e,F];break}case h:if(R=U.length?U.pop()[1]:"",B=D.charCodeAt(F+1),"url"===R&&B!==t&&B!==n&&B!==s&&B!==r&&B!==a&&B!==c&&B!==l){b=F;do{if(x=!1,b=D.indexOf(")",b+1),-1===b){if(G||A){b=F;break}W("bracket")}for(O=b;D.charCodeAt(O-1)===o;)O-=1,x=!x}while(x);E=["brackets",D.slice(F,b+1),F,b],F=b}else b=D.indexOf(")",F+1),N=D.slice(F,b+1),-1===b||T.test(N)?E=["(","(",F]:(E=["brackets",N,F,b],F=b);break;case t:case n:L=S===t?"'":'"',b=F;do{if(x=!1,b=D.indexOf(L,b+1),-1===b){if(G||A){b=F+1;break}W("string")}for(O=b;D.charCodeAt(O-1)===o;)O-=1,x=!x}while(x);E=["string",D.slice(F,b+1),F,b],F=b;break;case C:w.lastIndex=F+1,w.test(D),b=0===w.lastIndex?D.length-1:w.lastIndex-2,E=["at-word",D.slice(F,b+1),F,b],F=b;break;case o:for(b=F,_=!0;D.charCodeAt(b+1)===o;)b+=1,_=!_;if(S=D.charCodeAt(b+1),_&&S!==i&&S!==s&&S!==r&&S!==a&&S!==l&&S!==c&&(b+=1,k.test(D.charAt(b)))){for(;k.test(D.charAt(b+1));)b+=1;D.charCodeAt(b+1)===s&&(b+=1)}E=["word",D.slice(F,b+1),F,b],F=b;break;default:S===i&&D.charCodeAt(F+1)===g?(b=D.indexOf("*/",F+2)+1,0===b&&(G||A?b=D.length:W("comment")),E=["comment",D.slice(F,b+1),F,b],F=b):(I.lastIndex=F+1,I.test(D),b=0===I.lastIndex?D.length-1:I.lastIndex-2,E=["word",D.slice(F,b+1),F,b],U.push(E),F=b)}return F++,E},position:function(){return F}}}},5799:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.STRING,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},5868:(e,t,n)=>{n.d(t,{k:()=>l});var o=n(3077),i=n(8357),r=n(9736),s=n(9311),c=n(1863),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function l(e,t){var n=arguments;return a(this,arguments,void 0,function*(e,t,a=!1,l,d,u=999,h=0,p={concepts:[],connections:[]}){var f,v,y,g;0==a&&(l=999);const m=s.Logger.logfunction("MakeTheInstanceConceptLocal",n)||{};if(s.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,s.sendMessage)("MakeTheInstanceConceptLocal",{type:e,referent:t,composition:a,userId:l,accessId:d,sessionInformationId:u,referentId:h,actions:p});return(null===(v=null===(f=null==n?void 0:n.actions)||void 0===f?void 0:f.concepts)||void 0===v?void 0:v.length)&&(p.concepts=JSON.parse(JSON.stringify(n.actions.concepts))),(null===(g=null===(y=null==n?void 0:n.actions)||void 0===y?void 0:y.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(n.actions.connections))),s.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConceptLocal error sw: ",e),(0,c.ey)(m,"MakeTheInstanceConceptLocal",e),(0,s.handleServiceWorkerException)(e)}}try{let n,c,d=999,u=4,f=l,v=4,y="",g=t.length;if(y=e.startsWith("the_")?e:"the_"+e,a)n=yield(0,i.$)(e,d,l,l,p),c=yield(0,o.A)(t,e,l,u,n.id,v,!0,h,p);else if(g>255)n=yield(0,i.$)(y,d,f,l,p),c=yield(0,o.A)(t,y,l,u,n.id,v,void 0,void 0,p);else{n=yield(0,i.$)(y,d,f,l,p);let e=yield r.v.GetConceptByCharacterAndTypeLocal(t,n.id);c=e,0==e.id&&0==e.userId&&(c=yield(0,o.A)(t,y,l,u,n.id,v,void 0,void 0,p))}return c.type=n,s.LocalSyncData.AddConcept(c),p.concepts.push(c),s.Logger.logUpdate(m),c}catch(e){throw(0,c.ey)(m,"MakeTheInstanceConceptLocal",e),e}})}},5976:(e,t,n)=>{n.d(t,{p:()=>l,B:()=>a});var o=n(9581),i=n(3518),r=n(1863),s=n(9311),c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static getId(){return c(this,void 0,void 0,function*(){this.ids.length<5&&(yield function(){var e,t,n,c,l=arguments;return e=this,t=void 0,c=function*(){const e=s.Logger.logfunction("GetReservedIds",l);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const c=yield n.json();for(let e=0;e<c.length;e++)a.AddId(c[e]);s.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved ids error message: ",t.message):console.log("get reserved ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedIdUrl()),(0,r.ey)(e,"GetReservedIds",t)}},new((n=void 0)||(n=Promise))(function(o,i){function r(e){try{a(c.next(e))}catch(e){i(e)}}function s(e){try{a(c.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,s)}a((c=c.apply(e,t||[])).next())})}());var e=this.ids[0];return this.ids.shift(),e})}static AddId(e){this.ids.includes(e)||this.ids.push(e)}}a.ids=[];class l{static getId(){return c(this,void 0,void 0,function*(){this.connectionIds.length<5&&(yield function(){var e,t,n,c,a=arguments;return e=this,t=void 0,c=function*(){const e=s.Logger.logfunction("GetReservedConnectionIds",a);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedConnectionIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const c=yield n.json();for(let e=0;e<c.length;e++)l.AddId(c[e]);s.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved connection ids error message: ",t.message):console.log("get reserved connection ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedConnectionIdUrl()),(0,r.ey)(e,"GetReservedConnectionIds",t)}},new((n=void 0)||(n=Promise))(function(o,i){function r(e){try{a(c.next(e))}catch(e){i(e)}}function s(e){try{a(c.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(r,s)}a((c=c.apply(e,t||[])).next())})}());var e=this.connectionIds[0];return this.connectionIds.shift(),e})}static AddId(e){this.connectionIds.includes(e)||this.connectionIds.push(e)}}l.connectionIds=[]},6058:(e,t,n)=>{n.d(t,{W:()=>c});var o=n(1863),i=n(3518),r=n(9311),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e){var t=arguments;return s(this,void 0,void 0,function*(){const n=r.Logger.logfunction("GetAllLinkerConnectionsToTheConcept",t);var s=[];try{(new Date).getTime();var c=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionToConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:c});if(t.ok){const e=yield t.json();for(var a=0;a<e.length;a++){var l=e[a];s.push(l)}r.Logger.logUpdate(n)}else console.log("Get all linker connection To the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection To the concepts error: ",e.message):console.log("Get all linker connection To the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionToConceptUrl()),(0,o.ey)(n,"GetAllLinkerConnectionsToTheConcept",e)}return s})}},6156:e=>{let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},6291:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();if(!e[i])return;e=e[i]}return e},e.exports=t.default},6416:(e,t,n)=>{n.d(t,{u:()=>i});var o=n(2615);function i(){let e=new Date,t=new Date;return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}},6467:(e,t,n)=>{function o(e){const t=e.lastIndexOf("_");let n=[];return n=t>0?[e.substring(0,t),e.substring(t+1,e.length)]:[e],n}n.d(t,{f:()=>o})},6687:(e,t,n)=>{n.d(t,{D:()=>I,MT:()=>w,Nt:()=>f,QL:()=>g,as:()=>v,cw:()=>u,dF:()=>d,hG:()=>y,km:()=>p,nr:()=>C,p8:()=>h,rv:()=>m});var o=n(8642),i=n(7467),r=n(9311),s=n(1863),c=n(5284),a=n(8939),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(){return l(this,arguments,void 0,function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.kx)(e[n]);t.push(o)}return t})}function u(){return l(this,arguments,void 0,function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.RW)(e[n]);t.push(o)}return t})}function h(){return l(this,arguments,void 0,function*(e=[],t=[]){const n=r.Logger.logfunction("GetCompositionFromConnectionsWithDataId",[e])||{};if(r.serviceWorker){n.serviceWorker=!0;try{const o=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataId",{conceptIds:e,connectionIds:t});return r.Logger.logUpdate(n),o.data}catch(e){console.error("GetCompositionFromConnectionsWithDataId error sw: ",e),(0,s.ey)(n,"GetCompositionFromConnectionsWithDataId",e),(0,r.handleServiceWorkerException)(e)}}let o=[];for(let t=0;t<e.length;t++){let n=yield(0,a.RW)(e[t]);o.push(n)}return r.Logger.logUpdate(n),o})}function p(){var e=arguments;return l(this,arguments,void 0,function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdFromConnections",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdFromConnections",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdFromConnections error sw: ",e),(0,s.ey)(o,"GetCompositionFromConnectionsWithDataIdFromConnections",e),(0,r.handleServiceWorkerException)(e)}}let c=yield(0,i.j)(n),l=[];for(let e=0;e<t.length;e++){let n=yield(0,a.PT)(t[e],c);l.push(n)}return r.Logger.logUpdate(o),l})}function f(){var e=arguments;return l(this,arguments,void 0,function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdIndex",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdIndex",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdIndex error sw: ",e),(0,s.ey)(o,"GetCompositionFromConnectionsWithDataIdIndex",e),(0,r.handleServiceWorkerException)(e)}}yield(0,i.j)(n),yield(0,c.B)(t);let l={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);l[t[e]]=n}return r.Logger.logUpdate(o),l})}function v(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t),yield(0,c.B)(e);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n})}function y(){return l(this,arguments,void 0,function*(e=[],t=[]){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetCompositionFromConnectionsWithIndexFromConnections",{conceptIds:e,connectionIds:t})).data}catch(e){console.error("GetCompositionFromConnectionsWithIndexFromConnections error sw: ",e),(0,r.handleServiceWorkerException)(e)}let n=yield(0,i.j)(t),o=[];for(let t=0;t<e.length;t++){let i=yield(0,a.JA)(e[t],n);o[e[t]]=i}return o})}function g(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=r.Logger.logfunction("GetConnectionDataPrefetch",t)||{};if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConnectionDataPrefetch",{connectionIds:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionDataPrefetch error sw: ",e),(0,s.ey)(n,"GetConnectionDataPrefetch",e),(0,r.handleServiceWorkerException)(e)}}const o=yield Promise.all(e.map(e=>r.ConnectionData.GetConnection(e))),c=[],a=[];for(let t=0;t<o.length;t++){const n=o[t];0===(null==n?void 0:n.id)?a.push(e[t]):c.push(n)}const l=yield(0,i.j)(a),d=[...c,...l],u=new Set;for(const e of d)u.add(e.ofTheConceptId),u.add(e.toTheConceptId),u.add(e.typeId);return yield(0,r.GetConceptBulk)([...u]),r.Logger.logUpdate(n),d})}function m(){var e=arguments;return l(this,arguments,void 0,function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdInObject",e);yield(0,i.j)(n);let s={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);s[t[e]]=n}return r.Logger.logUpdate(o),s})}function C(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.$N)(e[t]);n[e[t]]=o}return n})}function w(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n})}function I(){return l(this,arguments,void 0,function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.XI)(e[t]);n[e[t]]=o,console.log("this is the normal data",e[t],o)}return n})}},6731:(e,t,n)=>{n.d(t,{b:()=>o});class o{constructor(e,t,n,o){this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return e;let n=!1;for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}checkIfIdsInNode(e,t,n,o){if(e){if(t.includes(e.key)){n.push(e.value);let o=t.indexOf(e.key);t.splice(o,1)}e.leftNode&&this.checkIfIdsInNode(e.leftNode,t,n,o),e.rightNode&&this.checkIfIdsInNode(e.rightNode,t,n,o)}}addCharacterNode(e,t,n){if(""!=e.value.characterValue){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addCharacterNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&""!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addCharacterNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return console.log("adding the type node to the tree",e),e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return console.log("adding the type node to the tree down",e),t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),console.log("adding the type node to the tree last",t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getCharacterFromNodeUpdated(e,t){var n;return t?e==t.key||51==(null===(n=t.value)||void 0===n?void 0:n.typeId)?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getFromNodeWithCharacterAndType(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.typeId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.typeId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndType(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndType(e,t,n.rightNode)}return null}return n}getFromNodeWithCharacterAndCategory(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.categoryId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.categoryId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.rightNode)}return null}return n}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){let t=e.variants[0];if(t)return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}},6846:(e,t,n)=>{let o=n(145),i=n(6966),r=n(4211),s=n(5644);class c{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new i(this,e,t):new r(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=c,c.default=c,s.registerProcessor(c),o.registerProcessor(c)},6915:(e,t,n)=>{function o(e,t="DESC"){return"ASC"==t?e.sort(function(e,t){return e.id-t.id}):e.sort(function(e,t){return t.id-e.id}),e}n.d(t,{X:()=>o})},6963:(e,t,n)=>{n.d(t,{f:()=>s});var o=n(205),i=n(6731),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static waitForDataToLoad(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isCharacterLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static addNodeToTree(e){return r(this,void 0,void 0,function*(){return null==this.characterRoot?(this.characterRoot=e,this.characterRoot):(this.characterRoot=this.characterRoot.addCharacterNode(e,this.characterRoot,this.characterRoot.height),this.characterRoot)})}static removeNodeByCharacter(e,t){return r(this,void 0,void 0,function*(){this.characterRoot&&this.characterRoot.removeNodeWithVariants(this.characterRoot,e,t)})}static countNumberOfNodes(){return this.characterRoot?this.characterRoot.countNodeBelow(this.characterRoot):0}static addConceptToTree(e){if(""!=e.characterValue){var t=new i.b(e.characterValue,e,null,null);this.addNodeToTree(t)}}static getNodeFromTree(e){return this.characterRoot?this.characterRoot.getCharacterFromNode(e,this.characterRoot):this.characterRoot}static getNodeFromTreeUpdated(e){return this.characterRoot?this.characterRoot.getCharacterFromNode(e,this.characterRoot):this.characterRoot}static getCharacterAndTypeFromTree(e,t){return r(this,void 0,void 0,function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndType(e,t,this.characterRoot):this.characterRoot})}static getCharacterAndCategoryFromTree(e,t){return r(this,void 0,void 0,function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndCategory(e,t,this.characterRoot):this.characterRoot})}static removeConceptCharacter(e){this.characterRoot&&(this.characterRoot=this.characterRoot.removeNode(this.characterRoot,e))}}s.characterRoot=null},6966:(e,t,n)=>{let o=n(7793),i=n(145),r=n(3604),s=n(9577),c=n(3717),a=n(5644),l=n(3303),{isClean:d,my:u}=n(4151);n(6156);const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function v(e){return"object"==typeof e&&"function"==typeof e.then}function y(e){let t=!1,n=h[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:y(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(e){return e[d]=!1,e.nodes&&e.nodes.forEach(e=>m(e)),e}let C={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof w||t instanceof c)i=m(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(t,n)}catch(e){this.processed=!0,this.error=e}i&&!i[u]&&o.rebuild(i)}else i=m(t);this.result=new c(e,i,n),this.helpers={...C,postcss:C,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!p[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let o in t[n])e(t,"*"===o?n:n+"-"+o.toLowerCase(),t[n][o]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(v(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[d];){e[d]=!0;let t=[g(e)];for(;t.length>0;){let e=this.visitTick(t);if(v(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return v(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=l;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(v(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[d];)e[d]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,o]of e){let e;this.result.lastPlugin=n;try{e=o(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:o}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(o.length>0&&t.visitorIndex<o.length){let[e,i]=o[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===o.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let o,i=t.iterator;for(;o=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!o[d])return o[d]=!0,void e.push(g(o));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[d]=!0;let t=y(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[d]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}w.registerPostcss=e=>{C=e},e.exports=w,w.default=w,a.registerLazyResult(w),i.registerLazyResult(w)},7071:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.ID,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o.prototype.valueToString=function(){return"#"+e.prototype.valueToString.call(this)},o}(i.default);t.default=c,e.exports=t.default},7139:(e,t,n)=>{n.d(t,{r:()=>d});var o=n(3026),i=n(9581),r=n(9311),s=n(1863),c=n(1596),a=n(3278),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=r.Logger.logfunction("GetConcept",t)||{};let d=(0,r.CreateDefaultConcept)();const u=new FormData;u.append("id",e.toString());try{if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConcept",{id:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConcept sw error: ",e),(0,s.ey)(n,"GetConcept",e),(0,r.handleServiceWorkerException)(e)}}if(0==e||null==e||null==e)return d;var h=yield o.I.GetConcept(e);let t=o.I.GetNpc(e);if(0!=h.id||t)return r.Logger.logUpdate(n),h;{let t;const h={method:"POST",body:u,headers:{Authorization:"Bearer "+a.b.BearerAccessToken}};try{console.log("this is the url",i.B.GetConceptUrl()),t=yield fetch(i.B.GetConceptUrl(),h)}catch(e){t=yield(0,c.g)(h,"/api/getConcept")}return yield function(e,t,n,i){return l(this,void 0,void 0,function*(){return e.ok?(t=yield e.json()).id>0?o.I.AddConcept(t):o.I.AddNpc(i):(console.log("Get the concept error",e.status),(0,s.ry)(e)),r.Logger.logUpdate(n),t})}(t,d,n,e)}}catch(e){e instanceof Error?console.log("Get the concept error message: ",e.message):console.log("Get the concept unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptUrl()),(0,s.ey)(n,"GetConcept",e)}})}},7149:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(8349))&&o.__esModule?o:{default:o},r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}(n(680));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}var c=function(e){return new i.default(e)};Object.assign(c,r),delete c.__esModule;var a=c;t.default=a,e.exports=t.default},7273:(e,t,n)=>{n.d(t,{z:()=>i});var o=n(9581);class i{constructor(e,t,n,i){this.url=o.B.BASE_URL,this.message=e,this.ok=t,this.status=n,this.data=i}getMessage(){return this.message}setMessage(e){return this.message=e,this}getStatus(){return this.status}setStatus(e){return this.status=e,this}getData(){return this.data}setData(e){return this.data=e,this}getOk(){return this.ok}setOk(e){return this.ok=e,this}getUrl(){return this.url}setUrl(e){return this.url=e,this}}},7282:(e,t,n)=>{n.d(t,{Y:()=>r,o:()=>i});var o=n(2615);function i(){let e=r(new Date),t=r(new Date);return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}function r(e){const t=e.getMonth()+1,n=e.getDate(),o=e.getFullYear();let i=e.getHours();const r=e.getMinutes(),s=e.getSeconds(),c=i>=12?"PM":"AM";i%=12,i=i||12;const a=e=>e.toString().padStart(2,"0");return`${t}/${n}/${o} ${i}:${a(r)}:${a(s)} ${c}`}},7324:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.PSEUDO,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o.prototype.toString=function(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")},o}(i.default);t.default=c,e.exports=t.default},7467:(e,t,n)=>{n.d(t,{j:()=>u});var o=n(8286),i=n(9581),r=n(4364),s=n(3518),c=n(1863),a=n(9311),l=n(1596),d=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function u(){return d(this,arguments,void 0,function*(e=[]){const t=a.Logger.logfunction("GetConnectionBulk",e.length)||{};let n=[];try{if(a.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("GetConnectionBulk",{connectionIds:e});return a.Logger.logUpdate(t),n.data}catch(e){console.error("GetConnectionBulk sw error: ",e),(0,c.ey)(t,"GetConnectionBulk",e),(0,a.handleServiceWorkerException)(e)}}if(e.length>0){let r=[];for(let t=0;t<e.length;t++)if(!o.d.GetNpConn(e[t])){let i=yield o.d.GetConnection(e[t]);0==i.id?r.push(e[t]):n.push(i)}if(0==r.length)return a.Logger.logUpdate(t),n;{let e;const u={method:"POST",headers:(0,s.Xr)("application/json"),body:JSON.stringify(r)};try{e=yield fetch(i.B.GetConnectionBulkUrl(),u)}catch(t){e=yield(0,l.g)(u,"/api/get_connection_bulk")}yield function(e,t,n){return d(this,void 0,void 0,function*(){if(e.ok){const n=yield e.json();if(n.length>0)for(let e=0;e<n.length;e++){let i=n[e];t.push(i),o.d.AddConnection(i)}}else(0,c.ey)(n,"GetConnectionBulk",e.status),(0,c.ry)(e),console.log("Get Connection Bulk error",e.status)})}(e,n,t),a.Logger.logUpdate(t)}}}catch(e){e instanceof Error?console.log("Get Connection Bulk error message: ",e):console.log("Get Connection Bulk unexpected error: ",e),(0,c.ey)(t,"GetConnectionBulk",e),(0,c.Mb)(e,i.B.GetConnectionBulkUrl())}return yield(0,r.s)(n),n})}},7668:e=>{const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+o+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let o=e.parent,i=0;for(;o&&"root"!==o.type;)i+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,o=this.raw(e,"between","beforeOpen");this.builder(t+o+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let o=0;o<e.nodes.length;o++){let i=e.nodes[o],r=this.raw(i,"before");r&&this.builder(r),this.stringify(i,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=e.raws.important||" !important"),t&&(o+=";"),this.builder(o,e)}document(e){this.body(e)}raw(e,n,o){let i;if(o||(o=n),n&&(i=e.raws[n],void 0!==i))return i;let r=e.parent;if("before"===o){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return t[o];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[o])return s.rawCache[o];if("before"===o||"after"===o)return this.beforeAfter(e,o);{let t="raw"+((c=o)[0].toUpperCase()+c.slice(1));this[t]?i=this[t](s,e):s.walk(e=>{if(i=e.raws[n],void 0!==i)return!1})}var c;return void 0===i&&(i=t[o]),s.rawCache[o]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let o=n.parent;if(o&&o!==e&&o.parent&&o.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},7793:(e,t,n)=>{let o,i,r,s,c=n(9371),a=n(5238),l=n(3152),{isClean:d,my:u}=n(4151);function h(e){return e.map(e=>(e.nodes&&(e.nodes=h(e.nodes)),delete e.source,e))}function p(e){if(e[d]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)p(t)}class f extends l{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]<this.proxyOf.nodes.length&&(t=this.indexes[o],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[o]+=1;return delete this.indexes[o],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,o=this.index(e),i=this.normalize(t,this.proxyOf.nodes[o]).reverse();o=this.index(e);for(let e of i)this.proxyOf.nodes.splice(o+1,0,e);for(let e in this.indexes)n=this.indexes[e],o<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,o=this.index(e),i=0===o&&"prepend",r=this.normalize(t,this.proxyOf.nodes[o],i).reverse();o=this.index(e);for(let e of r)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=h(i(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new a(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new c(e)]}return e.map(e=>(e[u]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[d]&&p(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)}):this.walk((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)}):this.walk((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)}):this.walk((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}}f.registerParse=e=>{i=e},f.registerRule=e=>{s=e},f.registerAtRule=e=>{o=e},f.registerRoot=e=>{r=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,a.prototype):"comment"===e.type?Object.setPrototypeOf(e,c.prototype):"root"===e.type&&Object.setPrototypeOf(e,r.prototype),e[u]=!0,e.nodes&&e.nodes.forEach(e=>{f.rebuild(e)})}},7820:(e,t,n)=>{n.d(t,{G:()=>s});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addConceptToTree(e){var t=new i.x(e.ghostId,e,null,null);this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static getNodeFromTree(e){return r(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return r(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}}s.root=null},7869:(e,t,n)=>{n.d(t,{_:()=>v,A:()=>f});var o=n(9581),i=n(3026),r=n(1863),s=n(3518),c=n(9311),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},l=n(2299);class d{}d.isUpdated=!1,d.isOnlineSync=!1;var u=n(3655),h=n(9003),p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function f(){return p(this,arguments,void 0,function*(e=!0){try{if(yield(0,u.qI)("concepts"),yield(0,h.qI)("concepts"),e){if((yield(0,u.b8)()).isOnlineSync)return!0;yield function(){return a(this,void 0,void 0,function*(){const e=c.Logger.logfunction("GetAiData");try{const a=(new Date).getTime();var t=(0,s.ab)("application/x-www-form-urlencoded");const l=yield fetch(o.B.GetAllAiData(),{method:"GET",headers:t});l.ok||(console.log("Ai Error Message: ","Cannot get response"),(0,r.ry)(l));const d=yield l.json();for(var n=0;n<d.length;n++)i.I.AddConcept(d[n]);v();let u=(new Date).getTime()-a;console.log("The time taken is ",u),c.Logger.logUpdate(e)}catch(e){e instanceof Error?console.log("Ai Error Message: ",e.message):console.log("Ai Error Message: ",e),(0,r.Mb)(e,o.B.GetAllAiData())}})}()}return!0}catch(e){let t={message:"cannot initlize the AI system",ok:!1,status:400,data:e};return console.log(t),!0}})}function v(){return p(this,void 0,void 0,function*(){d.isOnlineSync=!0;var e=new l.B(d.isOnlineSync);(0,u.El)(e)})}},7876:(e,t,n)=>{n.d(t,{A:()=>d,K:()=>u});var o=n(1735),i=n(7139),r=n(9311),s=n(3026),c=n(7282),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const l=new Map;function d(e){return a(this,arguments,void 0,function*(e,t=999){let n=performance.now();if(o.J.activateStatus)try{o.J.incrementConcept(e)}catch(e){console.error("Error adding connection in access tracker"),r.Logger.log("ERROR","Error Adding Connection")}if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConcept",{id:e,userId:t})).data}catch(e){console.error("GetTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let d=(0,c.o)();if(l.has(e))return l.get(e)||d;const u=(()=>a(this,void 0,void 0,function*(){try{if(e<0)return yield r.LocalConceptsData.GetConceptByGhostId(e);if(d=yield s.I.GetConcept(e),(null==d||0==d.id)&&null!=e&&null!=e){let t=yield(0,i.r)(e);d=t}if(0!=d.id&&null==d.type&&null==(yield s.I.GetConcept(d.typeId))&&null!=d.typeId&&null!=d.typeId){let e=yield(0,i.r)(d.typeId);d.type=e}return d}catch(o){throw console.error("this is the error in the getting concept",o),r.Logger.logError(n,t,"read","unknown",void 0,500,o,"GetTheConcept",[e,t],"unknown",void 0),o}finally{l.delete(e)}}))();return l.set(e,u),u})}function u(e){return a(this,void 0,void 0,function*(){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("AddTypeConcept",{concept:e})).data}catch(e){console.error("AddTypeConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(null==e.type){let t=yield s.I.GetConcept(e.typeId);if(0==t.id&&0!=e.typeId&&999!=e.typeId){let t=yield(0,i.r)(e.typeId);e.type=t}else e.type=t}})}},7887:(e,t,n)=>{n.d(t,{a:()=>s,p:()=>c});var o=n(8286),i=n(4864),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(){return r(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)o.d.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Connection Binary Tree Concept",ok:!1,status:400,data:e}}})}function c(){return r(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)i.G.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Local Connection Binary Tree Concept",ok:!1,status:400,data:e}}})}},8064:(e,t,n)=>{n.d(t,{$I:()=>c,Ay:()=>s});var o=n(9736),i=(n(9581),n(3518),n(9311));n(1863);var r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function s(e){return r(this,void 0,void 0,function*(){return yield o.v.GetConceptByCharacterAndTypeLocal(e,51)})}function c(e){return r(this,void 0,void 0,function*(){if(i.serviceWorker)try{return(yield(0,i.sendMessage)("GetConceptByCharacterAndCategoryLocal",{character:e})).data}catch(e){console.error("GetConceptByCharacterAndCategoryLocal error sw: ",e),(0,i.handleServiceWorkerException)(e)}let t=(0,i.CreateDefaultLConcept)();if("the"==e)return t.id=1,t.typeId=5,t.characterValue="the",t;let n=(0,i.SplitStrings)(e);if(n.length>1){let i=1,s=yield c(n[0]);0!=s.id&&(i=s.id),t=yield function(e,t){return r(this,void 0,void 0,function*(){return o.v.GetConceptByCharacterAndCategoryLocal(e,t)})}(e,i)}else n[0]==e&&(t=yield s(e));return t})}},8095:(e,t,n)=>{n.d(t,{h:()=>c});var o=n(9311),i=n(9700),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e,t,n){var c=arguments;return s(this,arguments,void 0,function*(e,t,n,s=!1,a={concepts:[],connections:[]}){var l,d,u,h,p,f;const v=i.V.logfunction("CreateConnectionBetweenTwoConceptsLocal",c)||{};let y=performance.now();try{if(o.serviceWorker){v.serviceWorker=!0;try{const r=yield(0,o.sendMessage)("CreateConnectionBetweenTwoConceptsLocal",{ofTheConcept:e,toTheConcept:t,linker:n,both:s,actions:a});return(null===(d=null===(l=null==r?void 0:r.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(r.actions.concepts))),(null===(h=null===(u=null==r?void 0:r.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(a.connections=JSON.parse(JSON.stringify(r.actions.connections))),i.V.logUpdate(v),r.data}catch(e){console.error("CreateConnectionBetweenTwoConceptsLocal sw error: ",e),(0,r.ey)(v,"CreateConnectionBetweenTwoConceptsLocal",e),(0,o.handleServiceWorkerException)(e)}}if(e.userId,s){let i=(null===(p=t.type)||void 0===p?void 0:p.characterValue)+"_s_"+n+"_by";var g=yield(0,o.MakeTheInstanceConceptLocal)("connection",i,!1,999,999,999,0,a);yield(0,o.CreateTheConnectionLocal)(t.id,e.id,g.id,1e3,void 0,void 0,a)}let c=(null===(f=e.type)||void 0===f?void 0:f.characterValue)+"_s_"+n+"_s";var m=yield(0,o.MakeTheInstanceConceptLocal)("connection",c,!1,999,999,999,void 0,a);let y=yield(0,o.CreateTheConnectionLocal)(e.id,t.id,m.id,1e3,void 0,void 0,a);return i.V.logUpdate(v),y}catch(o){throw i.V.logError(y,e.userId,"create",void 0,void 0,500,o,"CreateConnectionBetweenTwoConceptsLocal",[e,t,n,s],void 0,void 0),(0,r.ey)(v,"CreateConnectionBetweenTwoConceptsLocal",o),o}})}},8146:(e,t,n)=>{n.d(t,{Y:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(9311),c=n(1863),a=n(7876),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){var t=arguments;return l(this,void 0,void 0,function*(){const n=s.Logger.logfunction("GetConceptByCharacterValue",t);let l=(0,s.CreateDefaultConcept)();try{const t=(0,r.Xr)("","application/json"),d=new FormData;d.append("character_value",e);const u=yield fetch(i.B.GetConceptByCharacterValueUrl(),{method:"POST",headers:t,body:d});u.ok?(l=yield u.json(),l.id>0&&(0,a.K)(l).then(e=>{o.I.AddConcept(l)}),s.Logger.logUpdate(n)):((0,c.ry)(u),console.log("Error in Getting concept by character value Error",u.status))}catch(e){e instanceof Error?console.log("Error in Getting concept by character value error message: ",e):console.log("Error in Getting concept by character value unexpected error: ",e),(0,c.Mb)(e,i.B.GetConceptByCharacterValueUrl()),(0,c.ey)(n,"GetConceptByCharacterValue",e)}return l})}},8286:(e,t,n)=>{n.d(t,{d:()=>f});var o=n(1735),i=n(9311),r=n(3655),s=n(1863),c=n(2155),a=n(5239),l=n(991),d=n(3996);class u extends d.i{constructor(e,t,n,o){super(e,t,n,o),this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}}class h{static CreateCompositionKey(e){return e}static addNodeToTree(e){return t=this,n=void 0,i=function*(){return null==this.connectionTypeRoot?(this.connectionTypeRoot=e,this.connectionTypeRoot):(this.connectionTypeRoot=this.connectionTypeRoot.addNode(e,this.connectionTypeRoot,this.connectionTypeRoot.height),this.connectionTypeRoot)},new((o=void 0)||(o=Promise))(function(e,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(s,c)}a((i=i.apply(t,n||[])).next())});var t,n,o,i}static addConnectionToTree(e){if(e.id>0){let t=this.CreateCompositionKey(e.typeId);if(this.connectionTypeRoot){let n=this.connectionTypeRoot.getFromNode(t,this.connectionTypeRoot);if(n){let t=null==n?void 0:n.value;0==t.length&&(n.value=[]),t.includes(e.id)||t.push(e.id)}else{let n=[];n.push(e.id);let o=new u(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new u(t,n,null,null);this.addNodeToTree(o)}}else console.log("cannot insert key id with n 0 to the connection tree",e)}static GetConnectionByOfTheConceptAndTypeId(e,t){let n=this.CreateCompositionKey(t);if(this.connectionTypeRoot){let e=this.connectionTypeRoot.getFromNode(n,this.connectionTypeRoot);if(e)return e.value}return null}}h.connectionTypeRoot=null;var p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class f{constructor(){this.name="Connection Array"}static CheckContains(e){let t=!1;for(let n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e.id&&(t=!0);return t}static AddConnectionToStorage(e){(0,r.kH)("connection",e)}static AddNpConn(e){this.deletedConnections.includes(e)||this.deletedConnections.push(e)}static GetNpConn(e){return!!this.deletedConnections.includes(e)}static AddConnection(e){try{a.O.addConnectionToTree(e),h.addConnectionToTree(e),l.H.addConnection(e)}catch(e){throw console.log("this is the error in making the connection"),e}}static AddConnectionToMemory(e){e.isTemp||(a.O.addConnectionToTree(e),h.addConnectionToTree(e),l.H.addConnection(e))}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){0!=e.id&&((0,r.wh)("connection",e.id),a.O.removeNodeFromTree(e.id),l.H.removeNodeFromTree(e.id))}static GetConnectionTypeOfTree(){l.H.node}static GetConnectionByOfTheConceptAndType(e,t){return p(this,void 0,void 0,function*(){try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionByOfTheConceptAndType",{ofTheConceptId:e,typeId:t})).data}catch(e){console.error("GetConnectionByOfTheConceptAndType sw error: ",e),(0,i.handleServiceWorkerException)(e)}return l.H.GetConnectionByOfTheConceptAndTypeId(e,t)||[]}catch(e){return console.log("this is the error in GetConnectionByOfTheConceptAndType",e),[]}})}static GetConnectionByOfType(e,t){const n=i.Logger.logfunction("ConnectionData.GetConnectionByOfType",arguments);let o=h.GetConnectionByOfTheConceptAndTypeId(e,t);return o?(i.Logger.logUpdate(n),o):(i.Logger.logUpdate(n),[])}static GetConnectionTree(){return a.O.connectionroot}static GetConnectionTypeTree(){return h.connectionTypeRoot}static GetConnectionBulkData(e,t,n){return p(this,void 0,void 0,function*(){yield a.O.getConnectionListFromIds(e,t,n)})}static GetConnection(e){return p(this,void 0,void 0,function*(){o.J.incrementConnection(e);let t=new c.N(0,0,0,0,0,0,0);try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnection",{id:e})).data}catch(e){console.error("GetConnection sw error: ",e),(0,i.handleServiceWorkerException)(e)}let n=yield a.O.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}return t}catch(e){return console.log("this is the error in GetConnection",e),t}})}static GetConnectionsOfCompositionLocal(e){var t=arguments;return p(this,void 0,void 0,function*(){const n=i.Logger.logfunction("ConnectionData.GetConnectionsOfCompositionLocal",t)||{};let o=[];try{if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfCompositionLocal",{id:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionsOfCompositionLocal sw error: ",e),(0,s.ey)(n,"GetConnectionsOfCompositionLocal",e),(0,i.handleServiceWorkerException)(e)}}let t=[];t=f.GetConnectionByOfType(e,e);for(let e=0;e<t.length;e++){let r=yield a.O.getNodeFromTree(t[e]);r&&o.push(r.value),i.Logger.logUpdate(n)}}catch(t){console.log("this is the error GetConnectionsOfCompositionLocal",e,o),(0,s.ey)(n,"ConnectionData.GetConnectionsOfCompositionLocal",t)}return o})}static GetConnectionsOfConcept(e){return p(this,void 0,void 0,function*(){let t=[],n=[];try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfConcept",{id:e})).data}catch(e){console.error("GetConnectionsOfConcept sw error: ",e),(0,i.handleServiceWorkerException)(e)}t=yield f.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<t.length;e++){let o=yield a.O.getNodeFromTree(t[e]);o&&n.push(o.value)}return n}catch(e){return console.log("this is the error in GetConnectionsOfConcept",e),n}})}getName(){return this.name}}f.deletedConnections=[],f.connectionArray=[],f.connectionDictionary=[]},8339:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(5644),c=n(1534),a=n(5781);const l={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,i,r=new o;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let s=!1,c=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){c=!0;break}if("}"===t){if(a.length>0){for(i=a.length-1,n=a[i];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),s&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),c&&(r.nodes=[],this.current=r)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,o=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(o+=1,2!==o));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,o,i=0;for(let[r,s]of e.entries()){if(n=s,o=n[0],"("===o&&(i+=1),")"===o&&(i-=1),0===i&&":"===o){if(t){if("word"===t[0]&&"progid"===t[1])continue;return r}this.doubleColon(n)}t=n}return!1}comment(e){let t=new i;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=a(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let o,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(o=e.shift(),":"===o[0]){n.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,c=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)c.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(o=e[t],"!important"===o[1].toLowerCase()){n.important=!0;let o=this.stringFrom(e,t);o=this.spacesFromEnd(e)+o," !important"!==o&&(n.raws.important=o);break}if("important"===o[1].toLowerCase()){let o=e.slice(0),i="";for(let e=t;e>0;e--){let t=o[e][0];if(i.trim().startsWith("!")&&"space"!==t)break;i=o.pop()[1]+i}i.trim().startsWith("!")&&(n.important=!0,n.raws.important=i,e=o)}if("space"!==o[0]&&"comment"!==o[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=c.map(e=>e[1]).join(""),c=[]),this.raw(n,"value",c.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new c;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,o=!1,i=null,r=[],s=e[1].startsWith("--"),c=[],a=e;for(;a;){if(n=a[0],c.push(a),"("===n||"["===n)i||(i=a),r.push("("===n?")":"]");else if(s&&o&&"{"===n)i||(i=a),r.push("}");else if(0===r.length){if(";"===n){if(o)return void this.decl(c,s);break}if("{"===n)return void this.rule(c);if("}"===n){this.tokenizer.back(c.pop()),t=!0;break}":"===n&&(o=!0)}else n===r[r.length-1]&&(r.pop(),0===r.length&&(i=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(i),t&&o){if(!s)for(;c.length&&(a=c[c.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(c.pop());this.decl(c,s)}else this.unknownWord(c)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,o){let i,r,s,c,a=n.length,d="",u=!0;for(let e=0;e<a;e+=1)i=n[e],r=i[0],"space"!==r||e!==a-1||o?"comment"===r?(c=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",l[c]||l[s]||","===d.slice(-1)?u=!1:d+=i[1]):d+=i[1]:u=!1;if(!u){let o=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:o,value:d}}e[t]=d}rule(e){e.pop();let t=new c;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let o=t;o<e.length;o++)n+=e[o][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},8349:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(5170))&&o.__esModule?o:{default:o},r=function(){function e(e,t){this.func=e||function(){},this.funcRes=null,this.options=t}var t=e.prototype;return t._shouldUpdateSelector=function(e,t){return void 0===t&&(t={}),!1!==Object.assign({},this.options,t).updateSelector&&"string"!=typeof e},t._isLossy=function(e){return void 0===e&&(e={}),!1===Object.assign({},this.options,e).lossless},t._root=function(e,t){return void 0===t&&(t={}),new i.default(e,this._parseOptions(t)).root},t._parseOptions=function(e){return{lossy:this._isLossy(e)}},t._run=function(e,t){var n=this;return void 0===t&&(t={}),new Promise(function(o,i){try{var r=n._root(e,t);Promise.resolve(n.func(r)).then(function(o){var i=void 0;return n._shouldUpdateSelector(e,t)&&(i=r.toString(),e.selector=i),{transform:o,root:r,string:i}}).then(o,i)}catch(e){return void i(e)}})},t._runSync=function(e,t){void 0===t&&(t={});var n=this._root(e,t),o=this.func(n);if(o&&"function"==typeof o.then)throw new Error("Selector processor returned a promise to a synchronous call.");var i=void 0;return t.updateSelector&&"string"!=typeof e&&(i=n.toString(),e.selector=i),{transform:o,root:n,string:i}},t.ast=function(e,t){return this._run(e,t).then(function(e){return e.root})},t.astSync=function(e,t){return this._runSync(e,t).root},t.transform=function(e,t){return this._run(e,t).then(function(e){return e.transform})},t.transformSync=function(e,t){return this._runSync(e,t).transform},t.process=function(e,t){return this._run(e,t).then(function(e){return e.string||e.root.toString()})},t.processSync=function(e,t){var n=this._runSync(e,t);return n.string||n.root.toString()},e}();t.default=r,e.exports=t.default},8354:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t="",n=e.indexOf("/*"),o=0;n>=0;){t+=e.slice(o,n);var i=e.indexOf("*/",n+2);if(i<0)return t;o=i+2,n=e.indexOf("/*",o)}return t+e.slice(o)},e.exports=t.default},8357:(e,t,n)=>{n.d(t,{$:()=>d});var o=n(3077),i=n(8064),r=n(6467),s=n(9975),c=n(9311),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e,t,n,u){var h=arguments;return l(this,arguments,void 0,function*(e,t,n,l,u={concepts:[],connections:[]}){var p,f,v,y;const g=c.Logger.logfunction("MakeTheTypeConceptLocal",h)||{};if(c.serviceWorker){g.serviceWorker=!0;try{const o=yield(0,c.sendMessage)("MakeTheTypeConceptLocal",{typeString:e,sessionId:t,sessionUserId:n,userId:l,actions:u});return(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.concepts)||void 0===f?void 0:f.length)&&(u.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(y=null===(v=null==o?void 0:o.actions)||void 0===v?void 0:v.connections)||void 0===y?void 0:y.length)&&(u.connections=JSON.parse(JSON.stringify(o.actions.connections))),c.Logger.logUpdate(g),o.data}catch(e){console.error("MakeTheTypeConceptLocal error sw: ",e),(0,a.ey)(g,"MakeTheTypeConceptLocal",e),(0,c.handleServiceWorkerException)(e)}}let m=yield(0,i.$I)(e);if(m&&(0==m.id||0==m.userId)){let i=(0,r.f)(e);if(i[0]==e)m=yield(0,s.A)(e,"the",l,1,51,u);else{let r=yield d(i[0],t,n,l,u),s=yield d(i[1],t,n,l,u);m=yield(0,o.A)(e,i[1],l,r.id,s.id,4,void 0,null,u)}}return c.Logger.logUpdate(g),m})}},8407:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(9581),i=n(3518),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},c=n(4402),a=n(9311),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class d{constructor(e,t,n,o,i,r,s,c,a,l){this.id=0,this.userId=e,this.data=t,this.securityId=n,this.securityUserId=o,this.accessId=i,this.accessUserId=r,this.sessionId=s,this.sessionUserId=c,this.entryTimestamp=a,this.isNew=l}}var u=n(7282),h=n(2212),p=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function f(e,t){var n=arguments;return p(this,arguments,void 0,function*(e,t,p=!1,f,v=4,y=999,g=0){f=p?f:999;const m=a.Logger.logfunction("MakeTheInstanceConcept",n)||{};if(a.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("MakeTheInstanceConcept",{type:e,referent:t,composition:p,userId:f,passedAccessId:v,passedSessionId:y,referentId:g});return a.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConcept sw error: ",e),(0,r.ey)(m,"MakeTheInstanceConcept",e),(0,a.handleServiceWorkerException)(e)}}let C,w=y,I=f,T=f,k=v,A=f,S="",N=t.length,_=(0,u.o)();if(S=e.startsWith("the_")?e:"the_"+e,p)_=yield(0,a.MakeTheTypeConceptApi)(e,f),C=yield(0,h.Ay)(t,f,4,_.id,g,k,e);else if(N>255)_=yield(0,a.MakeTheTypeConceptApi)(S,f),C=yield(0,h.Ay)(t,f,4,_.id,g,k,S),function(e){s(this,void 0,void 0,function*(){try{var t=(0,i.Xr)();const n=yield fetch(o.B.CreateTheTextDataUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);return yield n.json()}catch(e){throw e instanceof Error?console.log("Create the text error message: ",e.message):console.log("Create the text unexpected error: ",e),e}})}(new d(f,t,999,I,k,A,w,T,Date.now().toString(),!0));else{_=yield(0,a.MakeTheTypeConceptApi)(S,f);let e=yield(0,c.A)(t,_.id);C=e,0==e.id&&0==e.userId&&(C=yield(0,h.N)(t,f,4,_.id,12,k,S),function(e,t,n,s){var c=arguments;l(this,void 0,void 0,function*(){const l=a.Logger.logfunction("MakeTheNameInBackend",c);try{let c={newConceptId:e,referent:t,typeId:n,typeUserId:s},d=(0,i.Xr)(),u=JSON.stringify(c);const h=yield fetch(o.B.MakeTheNameInBackendUrl(),{method:"POST",headers:d,body:u});a.Logger.logUpdate(l),h.ok||(0,r.ry)(h)}catch(e){e instanceof Error?console.log("make the name in backend error message: ",e.message):console.log("make the name in backend unexpected error: ",e),(0,r.Mb)(e,o.B.MakeTheNameInBackendUrl()),(0,r.ey)(l,"MakeTheNameInBackend",e)}})}(C.id,`${t}`,_.id,f))}return C.type=_,a.Logger.logUpdate(m),C})}},8500:(e,t,n)=>{t.__esModule=!0,t.isComment=t.isCombinator=t.isClassName=t.isAttribute=void 0,t.isContainer=function(e){return!(!s(e)||!e.walk)},t.isIdentifier=void 0,t.isNamespace=function(e){return a(e)||m(e)},t.isNesting=void 0,t.isNode=s,t.isPseudo=void 0,t.isPseudoClass=function(e){return f(e)&&!w(e)},t.isPseudoElement=w,t.isUniversal=t.isTag=t.isString=t.isSelector=t.isRoot=void 0;var o,i=n(1581),r=((o={})[i.ATTRIBUTE]=!0,o[i.CLASS]=!0,o[i.COMBINATOR]=!0,o[i.COMMENT]=!0,o[i.ID]=!0,o[i.NESTING]=!0,o[i.PSEUDO]=!0,o[i.ROOT]=!0,o[i.SELECTOR]=!0,o[i.STRING]=!0,o[i.TAG]=!0,o[i.UNIVERSAL]=!0,o);function s(e){return"object"==typeof e&&r[e.type]}function c(e,t){return s(t)&&t.type===e}var a=c.bind(null,i.ATTRIBUTE);t.isAttribute=a;var l=c.bind(null,i.CLASS);t.isClassName=l;var d=c.bind(null,i.COMBINATOR);t.isCombinator=d;var u=c.bind(null,i.COMMENT);t.isComment=u;var h=c.bind(null,i.ID);t.isIdentifier=h;var p=c.bind(null,i.NESTING);t.isNesting=p;var f=c.bind(null,i.PSEUDO);t.isPseudo=f;var v=c.bind(null,i.ROOT);t.isRoot=v;var y=c.bind(null,i.SELECTOR);t.isSelector=y;var g=c.bind(null,i.STRING);t.isString=g;var m=c.bind(null,i.TAG);t.isTag=m;var C=c.bind(null,i.UNIVERSAL);function w(e){return f(e)&&e.value&&(e.value.startsWith("::")||":before"===e.value.toLowerCase()||":after"===e.value.toLowerCase()||":first-letter"===e.value.toLowerCase()||":first-line"===e.value.toLowerCase())}t.isUniversal=C},8633:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},8642:(e,t,n)=>{n.d(t,{Y:()=>h});var o=n(8286),i=n(9581),r=n(4364),s=n(5284),c=n(1412),a=n(3518),l=n(1863),d=n(9311),u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function h(){var e=arguments;return u(this,arguments,void 0,function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionBulk",e)||{};if(d.serviceWorker){n.serviceWorker=!0;try{const e=yield(0,d.sendMessage)("GetAllConnectionsOfCompositionBulk",{composition_ids:t});return d.Logger.logUpdate(n),e.data}catch(e){console.error("GetAllConnectionsOfCompositionBulk sw error: ",e),(0,l.ey)(n,"GetAllConnectionsOfCompositionBulk",e),(0,d.handleServiceWorkerException)(e)}}var h=[];if(t.length<=0)return h;var p=yield(0,s.B)(t),f=yield function(){var e=arguments;return u(this,arguments,void 0,function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionOnline",e);var r=[];try{var s=(0,a.Xr)("application/json");const e=yield fetch(i.B.GetAllConnectionsOfCompositionBulkUrl(),{method:"POST",headers:s,body:JSON.stringify(t)});if(e.ok){const t=yield e.json();for(var c=0;c<t.length;c++)o.d.AddConnection(t[c]),r.push(t[c])}else console.log("Get all connections of composition bulk error message: ","Cannot get response"),(0,l.ry)(e);return d.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connections of composition bulk error message: ",e.message):console.log("Get all connections of composition bulk unexpected error: ",e),(0,l.Mb)(e,i.B.GetAllConnectionsOfCompositionBulkUrl()),(0,l.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}})}(t);return h=f,(0,c.e)(h,p),yield(0,r.s)(h),d.Logger.logUpdate(n),h})}},8675:(e,t,n)=>{n.d(t,{l:()=>c});var o=n(1863),i=n(3518),r=n(9311),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e){var t=arguments;return s(this,void 0,void 0,function*(){r.Logger.logfunction("GetAllLinkerConnectionsFromTheConcept",t);var n=[];try{(new Date).getTime();var s=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionOfConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:s});if(t.ok){const e=yield t.json();for(var c=0;c<e.length;c++){var a=e[c];n.push(a)}}else console.log("Get all linker connection from the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection from the concepts error: ",e.message):console.log("Get all linker connection from the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionOfConceptUrl())}return n})}},8937:e=>{var t={}.hasOwnProperty,n=/[ -,\.\/:-@\[-\^`\{-~]/,o=/[ -,\.\/:-@\[\]\^`\{-~]/,i=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,r=function e(r,s){"single"!=(s=function(e,n){if(!e)return n;var o={};for(var i in n)o[i]=t.call(e,i)?e[i]:n[i];return o}(s,e.options)).quotes&&"double"!=s.quotes&&(s.quotes="single");for(var c="double"==s.quotes?'"':"'",a=s.isIdentifier,l=r.charAt(0),d="",u=0,h=r.length;u<h;){var p=r.charAt(u++),f=p.charCodeAt(),v=void 0;if(f<32||f>126){if(f>=55296&&f<=56319&&u<h){var y=r.charCodeAt(u++);56320==(64512&y)?f=((1023&f)<<10)+(1023&y)+65536:u--}v="\\"+f.toString(16).toUpperCase()+" "}else v=s.escapeEverything?n.test(p)?"\\"+p:"\\"+f.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(p)?"\\"+f.toString(16).toUpperCase()+" ":"\\"==p||!a&&('"'==p&&c==p||"'"==p&&c==p)||a&&o.test(p)?"\\"+p:p;d+=v}return a&&(/^-[-\d]/.test(d)?d="\\-"+d.slice(1):/\d/.test(l)&&(d="\\3"+l+" "+d.slice(1))),d=d.replace(i,function(e,t,n){return t&&t.length%2?e:(t||"")+n}),!a&&s.wrap?c+d+c:d};r.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},r.version="3.0.0",e.exports=r},8939:(e,t,n)=>{n.d(t,{$N:()=>I,$V:()=>h,Ez:()=>T,JA:()=>C,Mb:()=>v,Nj:()=>f,PT:()=>w,RW:()=>m,XI:()=>g,ay:()=>u,hL:()=>d,kx:()=>y,re:()=>p,yz:()=>k,zN:()=>N});var o=n(7139),i=n(2),r=n(3026),s=n(8286),c=n(9311),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function d(e){return l(this,void 0,void 0,function*(){let t={connectionList:[],compositionList:[]};try{if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionById",{id:e})).data}catch(e){console.error("GetCompositionById error sw: ",e),(0,c.handleServiceWorkerException)(e)}let n=yield(0,i.s)(e);t.connectionList=n;for(let e=0;e<t.connectionList.length;e++)t.compositionList.includes(t.connectionList[e].ofTheConceptId)||t.compositionList.push(t.connectionList[e].ofTheConceptId);return t}catch(e){return console.error("GetCompositionById error: ",e),t}})}function u(e,t,n){return l(this,void 0,void 0,function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield N(e,t,n);return c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l,c})}function h(e,t,n){return l(this,void 0,void 0,function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield N(e,t,n);c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l;let d={};return d.created_at=a.entryTimeStamp,d.data=c,d.id=e,d})}function p(e,t,n){return l(this,void 0,void 0,function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield S(a,t,n);return c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l,c})}function f(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetComposition",{id:e})).data}catch(e){console.error("GetComposition error sw: ",e),(0,c.handleServiceWorkerException)(e)}let s=[],a={};s=yield(0,i.s)(e);let l=[];for(let e=0;e<s.length;e++)l.includes(s[e].ofTheConceptId)||l.push(s[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield N(e,s,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a})}function v(e){return l(this,void 0,void 0,function*(){var t,n;let s=[],c={};s=yield(0,i.s)(e);let a=[];for(let e=0;e<s.length;e++)a.includes(s[e].ofTheConceptId)||a.push(s[e].ofTheConceptId);let l=yield r.I.GetConcept(e);0==l.id&&null!=e&&null!=e&&(l=yield(0,o.r)(e));let d=yield _(e,s,a);return c[null!==(n=null===(t=null==l?void 0:l.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=d,c})}function y(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionFromMemory",{id:e})).data}catch(e){console.error("GetCompositionFromMemory error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield A(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a})}function g(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionFromMemoryNormal",{id:e})).data}catch(e){console.error("GetCompositionFromMemoryNormal error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield S(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a})}function m(e){var t=arguments;return l(this,void 0,void 0,function*(){var n,i;const l=c.Logger.logfunction("GetCompositionWithIdFromMemory",t)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return c.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",e),(0,c.handleServiceWorkerException)(e)}}let d={},u=[],h={};try{u=yield s.d.GetConnectionsOfCompositionLocal(e);let t=[];for(let e=0;e<u.length;e++)t.includes(u[e].ofTheConceptId)||t.push(u[e].ofTheConceptId);let c=yield r.I.GetConcept(e);0==c.id&&null!=e&&null!=e&&(c=yield(0,o.r)(e));let a=yield A(c,u,t);h[null!==(i=null===(n=null==c?void 0:c.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=a,d.created_at=c.entryTimeStamp,d.data=h,d.id=e}catch(t){console.log("this is the exception in GetCompositionWithIdFromMemory",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",t)}return c.Logger.logUpdate(l),d})}function C(e,t){var n=arguments;return l(this,void 0,void 0,function*(){var i,s;const l=c.Logger.logfunction("GetCompositionFromMemoryWithConnections",n)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("GetCompositionFromMemoryWithConnections",{id:e,connectionList:t});return c.Logger.logUpdate(l),n.data}catch(e){console.error("GetCompositionFromMemoryWithConnections error sw: ",e),(0,a.ey)(l,"GetCompositionFromMemoryWithConnections",e),(0,c.handleServiceWorkerException)(e)}}let d={},u=[];for(let e=0;e<t.length;e++)u.includes(t[e].ofTheConceptId)||u.push(t[e].ofTheConceptId);let h=yield r.I.GetConcept(e);0==h.id&&null!=e&&null!=e&&(h=yield(0,o.r)(e));let p=yield A(h,t,u);d[null!==(s=null===(i=null==h?void 0:h.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=p;let f={};return f.created_at=h.entryTimeStamp,f.data=d,f.id=e,c.Logger.logUpdate(l),f})}function w(e,t){return l(this,void 0,void 0,function*(){var n,i;const s=c.Logger.logfunction("GetCompositionWithIdFromMemoryFromConnection",[e])||{};if(c.serviceWorker){s.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return c.Logger.logUpdate(s),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(s,"GetCompositionWithIdFromMemoryFromConnection",e),(0,c.handleServiceWorkerException)(e)}}let l={},d=[];for(let e=0;e<t.length;e++)d.includes(t[e].ofTheConceptId)||d.push(t[e].ofTheConceptId);let u=yield r.I.GetConcept(e);0==u.id&&null!=e&&null!=e&&(u=yield(0,o.r)(e));let h=yield A(u,t,d);l[null!==(i=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=h;let p={};return p.created_at=u.entryTimeStamp,p.data=l,p.id=e,c.Logger.logUpdate(s),p})}function I(e){return l(this,void 0,void 0,function*(){var t;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionWithIdFromMemoryNew",{id:e})).data}catch(e){console.error("GetCompositionWithIdFromMemoryNew error sw: ",e),(0,c.handleServiceWorkerException)(e)}let n=[],i={};n=yield s.d.GetConnectionsOfCompositionLocal(e);let a=[];for(let e=0;e<n.length;e++)a.includes(n[e].ofTheConceptId)||a.push(n[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(console.log("this concept you cannot find ",e),d=yield(0,o.r)(e)),(new Date).getTime();let u=yield function(e,t,n){return l(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a,l,d,u,h;let p={},f=e.id,v=((new Date).getTime(),null!==(r=null===(i=null==e?void 0:e.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"");if(!n.includes(f)){let t=v;return{[t]:null==e?void 0:e.characterValue}}if(o.includes(f))return"";o.push(f);for(let e=0;e<t.length;e++){let n=yield(0,c.GetTheConcept)(t[e].ofTheConceptId),o=yield(0,c.GetTheConcept)(t[e].toTheConceptId);t[e].ofConcept=n,t[e].toConcept=o;let i=n.id,r="the_",l=(null!==(a=null===(s=null==o?void 0:o.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(r,"");null!=p[i]&&null!=p[i]||(p[i]={}),p[i][l]=o.characterValue}let y={};for(let e=0;e<t.length;e++){let n=t[e].ofConcept,o=t[e].toConcept,i=null!==(d=null===(l=null==n?void 0:n.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"",r="the_",s=(null!==(h=null===(u=null==o?void 0:o.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"").replace(r,"");null!=y[n.id]&&null!=y[n.id]||(y[n.id]={});let c=y[n.id];null!=c[i]&&null!=c[i]||(c[i]={}),null!=p[t[e].ofTheConceptId]&&null!=p[t[e].toTheConceptId]?c[i][s]=p[o.id]:c[i][s]=o.characterValue}return y[e.id]})}(d,n,a);null===(t=null==d?void 0:d.type)||void 0===t||t.characterValue,i=u;let h={};return h.created_at=d.entryTimeStamp,h.data=i,h.id=e,h})}function T(e){return l(this,void 0,void 0,function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionWithIdAndDateFromMemory",{id:e})).data}catch(e){console.error("GetCompositionWithIdAndDateFromMemory error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield N(e,i,l);a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u;let h={};return h.data=a,h.id=e,h.created_at=d.entryTimeStamp,h})}function k(e){var t=arguments;return l(this,void 0,void 0,function*(){var n,s;const l=c.Logger.logfunction("GetCompositionWithId",t)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithId",{id:e});return c.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithId error sw: ",e),(0,a.ey)(l,"GetCompositionWithId",e),(0,c.handleServiceWorkerException)(e)}}let d=[],u={};d=yield(0,i.s)(e);let h=[];for(let e=0;e<d.length;e++)h.includes(d[e].ofTheConceptId)||h.push(d[e].ofTheConceptId);let p=yield r.I.GetConcept(e);0==p.id&&null!=e&&null!=e&&(p=yield(0,o.r)(e));let f=yield N(e,d,h);u[null!==(s=null===(n=null==p?void 0:p.type)||void 0===n?void 0:n.characterValue)&&void 0!==s?s:""]=f;let v={};return v.data=u,v.id=e,c.Logger.logUpdate(l),v})}function A(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,c,a;let l={},d=[],u=e.id;if(null===(s=null==e?void 0:e.type)||void 0===s?void 0:s.characterValue,!n.includes(u))return null==e?void 0:e.characterValue;if(i.includes(u))return"";i.push(u);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==u)if(u!=t[e].toTheConceptId){let s=t[e].toTheConceptId,u=yield r.I.GetConcept(s);if(null!=u&&0!=u.id||null==s||null==s||(u=yield(0,o.r)(s)),0!=u.id&&null==(null==u?void 0:u.type)){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}let h="the_",p=(null!==(a=null===(c=null==u?void 0:u.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(p))){if(p){const e=yield A(u,t,n,i);l[p]=e}}else{const e=yield A(u,t,n,i);d[p]=e,l=d}}else console.log("this is the faulty connection ",t[e]);return l})}function S(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,a,l;const d=c.Logger.logfunction("recursiveFetchConceptNormal",[e]);(new Date).getTime();let u={},h=[],p=e.id;if(u.id=p,null===(s=null==e?void 0:e.type)||void 0===s?void 0:s.characterValue,!n.includes(p))return null==e?void 0:e.characterValue;if(i.includes(p))return"";i.push(p);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==p)if(p!=t[e].toTheConceptId){let s=t[e].toTheConceptId,c=yield r.I.GetConcept(s);if(null!=c&&0!=c.id||null==s||null==s||(c=yield(0,o.r)(s)),0!=c.id&&null==(null==c?void 0:c.type)){let e=c.typeId,t=yield r.I.GetConcept(e);c.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),c.type=t)}let d="the_",p=(null!==(l=null===(a=null==c?void 0:c.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"").replace(d,"");if(isNaN(Number(p))){if(p){const e=yield A(c,t,n,i);u[p]=e}}else{const e=yield A(c,t,n,i);h[p]=e,u=h}}else console.log("this is the faulty connection ",t[e]);return c.Logger.logUpdate(d),u})}function N(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,c,a;let l={},d=[];if(0==e)return null;let u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==u.type){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}if(null===(s=null==u?void 0:u.type)||void 0===s?void 0:s.characterValue,!n.includes(e))return null==u?void 0:u.characterValue;if(i.includes(e))return"";i.push(e);for(let s=0;s<t.length;s++)if((new Date).getTime(),t[s].ofTheConceptId==e)if(e!=t[s].toTheConceptId){let e=t[s].toTheConceptId,u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==(null==u?void 0:u.type)){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}let h="the_",p=(null!==(a=null===(c=null==u?void 0:u.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(p))){if(p){const o=yield N(e,t,n,i);l[p]=o}}else{const o=yield N(e,t,n,i);d[p]=o,l=d}}else console.log("this is the faulty connection ",t[s]);return l})}function _(e,t,n){return l(this,arguments,void 0,function*(e,t,n,i=[]){var s,c,a;let l={},d=[];if(0==e)return null;let u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==u.type){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}if(null===(s=null==u?void 0:u.type)||void 0===s?void 0:s.characterValue,!n.includes(e))return null==u?void 0:u.characterValue;if(i.includes(e))return"";i.push(e),l.id=e;for(let i=0;i<t.length;i++)if(t[i].ofTheConceptId==e){let e=t[i].toTheConceptId,s=yield r.I.GetConcept(e);if(null!=s&&0!=s.id||null==e||null==e||(s=yield(0,o.r)(e)),s&&null==(null==s?void 0:s.type)){let e=s.typeId,t=yield r.I.GetConcept(e);s.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),s.type=t)}let u="the_",h=(null!==(a=null===(c=null==s?void 0:s.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(u,"");if(isNaN(Number(h))){if(h){const o=yield _(e,t,n);l[h]=o}}else{const o=yield _(e,t,n);d[h]=o,l=d}}return l})}},9003:(e,t,n)=>{n.d(t,{S5:()=>l,kH:()=>u,qI:()=>a});var o=n(1863),i=n(9311),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};let s=10;class c{}function a(e){const t=i.Logger.logfunction("openDatabase",arguments);return new Promise(function(n,r){c.db&&(i.Logger.logUpdate(t),n(c.db));let l=i.BaseUrl.BASE_URL+"_FreeSchemaLocal"+i.BaseUrl.BASE_APPLICATION;const u=indexedDB.open(l,s);u.onupgradeneeded=e=>{var t=e.target.result,o="localconcept",r="localconnection",c="localid";console.log("this is the version upgrade",s),t.objectStoreNames.contains(o)&&t.deleteObjectStore(o),t.objectStoreNames.contains(r)&&t.deleteObjectStore(r),t.objectStoreNames.contains(c)&&t.deleteObjectStore(c),t.objectStoreNames.contains(o)||(t.createObjectStore(o,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(r)||(t.createObjectStore(r,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(c)||(t.createObjectStore(c,{keyPath:"id"}).transaction.oncomplete=e=>{d(c,{id:0,value:-100}),d(c,{id:1,value:-200}),d(c,{id:3,value:i.BaseUrl.getRandomizer()})}),n(t)},u.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(l),a(e),(0,o.ey)(t,"openDatabase",n),r(n)},u.onsuccess=function(e){var o=e.target;c.db=o.result,i.Logger.logUpdate(t),n(c.db)}})}function l(e){var t=arguments;return r(this,void 0,void 0,function*(){const n=i.Logger.logfunction("getObjectsFromLocalIndexDb",t);return new Promise(function(t,r){a(e).then(o=>{var r=[],s=o.transaction(e,"readwrite").objectStore(e).getAll();s.onsuccess=()=>{const e=s.result;for(var o=0;o<e.length;o++)r.push(e[o]);i.Logger.logUpdate(n),t(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot get objects from database because you cannot open the Local database",data:e};(0,o.ey)(n,"getObjectsFromLocalIndexDb",t),r(t)})})})}function d(e,t){const n=i.Logger.logfunction("storeToDatabase",[e,"localindexdb"]);return new Promise(function(r,s){a(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).add(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot store to the Local database "+e,data:i,body:t};(0,o.ey)(n,"storeToDatabase",r),s(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot store to database because you cannot open the Local database",data:e};(0,o.ey)(n,"storeToDatabase",t),s(t)})})}function u(e,t){const n=i.Logger.logfunction("UpdateToDatabase",arguments);return new Promise(function(r,s){a(e).then(c=>{const a=c.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot Update to the Local database"+e,data:i,body:t};(0,o.ey)(n,"UpdateToDatabase",r),s(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the Local database",data:e};(0,o.ey)(n,"UpdateToDatabase",t),s(t)})})}},9311:(e,t,n)=>{n.d(t,{ADMIN:()=>Nn,ALLID:()=>Sn.BG,AccessControlService:()=>Qo,AccessTracker:()=>Ee.J,AddGhostConcept:()=>tn,Anomaly:()=>ko,BaseUrl:()=>l.B,BinaryTree:()=>Te.W,BuildWidgetFromId:()=>Mo.Cp,BuilderStatefulWidget:()=>go,Composition:()=>Tt,CompositionBinaryTree:()=>mt,CompositionNode:()=>yt,Concept:()=>Yn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>xe.d,CountInfo:()=>Vo.y,CreateComposition:()=>D.A,CreateConnection:()=>Qt.d,CreateConnectionBetweenEntityLocal:()=>Uo,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>mn.h,CreateData:()=>Ri,CreateDefaultConcept:()=>W.o,CreateDefaultLConcept:()=>Jt.u,CreateSession:()=>Ut,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>G.R,CreateTheCompositionWithCache:()=>At,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>Qt.F,DATAID:()=>Sn.y0,DATAIDDATE:()=>Sn.iw,DATAV2:()=>Sn.pU,DelayFunctionExecution:()=>An,DeleteConceptById:()=>Ne,DeleteConceptLocal:()=>wn,DeleteConnectionById:()=>q.m,DeleteConnectionByIdBulk:()=>q.E,DeleteConnectionByType:()=>_o.$S,DeleteConnectionByTypeBulk:()=>_o.L0,DeleteUser:()=>_e,DependencyObserver:()=>xn.w,Environments:()=>Wi,FilterSearch:()=>no,FormatFromConnections:()=>nn.vw,FormatFromConnectionsAltered:()=>nn.y8,FreeschemaQuery:()=>bo,FreeschemaQueryApi:()=>Oo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllLinkerConnectionsFromTheConcept:()=>fe.l,GetAllTheConnectionsByTypeAndOfTheConcept:()=>_o.WC,GetComposition:()=>y.Nj,GetCompositionBulk:()=>je.dF,GetCompositionBulkWithDataId:()=>je.cw,GetCompositionFromConnectionsWithDataId:()=>je.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>je.km,GetCompositionFromConnectionsWithDataIdInObject:()=>je.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>je.Nt,GetCompositionFromConnectionsWithIndex:()=>je.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>je.hG,GetCompositionFromMemoryWithConnections:()=>y.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>I,GetCompositionListAllWithId:()=>T,GetCompositionListListener:()=>Un,GetCompositionListLocal:()=>O,GetCompositionListLocalWithId:()=>B,GetCompositionListWithId:()=>k,GetCompositionListWithIdUpdated:()=>A,GetCompositionListener:()=>Gn,GetCompositionLocal:()=>b,GetCompositionLocalWithId:()=>L,GetCompositionWithAllIds:()=>y.Mb,GetCompositionWithCache:()=>Bt,GetCompositionWithDataIdBulk:()=>Gt,GetCompositionWithDataIdWithCache:()=>Dt,GetCompositionWithId:()=>y.yz,GetCompositionWithIdAndDateFromMemory:()=>y.Ez,GetConceptBulk:()=>ot.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>kn,GetConnectionBulk:()=>it.j,GetConnectionById:()=>Ge,GetConnectionDataPrefetch:()=>je.QL,GetConnectionOfTheConcept:()=>F,GetConnectionTypeForCount:()=>Jn.V,GetFreeschemaImage:()=>Yi,GetFreeschemaImageUrl:()=>Xi,GetImageApi:()=>Ji,GetLink:()=>ce,GetLinkListListener:()=>zn,GetLinkListener:()=>Wn.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>Ht,GetRelationLocal:()=>an,GetRelationNew:()=>qt,GetRelationRaw:()=>zt,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>on.f,GetUserGhostId:()=>en,JUSTDATA:()=>Sn.ZJ,LConcept:()=>Xn,LConnection:()=>Zn,LISTNORMAL:()=>Sn.SL,LocalConceptsData:()=>v.v,LocalSyncData:()=>to.H,LocalTransaction:()=>wo,LogEvent:()=>$o,Logger:()=>ao.V,LoginToBackend:()=>st,MakeTheInstanceConcept:()=>J.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>Me,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>Sn.yv,PRIVATE:()=>_n,PUBLIC:()=>bn,PatcherStructure:()=>Kn,Prototype:()=>Mi,RAW:()=>Sn.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>$n,SchemaQuery:()=>Go,SchemaQueryListener:()=>Do,SearchAllConcepts:()=>bt,SearchLinkInternal:()=>yn,SearchLinkInternalAll:()=>gn,SearchLinkMultipleAll:()=>nn.cf,SearchLinkMultipleAllObservable:()=>On,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>We,SearchStructure:()=>oo,SearchWithLinker:()=>Et,SearchWithTypeAndLinker:()=>Mn.zl,SearchWithTypeAndLinkerApi:()=>En,Selector:()=>Ho,SessionData:()=>eo,Signin:()=>ut,Signup:()=>at,SignupEntity:()=>lt,SplitStrings:()=>c.f,StatefulWidget:()=>vo,SyncData:()=>M.Y,TrashTheConcept:()=>Le,UpdateComposition:()=>Nt,UpdateCompositionLocal:()=>rn.D,UserBinaryTree:()=>Zt,Validator:()=>So,ViewInternalData:()=>hn,ViewInternalDataApi:()=>dn,WidgetTree:()=>Po,convertFromConceptToLConcept:()=>pn.F4,convertFromLConceptToConcept:()=>pn.dp,convertWidgetTreeToWidget:()=>Si,convertWidgetTreeToWidgetWithWrapper:()=>_i,createFormFieldData:()=>No,createPrototypeLocal:()=>$i,dispatchIdEvent:()=>dr,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUploadFileLimit:()=>nt,getUserDetails:()=>jo.s,getWidgetBulkFromId:()=>Ai,getWidgetFromId:()=>ki,handleServiceWorkerException:()=>hr,hasActivatedSW:()=>or,importLatestWidget:()=>vi,importRecentWidget:()=>yi,init:()=>sr,orderTheConnections:()=>Qn.X,recursiveFetch:()=>y.zN,recursiveFetchNew:()=>wt,removeAllChildren:()=>Wo,renderImportedWidget:()=>gi,renderLatestWidget:()=>mi,renderPage:()=>fi,renderWidget:()=>Ci,searchLinkMultipleListener:()=>Bn,sendEmail:()=>ho,sendMessage:()=>cr,serviceWorker:()=>Zi,setHasActivatedSW:()=>ir,storeToDatabase:()=>te,subscribedListeners:()=>tr,unwrapContainers:()=>Ei,updateAccessToken:()=>rr,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye}),n.r(t);var o={};n.r(o),n.d(o,{ADMIN:()=>Nn,ALLID:()=>Sn.BG,AccessControlService:()=>Qo,AccessTracker:()=>Ee.J,AddGhostConcept:()=>tn,Anomaly:()=>ko,BaseUrl:()=>l.B,BinaryTree:()=>Te.W,BuildWidgetFromId:()=>Mo.Cp,BuilderStatefulWidget:()=>go,Composition:()=>Tt,CompositionBinaryTree:()=>mt,CompositionNode:()=>yt,Concept:()=>Yn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>xe.d,CountInfo:()=>Vo.y,CreateComposition:()=>D.A,CreateConnection:()=>Qt.d,CreateConnectionBetweenEntityLocal:()=>Uo,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>mn.h,CreateData:()=>Ri,CreateDefaultConcept:()=>W.o,CreateDefaultLConcept:()=>Jt.u,CreateSession:()=>Ut,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>G.R,CreateTheCompositionWithCache:()=>At,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>Qt.F,DATAID:()=>Sn.y0,DATAIDDATE:()=>Sn.iw,DATAV2:()=>Sn.pU,DelayFunctionExecution:()=>An,DeleteConceptById:()=>Ne,DeleteConceptLocal:()=>wn,DeleteConnectionById:()=>q.m,DeleteConnectionByIdBulk:()=>q.E,DeleteConnectionByType:()=>_o.$S,DeleteConnectionByTypeBulk:()=>_o.L0,DeleteUser:()=>_e,DependencyObserver:()=>xn.w,Environments:()=>Wi,FilterSearch:()=>no,FormatFromConnections:()=>nn.vw,FormatFromConnectionsAltered:()=>nn.y8,FreeschemaQuery:()=>bo,FreeschemaQueryApi:()=>Oo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllLinkerConnectionsFromTheConcept:()=>fe.l,GetAllTheConnectionsByTypeAndOfTheConcept:()=>_o.WC,GetComposition:()=>y.Nj,GetCompositionBulk:()=>je.dF,GetCompositionBulkWithDataId:()=>je.cw,GetCompositionFromConnectionsWithDataId:()=>je.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>je.km,GetCompositionFromConnectionsWithDataIdInObject:()=>je.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>je.Nt,GetCompositionFromConnectionsWithIndex:()=>je.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>je.hG,GetCompositionFromMemoryWithConnections:()=>y.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>I,GetCompositionListAllWithId:()=>T,GetCompositionListListener:()=>Un,GetCompositionListLocal:()=>O,GetCompositionListLocalWithId:()=>B,GetCompositionListWithId:()=>k,GetCompositionListWithIdUpdated:()=>A,GetCompositionListener:()=>Gn,GetCompositionLocal:()=>b,GetCompositionLocalWithId:()=>L,GetCompositionWithAllIds:()=>y.Mb,GetCompositionWithCache:()=>Bt,GetCompositionWithDataIdBulk:()=>Gt,GetCompositionWithDataIdWithCache:()=>Dt,GetCompositionWithId:()=>y.yz,GetCompositionWithIdAndDateFromMemory:()=>y.Ez,GetConceptBulk:()=>ot.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>kn,GetConnectionBulk:()=>it.j,GetConnectionById:()=>Ge,GetConnectionDataPrefetch:()=>je.QL,GetConnectionOfTheConcept:()=>F,GetConnectionTypeForCount:()=>Jn.V,GetFreeschemaImage:()=>Yi,GetFreeschemaImageUrl:()=>Xi,GetImageApi:()=>Ji,GetLink:()=>ce,GetLinkListListener:()=>zn,GetLinkListener:()=>Wn.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>Ht,GetRelationLocal:()=>an,GetRelationNew:()=>qt,GetRelationRaw:()=>zt,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>on.f,GetUserGhostId:()=>en,JUSTDATA:()=>Sn.ZJ,LConcept:()=>Xn,LConnection:()=>Zn,LISTNORMAL:()=>Sn.SL,LocalConceptsData:()=>v.v,LocalSyncData:()=>to.H,LocalTransaction:()=>wo,LogEvent:()=>$o,Logger:()=>ao.V,LoginToBackend:()=>st,MakeTheInstanceConcept:()=>J.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>Me,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>Sn.yv,PRIVATE:()=>_n,PUBLIC:()=>bn,PatcherStructure:()=>Kn,Prototype:()=>Mi,RAW:()=>Sn.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>$n,SchemaQuery:()=>Go,SchemaQueryListener:()=>Do,SearchAllConcepts:()=>bt,SearchLinkInternal:()=>yn,SearchLinkInternalAll:()=>gn,SearchLinkMultipleAll:()=>nn.cf,SearchLinkMultipleAllObservable:()=>On,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>We,SearchStructure:()=>oo,SearchWithLinker:()=>Et,SearchWithTypeAndLinker:()=>Mn.zl,SearchWithTypeAndLinkerApi:()=>En,Selector:()=>Ho,SessionData:()=>eo,Signin:()=>ut,Signup:()=>at,SignupEntity:()=>lt,SplitStrings:()=>c.f,StatefulWidget:()=>vo,SyncData:()=>M.Y,TrashTheConcept:()=>Le,UpdateComposition:()=>Nt,UpdateCompositionLocal:()=>rn.D,UserBinaryTree:()=>Zt,Validator:()=>So,ViewInternalData:()=>hn,ViewInternalDataApi:()=>dn,WidgetTree:()=>Po,convertFromConceptToLConcept:()=>pn.F4,convertFromLConceptToConcept:()=>pn.dp,convertWidgetTreeToWidget:()=>Si,convertWidgetTreeToWidgetWithWrapper:()=>_i,createFormFieldData:()=>No,createPrototypeLocal:()=>$i,dispatchIdEvent:()=>dr,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUploadFileLimit:()=>nt,getUserDetails:()=>jo.s,getWidgetBulkFromId:()=>Ai,getWidgetFromId:()=>ki,handleServiceWorkerException:()=>hr,hasActivatedSW:()=>or,importLatestWidget:()=>vi,importRecentWidget:()=>yi,init:()=>sr,orderTheConnections:()=>Qn.X,recursiveFetch:()=>y.zN,recursiveFetchNew:()=>wt,removeAllChildren:()=>Wo,renderImportedWidget:()=>gi,renderLatestWidget:()=>mi,renderPage:()=>fi,renderWidget:()=>Ci,searchLinkMultipleListener:()=>Bn,sendEmail:()=>ho,sendMessage:()=>cr,serviceWorker:()=>Zi,setHasActivatedSW:()=>ir,storeToDatabase:()=>te,subscribedListeners:()=>tr,unwrapContainers:()=>Ei,updateAccessToken:()=>rr,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye});var i=n(5020),r=n(205),s=n(2832),c=n(6467),a=n(3026),l=n(9581),d=n(3518),u=n(1863),h=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function p(e,t){var n=arguments;return h(this,void 0,void 0,function*(){const o=ao.V.logfunction("GetAllConceptsByType",n);try{var i=new URLSearchParams;i.append("type",e),i.append("user_id",t.toString());var r=(0,d.Xr)("application/x-www-form-urlencoded");const n=yield fetch(l.B.GetAllConceptsByTypeUrl(),{method:"POST",headers:r,body:i});if(n.ok){const e=yield n.json();for(var s=0;s<e.length;s++)a.I.AddConcept(e[s])}else console.log("GetAllConceptsByType error",n.status),(0,u.ry)(n)}catch(e){e instanceof Error?console.log("GetAllConceptsByType error message: ",e.message):console.log("GetAllConceptsByType unexpected error: ",e),(0,u.Mb)(e,l.B.GetAllConceptsByTypeUrl()),(0,u.ey)(o,"GetAllConceptsByType",e)}})}var f=n(8642),v=n(9736),y=n(8939),g=n(2013),m=n(8064),C=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function w(e,t){var n=arguments;return C(this,arguments,void 0,function*(e,t,o=10,i=1){const r=ao.V.logfunction("GetCompositionList",n)||{};if(Zi){r.serviceWorker=!0;try{const n=yield cr("GetCompositionList",{compositionName:e,userId:t,inpage:o,page:i});return ao.V.logUpdate(r),n.data}catch(e){console.error("GetCompositionList sw error: ",e),(0,u.ey)(r,"GetCompositionList",e),hr(e)}}let s=yield(0,g.A)(e),c=[];if(s){yield p(e,t);let n=yield a.I.GetConceptsByTypeIdAndUser(s.id,t),r=o*(i-1),l=[];for(let e=r;e<r+o;e++)n[e]&&l.push(n[e].id);yield(0,f.Y)(l);for(let e=r;e<r+o;e++)if(n[e]){let t=yield(0,y.kx)(n[e].id);c.push(t)}}return ao.V.logUpdate(r),c})}function I(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){let i=O(e,t),r=w(e,t),s=[];return Promise.race([i,r]).then(e=>{console.log("Promise result",e),s.push(...e)}).catch(e=>{console.log("error in handling",e)}),r.then(e=>{console.log("This is the second promise result",e),s.push(...e)}),s})}function T(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){if(Zi)try{return(yield cr("GetCompositionListAllWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListAllWithId sw error: ",e),hr(e)}let i=yield(0,m.Ay)(e),r=yield(0,g.A)(e),s=[],c=[],l=[],d=[];0!=i.id&&(c=yield v.v.GetConceptsByTypeIdAndUser(i.id,t)),0!=r.id&&(yield p(e,t),d=yield a.I.GetConceptsByTypeIdAndUser(r.id,t),s=d);for(let e=0;e<c.length;e++){let t=!1;for(let n=0;n<d.length;n++)c[e].ghostId==d[n].ghostId&&(t=!0);t||l.push(c[e])}console.log("This is the all list",l);let u=[];return u=yield function(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){let i=[],r=n*(o-1),s=[],c=t.length;for(let t=r;t<r+n-c;t++)e[t]&&s.push(e[t].id);for(let e=0;e<t.length;e++){let n=yield L(t[e].id);i.push(n)}yield(0,f.Y)(s);for(let t=r;t<r+n-c;t++)if(e[t]){let n=yield(0,y.RW)(e[t].id);i.push(n)}return i})}(s,l,n,o),u})}function k(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){if(Zi)try{return(yield cr("GetCompositionListWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListWithId sw error: ",e),hr(e)}let i=yield(0,g.A)(e),r=[];if(i){yield p(e,t);let s=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),c=n*(o-1),l=[];for(let e=c;e<c+n;e++)s[e]&&l.push(s[e].id);yield(0,f.Y)(l);for(let e=c;e<c+n;e++)if(s[e]){let t=yield(0,y.RW)(s[e].id);r.push(t)}}return r})}function A(e,t){return C(this,arguments,void 0,function*(e,t,n=10,o=1){let i=yield(0,g.w)(e),r=[];if(i){yield p(e,t);let s=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),c=n*(o-1),l=[];for(let e=c;e<c+n;e++)s[e]&&l.push(s[e].id);yield(0,f.Y)(l);for(let e=c;e<c+n;e++)if(s[e]){let t=yield(0,y.RW)(s[e].id);r.push(t)}}return r})}var S=n(4864),N=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},_=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function b(e){return _(this,void 0,void 0,function*(){var t,n;try{if(Zi)try{return(yield cr("GetCompositionLocal",{id:e})).data}catch(e){console.error("GetCompositionLocal error sw: ",e),hr(e)}let o=[],i={};o=yield S.G.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield v.v.GetConcept(e);if(0==s.id){let t=yield function(e){var t=arguments;return N(this,void 0,void 0,function*(){const n=ao.V.logfunction("TranslateLocalToReal",t);let o=(0,W.o)();try{var i=(0,d.ab)("application/x-www-form-urlencoded");const t=yield fetch(l.B.GetRealConceptById(),{method:"POST",headers:i,body:`id=${e}`});if(t.ok)return o=yield t.json(),o.id>0&&a.I.AddConcept(o),o;console.log("Error in Getting Translating concept Error",t.status),(0,u.ry)(t),ao.V.logUpdate(n)}catch(e){e instanceof Error?console.log("Error in Getting Translating concept error message: ",e):console.log("Error in Getting Translating concept unexpected error: ",e),(0,u.Mb)(e,l.B.GetRealConceptById()),(0,u.ey)(n,"TranslateLocalToReal",e)}return o})}(e);if(t.id>0)return yield(0,y.Nj)(t.id)}let c=yield E(e,o,r);return i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=c,i}catch(e){throw e}})}function L(e){return _(this,void 0,void 0,function*(){var t,n;try{if(Zi)try{return(yield cr("GetCompositionLocalWithId",{id:e})).data}catch(e){console.error("GetCompositionLocalWithId error sw: ",e),hr(e)}let o=[],i={},r={};o=yield S.G.GetConnectionsOfCompositionLocal(e);let s=[];for(let e=0;e<o.length;e++)s.includes(o[e].ofTheConceptId)||s.push(o[e].ofTheConceptId);let c=yield v.v.GetConcept(e);if(0!=c.id){let r=yield E(e,o,s);i[null!==(n=null===(t=null==c?void 0:c.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=r}return r.data=i,r.id=e,r}catch(e){throw e}})}function E(e,t,n){return _(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s;let c={},a=[],l=yield v.v.GetConcept(e);if(0!=l.id&&null==l.type){let e=l.typeId,t=yield v.v.GetConcept(e);l.type=t}if(null===(i=null==l?void 0:l.type)||void 0===i?void 0:i.characterValue,!n.includes(e))return null==l?void 0:l.characterValue;if(o.includes(e))return"";o.push(e);for(let o=0;o<t.length;o++)if(t[o].ofTheConceptId==e){let e=t[o].toTheConceptId,i=yield v.v.GetConcept(e);if(0!=i.id&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield v.v.GetConcept(e);i.type=t}let l="the_",d=(null!==(s=null===(r=null==i?void 0:i.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"top").replace(l,"");if(isNaN(Number(d))){if(d){const o=yield E(e,t,n);c[d]=o}}else{const o=yield E(e,t,n);a[d]=o,c=a}}return c})}var x=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function O(e,t){return x(this,void 0,void 0,function*(){if(Zi)try{return(yield cr("GetCompositionListLocal",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocal error sw: ",e),hr(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield v.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield b(e[t].id);o.push(n)}}return o}catch(e){throw e}})}function B(e,t){return x(this,void 0,void 0,function*(){if(Zi)try{return(yield cr("GetCompositionListLocalWithId",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocalWithId error sw: ",e),hr(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield v.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield L(e[t].id);o.push(n)}}return o}catch(e){throw e}})}var R=n(2),D=n(1218),G=n(999),P=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function F(e,t,n){var o=arguments;return P(this,arguments,void 0,function*(e,t,n,i=10,r=1){const s=ao.V.logfunction("GetConnectionOfTheConcept",o)||{};let c=[];try{if(Zi){s.serviceWorker=!0;try{const o=yield cr("GetConnectionOfTheConcept",{typeId:e,ofTheConceptId:t,userId:n,inpage:i,page:r});return ao.V.logUpdate(s),o.data}catch(e){console.error("GetConnectionOfTheConcept sw error: ",e),(0,u.ey)(s,"GetConnectionOfTheConcept",e),hr(e)}}let o=new URLSearchParams;o.append("typeId",`${e}`),o.append("ofTheConceptId",`${t}`),o.append("userId",`${n}`),o.append("inpage",`${i}`),o.append("page",`${r}`);let a=(0,d.Xr)("application/x-www-form-urlencoded");const h=yield fetch(l.B.GetAllConnectionsOfConceptUrl(),{method:"POST",headers:a,body:o});return h.ok?c=yield h.json():((0,u.ey)(s,"GetConnectionOfTheConcept",h.status),(0,u.ry)(h),console.log("Get connection of concept error",h.status)),ao.V.logUpdate(s),c}catch(e){e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),(0,u.Mb)(e,l.B.GetAllConnectionsOfConceptUrl()),(0,u.ey)(s,"GetConnectionOfTheConcept",e)}})}var U=n(2155),M=n(442),W=n(7282),j=n(5976),V=n(7273),$=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function H(e,t,n,o){return $(this,arguments,void 0,function*(e,t,n,o,i=1,r=4){if(e>0&&n>0){var s=t,c=yield j.p.getId(),a=new U.N(c,e,n,s,o,i,r);return e==n?(a.ofTheConceptId=0,a.toTheConceptId=1,a):(a.toUpdate=!0,a.isTemp=!1,M.Y.AddConnection(a),a)}throw new V.z("cannot create connection because id are negative ",!1,400,"")})}var q=n(4818),z=n(7876),J=n(8407),Q=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Y(e,t,n){return Q(this,arguments,void 0,function*(e,t,n,o=!1,i=!1){var r,s;if(Zi)try{return(yield cr("CreateConnectionBetweenTwoConcepts",{ofTheConcept:e,toTheConcept:t,linker:n,both:o,count:i})).data}catch(e){console.error("CreateConnectionBetweenTwoConcepts sw error: ",e),hr(e)}let c=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,c));let a=yield(0,J.A)("connection",s,!1,999,999,999),l=new U.N(0,t.id,e.id,c,a.id,1e3,4);M.Y.AddConnection(l)}let a=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s_"+a;i&&(yield X(a,e,c));let d=yield(0,J.A)("connection",l,!1,999,999,999),u=new U.N(0,e.id,t.id,c,d.id,1e3,4);return M.Y.AddConnection(u),u})}function X(e,t){return Q(this,arguments,void 0,function*(e,t,n=null){var o;let i=t,r=null!=n?n:t.userId,s=e+"_count",c=(null===(o=t.type)||void 0===o?void 0:o.characterValue)+"_s_"+s,a=yield(0,J.A)("connection",c,!1,r,4,999),l=yield F(a.id,t.id,r,10,1),d=[],u=(0,W.o)();for(let e=0;e<l.length;e++){let t=yield(0,z.A)(l[e].toTheConceptId);d.push(t)}if(d.length<1)u=yield(0,J.A)("count","1",!1,r,4,999);else{let e=d[0],t=0;try{t=Number(e.characterValue)}catch(e){t=0}t+=1,u=yield(0,J.A)("count",t.toString(),!1,r,4,999);for(let e=0;e<l.length;e++)(0,q.m)(l[e].id)}let h=new U.N(0,i.id,u.id,i.userId,a.id,1e3,4);yield M.Y.AddConnection(h)})}function Z(e,t,n){return Q(this,arguments,void 0,function*(e,t,n,o=!1,i=!1){var r,s;let c=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,c));let a=yield(0,J.A)("connection",s,!1,999,999,999),l=new U.N(0,t.id,e.id,c,a.id,1e3,4);M.Y.AddConnection(l)}let a=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s_"+a;i&&(yield X(a,e,c));let d=yield(0,J.A)("connection",l,!1,999,999,999);return yield H(e.id,e.userId,t.id,d.id,1e3,4)})}var K=n(5868),ee=(n(3655),function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})});function te(e,t){const n=ao.V.logfunction("storeToDatabase",[e,"noindexdb"]);ao.V.logUpdate(n)}function ne(e,t,n){return ee(this,void 0,void 0,function*(){const t=ao.V.logfunction("getFromDatabaseWithType",[e,"noindexdb"]);ao.V.logUpdate(t)})}function oe(e){return ee(this,void 0,void 0,function*(){const t=ao.V.logfunction("getObjectsFromIndexDb",[e,"noindexdb"]);ao.V.logUpdate(t)})}var ie=n(1666),re=n(4402),se=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ce(e,t){var n=arguments;return se(this,arguments,void 0,function*(e,t,o=10,i=1){var r;const s=ao.V.logfunction("GetLink",n)||{};if(Zi){s.serviceWorker=!0;try{const n=yield cr("GetLink",{id:e,linker:t,inpage:o,page:i});return ao.V.logUpdate(s),n.data}catch(e){console.error("GetLink sw error: ",e),(0,u.ey)(s,"GetLink",e),hr(e)}}let c=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield F(d.id,a.id,a.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);yield(0,f.Y)(t);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield(0,z.A)(n),i=yield(0,y.Ez)(o.id);c.push(i)}}return ao.V.logUpdate(s),c})}function ae(e,t){var n=arguments;return se(this,arguments,void 0,function*(e,t,o=10,i=1){var r;const s=ao.V.logfunction("GetLinkRaw",n);let c=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield F(d.id,a.id,a.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield(0,z.A)(n);c.push(o)}}return ao.V.logUpdate(s),c})}var le=n(8357),de=n(843),ue=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const he=new Map;function pe(e,t){var n=arguments;return ue(this,void 0,void 0,function*(){const t=ao.V.logfunction("MakeTheTypeConceptApi",n);let o=(0,W.o)();if(he.has(e))return he.get(e)||o;const i=(()=>ue(this,void 0,void 0,function*(){try{if(o=yield(0,de.Az)(e),0==o.id||4==o.typeId){let n=(0,d.Xr)("application/x-www-form-urlencoded");const i=yield fetch(l.B.MakeTheTypeConceptUrl(),{method:"POST",headers:n,body:`type=${e}`});if(!i.ok)throw(0,u.ry)(i),new Error(`Error! status: ${i.status}`);let r=yield i.json();o=r,ao.V.logUpdate(t)}}catch(e){e instanceof Error?console.log("Make The Type Concept Api error : ",e.message):console.log("Make The Type Concept Api error : ",e),(0,u.Mb)(e,l.B.MakeTheTypeConceptUrl()),(0,u.ey)(t,"MakeTheTypeConceptApi",e)}finally{he.delete(e)}return o}))();return he.set(e,i),i})}var fe=n(8675),ve=n(6058),ye=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ge(e){var t=arguments;return ye(this,void 0,void 0,function*(){const n=ao.V.logfunction("GetLinkerConnectionFromConcepts",t);let o=yield(0,fe.l)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return ao.V.logUpdate(n),o})}function me(e){var t=arguments;return ye(this,void 0,void 0,function*(){const n=ao.V.logfunction("GetLinkerConnectionToConcepts",t);let o=yield(0,ve.W)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return ao.V.logUpdate(n),o})}var Ce=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},we=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},Ie=n(6963),Te=n(2202),ke=n(5457),Ae=n(991),Se=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ne(e){var t=arguments;return Se(this,void 0,void 0,function*(){const n=ao.V.logfunction("DeleteConceptById",t);if(Zi)try{return(yield cr("DeleteConceptById",{id:e})).data}catch(e){console.error("DeleteConceptById sw error: ",e),hr(e)}if(e>0){var o=yield a.I.GetConcept(e);if(o.id>0){var i=o.typeId,r=o.characterValue;yield ke.c.removeTypeConcept(i,e),yield Ie.f.removeNodeByCharacter(r,e),yield function(e){var t=arguments;return we(this,void 0,void 0,function*(){let n=!1;const o=ao.V.logfunction("DeleteTheConcept",t);try{const t=new FormData;t.append("id",e.toString());let i=(0,d.BZ)();const r=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",headers:i,body:t});r.ok?n=(yield r.json()).success:(console.log("Delete concept error",r.status),(0,u.ry)(r)),n&&a.I.AddNpc(e),ao.V.logUpdate(o)}catch(e){e instanceof Error?console.log("Delete concept error message: ",e.message):console.log("Delete concept unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl()),(0,u.ey)(o,"DeleteTheConcept",e)}return n})}(e),yield Te.W.removeNodeFromTree(e),yield Ae.H.removeNodeFromTree(e)}}else v.v.RemoveConceptById(e);ao.V.logUpdate(n)})}function _e(e){return Se(this,void 0,void 0,function*(){if(Zi)try{return(yield cr("DeleteUser",{id:e})).data}catch(e){console.error("DeleteUser sw error: ",e),hr(e)}e>0?function(e){var t=arguments;Ce(this,void 0,void 0,function*(){const n=ao.V.logfunction("DeleteUserInBackend",t);try{var o=(0,d.ab)("application/json","");let t=l.B.DeleteUserUrl();t=t+"?conceptId="+e+"&apiKey=freeschema";const i=yield fetch(t,{method:"POST",headers:o});if(i.ok){let e=yield i.json(),t=Number(e.data);return console.log("this is the delete email concept",t),Ne(t),ao.V.logUpdate(n),t}throw(0,u.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl()),(0,u.ey)(n,"DeleteUserInBackend",e)}})}(e):v.v.RemoveConceptById(e)})}var be=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Le(e,t){return be(this,void 0,void 0,function*(){try{const n=new Headers;n.append("Authorization","Bearer "+t);const o=new FormData;o.append("id",e.toString());const i=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",body:o,headers:n});if(!i.ok)throw(0,u.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl())}})}var Ee=n(1735),xe=n(8286),Oe=n(1596),Be=n(3278),Re=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};var De=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ge(e){var t=arguments;return De(this,void 0,void 0,function*(){const n=ao.V.logfunction("GetConnectionById",t);if(console.log("AccessTracker activation status from GetConnectionById"),!0===Ee.J.activateStatus)try{Ee.J.incrementConnection(e)}catch(e){console.error("Error adding connection in access tracker"),ao.V.log("ERROR","Error Adding Connection")}if(Zi)try{return(yield cr("GetConnectionById",{id:e})).data}catch(e){console.error("GetConnectionById sw error: ",e),hr(e)}let o=yield xe.d.GetConnection(e);return null!=o&&0!=o.id||null==e||null==e||(o=yield function(e){var t=arguments;return Re(this,void 0,void 0,function*(){const n=ao.V.logfunction("GetConnection",t);let o=yield xe.d.GetConnection(e);try{if(0!=o.id)return o;{const t=new FormData;t.append("id",e.toString());const i={method:"POST",headers:{Authorization:"Bearer "+Be.b.BearerAccessToken},body:t};let r;try{r=yield fetch(l.B.GetConnectionUrl(),i)}catch(e){r=yield(0,Oe.g)(i,"/api/get-connection-by-id")}return yield function(e,t){return Re(this,void 0,void 0,function*(){e.ok?(t=yield e.json(),xe.d.AddConnection(t)):((0,u.ry)(e),console.log("Get Connection Error",e.status))})}(r,o),ao.V.logUpdate(n),o}}catch(e){e instanceof Error?console.log("Get Connection error message: ",e.message):console.log("Get Connection unexpected error: ",e),(0,u.Mb)(e,l.B.GetConnectionUrl()),(0,u.ey)(n,"GetConnection",e)}})}(e)),ao.V.logUpdate(n),o})}var Pe=n(2212),Fe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},Ue=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Me(e,t,n){return Ue(this,arguments,void 0,function*(e,t,n,o=4,i=999){const r=ao.V.logfunction("MakeTheTimestamp")||{};if(Zi){r.serviceWorker=!0;try{const s=yield cr("MakeTheTimestamp",{type:e,referent:t,userId:n,accessId:o,sessionInformationId:i});return ao.V.logUpdate(r),s.data}catch(e){console.error("MakeTheTimestamp sw error: ",e),(0,u.ey)(r,"MakeTheTimestamp",e),hr(e)}}let s,c="",a=e.startsWith("the_"),l=(0,W.o)();c=a?e:"the_"+e,l=yield pe(c,n);let d=yield function(e,t,n,o,i,r,s){return Fe(this,void 0,void 0,function*(){let n=yield(0,re.A)(e,o),i=n;return 0==i.id&&(n=yield(0,Pe.Ay)(e,t,4,o,0,r,s),i=n),i})}(t,n,0,l.id,0,o,c);return s=d,ao.V.logUpdate(r),s})}class We{constructor(){this.composition=0,this.type="",this.linker="",this.inpage=10,this.page=1,this.listLinkers=[],this.fullLinkers=[],this.textSearch="",this.logic="or",this.reverse=!1,this.doFilter=!1,this.filterSearches=[],this.selectors=[],this.ofCompositions=[]}}var je=n(6687),Ve=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function $e(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const r=ao.V.logfunction("RecursiveSearchApi",e)||{};let s=[];try{if(Zi){r.serviceWorker=!0;try{const e=yield cr("RecursiveSearchApi",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return ao.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApi sw error: ",e),(0,u.ey)(r,"RecursiveSearchApi",e),hr(e)}}let e=new We;e.composition=t,e.listLinkers=n,e.fullLinkers=i,e.textSearch=o;let c=JSON.stringify(e),a=(0,d.Xr)("application/json");const h=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:a,body:c});if(h.ok){const e=yield h.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,s=yield(0,je.p8)(t,n)}else console.log("recursive search error ",h.status),(0,u.ey)(r,"RecursiveSearchApi",h.status),(0,u.ry)(h);ao.V.logUpdate(r)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(r,"RecursiveSearchApi",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}return s})}function He(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=ao.V.logfunction("RecursiveSearchApiWithInternalConnections",e)||{};let r=[];try{if(Zi){i.serviceWorker=!0;try{const e=yield cr("RecursiveSearchApiWithInternalConnections",{composition:t,listLinkers:n,textSearch:o});return ao.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiWithInternalConnections sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiWithInternalConnections",e),hr(e)}}let e=new We;e.composition=t,e.listLinkers=n,e.textSearch=o;let s=JSON.stringify(e),c=(0,d.Xr)("application/json");const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(a.ok){const e=yield a.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,r=yield(0,je.km)(t,n),ao.V.logUpdate(i)}else console.log("recursive search error ",a.status),(0,u.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",a.status),(0,u.ry)(a)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}return r})}function qe(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const r=ao.V.logfunction("RecursiveSearchApiRaw",e)||{};try{if(Zi){r.serviceWorker=!0;try{const e=yield cr("RecursiveSearchApiRaw",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return ao.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApiRaw sw error: ",e),(0,u.ey)(r,"RecursiveSearchApiRaw",e),hr(e)}}let e=new We;e.composition=t,e.listLinkers=n,e.textSearch=o,e.fullLinkers=i;let s=JSON.stringify(e),c=(0,d.Xr)("application/json");const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(a.ok){const e=yield a.json();return e.compositionIds,e.internalConnections,e.externalConnections,ao.V.logUpdate(r),e}return console.log("recursive search error ",a.status),(0,u.ey)(r,"RecursiveSearchApiRaw",a.status),(0,u.ry)(a),ao.V.logUpdate(r),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(r,"RecursiveSearchApiRaw",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}})}function ze(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=ao.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Zi){i.serviceWorker=!0;try{const e=yield cr("RecursiveSearchApiRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return ao.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiRawFullLinker sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",e),hr(e)}}let e=new We;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)("application/json");const c=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:r});if(c.ok){const e=yield c.json();return e.compositionIds,e.internalConnections,e.externalConnections,ao.V.logUpdate(i),e}return console.log("recursive search error ",c.status),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",c.status),(0,u.ry)(c),ao.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl()),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",e)}})}function Je(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=ao.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Zi)try{i.serviceWorker=!0;const e=yield cr("RecursiveSearchApiNewRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return ao.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiNewRawFullLinker sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",e),hr(e)}let e=new We;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)("application/json");const c=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:r});if(c.ok){const e=yield c.json();return e.compositionIds,e.internalConnections,e.externalConnections,ao.V.logUpdate(i),e}return console.log("recursive search error ",c.status),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",c.status),(0,u.ry)(c),ao.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl()),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",e)}})}var Qe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const Ye=["image/jpeg","image/jpg","image/png","image/webp"],Xe=["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","text/plain","application/pdf"];function Ze(e,t){return Qe(this,void 0,void 0,function*(){const n=ao.V.logfunction("uploadAttachment");try{console.log("File Type",e.type);const o=new FormData;let i;if(Xe.includes(e.type)||e.name.toLowerCase().endsWith(".md"))o.append("file",e,e.name),i=yield tt(o,t);else{if(!Ye.includes(e.type))return{message:"Invalid File Format",success:!1};o.append("image",e,e.name),i=yield Ke(o,t)}return(null==i?void 0:i.data)?(ao.V.logUpdate(n),{message:"Upload Success",success:!0,url:i.data}):{message:"File Upload Failed",success:!1}}catch(e){throw console.error(e),(0,u.ey)(n,"uploadAttachment",e),e}})}function Ke(e){return Qe(this,arguments,void 0,function*(e,t=""){const n=ao.V.logfunction("uploadImage");try{const o=yield fetch(l.B.uploadImageUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),ao.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadImage",e),null}})}function et(e){return Qe(this,arguments,void 0,function*(e,t=""){const n=ao.V.logfunction("uploadImageV2");try{const o=yield fetch(l.B.uploadImageUrlWithSmall(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),ao.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadImageV2",e),null}})}function tt(e){return Qe(this,arguments,void 0,function*(e,t=""){const n=ao.V.logfunction("uploadFile");try{const o=yield fetch(l.B.uploadFileUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(o.text());const t=yield o.text();return console.error(`${o.status} ${t}`),null}return ao.V.logUpdate(n),yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadFile",e),null}})}function nt(){return Qe(this,void 0,void 0,function*(){let e=yield(0,d.Xr)(),t={};try{const n=yield fetch(l.B.UploadFileLimitUrl(),{method:"GET",headers:e});n.ok&&(t=n.json())}catch(e){throw console.error(e),e}return t})}var ot=n(1239),it=n(7467),rt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function st(e,t){var n=arguments;return rt(this,arguments,void 0,function*(e,t,o="boomconsole.com"){const i=ao.V.logfunction("LoginToBackend",n);try{let n={email:e,password:t,application:o},r=new Headers;r.append("Content-Type","application/json");let s=JSON.stringify(n);const c=yield fetch(l.B.LoginUrl(),{method:"POST",headers:r,body:s}),a=yield c.json();if(c.ok)return Be.b.BearerAccessToken=a.data.token,ao.V.logUpdate(i),a;console.log("Login tsccs error message: ",c.status),(0,u.ER)(c,a)}catch(e){e instanceof Error?console.log("Login tsccs error message: ",e.message):console.log(" Login tsccs unexpected error: ",e),(0,u.Mb)(e,l.B.LoginUrl()),(0,u.ey)(i,"LoginToBackend",e)}})}var ct=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function at(e){return ct(this,void 0,void 0,function*(){const t=yield function(){return ct(this,arguments,void 0,function*(e="",t={}){let n={message:"success",status:!1,statusCode:200,data:"cannot signup"};try{const o=yield fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(t)}),i=yield o.json();return o.ok?n={message:"success",status:!0,statusCode:200,data:i}:(0,u.ER)(o,i),n}catch(t){console.log("Signup Error: ",t),(0,u.Mb)(t,e)}})}(l.B.SignupUrl(),e);return t})}function lt(e){return ct(this,void 0,void 0,function*(){const t=l.B.NODE_URL,n=yield fetch(`${t}/api/v1/entity/signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok)return n.json();{if(404===n.status)throw new Error("404, Not found");if(500===n.status)throw new Error("500, internal server error");let e=yield n.json();throw console.log("This is the error from package",e),new Error(e.message)}})}var dt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ut(e){return dt(this,void 0,void 0,function*(){const t=JSON.stringify({email:e.email,password:e.password});let n={message:"success",status:!1,statusCode:200,data:""};const o=new Headers;o.append("Content-Type","application/json");const i=l.B.LoginUrl();try{const e=yield fetch(i,{method:"POST",headers:o,body:t,redirect:"follow"}),r=yield e.json();if(e.ok){const e=null==r?void 0:r.data;n={message:"success",status:!0,statusCode:200,data:e},rr(e.token)}else(0,u.ER)(e,r);return n}catch(e){console.log("Sign in api error",e),(0,u.Mb)(e,i)}})}var ht=n(9934),pt=n(4485);function ft(e=[],t){Array.isArray(e)&&e.splice(e.findIndex(function(e){return e.id===t.id}),1)}function vt(e=[],t){Array.isArray(e)&&e.splice(e.findIndex(function(e){return e.id===t.id}),1)}class yt{constructor(e,t,n,o){this.expiryTime=new Date(Date.now()+6e5),this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}isValid(){const e=new Date(Date.now());return!(this.expiryTime<e&&(mt.removeNodeFromTree(this.key),1))}saveToCache(e){this.value.cached=e}addNode(e,t,n){if(null==t)return e;const o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return this.isValid(),e;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));const r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return this.isValid(),t}rightRotate(e){if(e){const t=e.leftNode;if(t){const n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){const t=e.rightNode;if(t){const n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key&&t.isValid()?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){const t=e.rightNode;return e=null,t}if(null==e.rightNode){const t=e.leftNode;return e=null,t}{const t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.rightNode=this.removeNode(e.rightNode,t.key),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var gt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class mt{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addCompositionToTree(e){const t=new yt(e.id,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return gt(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return gt(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}mt.root=null;var Ct=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function wt(e,t,n,o){return Ct(this,arguments,void 0,function*(e,t,n,o,i=[]){var r,s;let c={};const l=[];if(0==e)return"";let d=It(n,e);if(null!=d&&0!=d.id||null==e||null==e||(d=yield(0,z.A)(e)),0!=d.id&&null==d.type){const e=d.typeId;let t=It(n,e);d.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,z.A)(e),d.type=t)}if(!o.includes(e))return null==d?void 0:d.characterValue;if(i.includes(e))return"";i.push(e);for(let d=0;d<t.length;d++)if(t[d].ofTheConceptId==e){const u=t[d].toTheConceptId;if(o.includes(e)){let e=It(n,u);if(null!=e&&0!=e.id||null==u||null==u||(e=yield(0,z.A)(u)),0!=e.id&&null==(null==e?void 0:e.type)){const t=e.typeId;let n=yield a.I.GetConcept(t);e.type=n,null==n&&null!=t&&null!=t&&(n=yield(0,z.A)(t),e.type=n)}const d="the_",h=(null!==(s=null===(r=null==e?void 0:e.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"").replace(d,"");if(isNaN(Number(h))){if(h){const e=yield wt(u,t,n,o,i);c[h]=e}}else{const e=yield wt(u,t,n,o,i);l[h]=e,c=l}}}return c})}function It(e,t){let n=(0,W.o)();for(let o=0;o<e.length;o++)if(t==e[o].id)return n=e[o],n;return n}class Tt{constructor(){this.id=0,this.mainConcept=(0,W.o)(),this.connections=[],this.concepts=[],this.subcompositions=[],this.cached={}}updateCache(){return e=this,t=void 0,o=function*(){if(0==this.mainConcept.id)for(let e=0;e<this.concepts.length;e++)this.concepts[e].id==this.id&&(this.mainConcept=this.concepts[e]);this.cached=yield wt(this.id,this.connections,this.concepts,this.subcompositions,[])},new((n=void 0)||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())});var e,t,n,o}UpdateAcrossDistributedSystem(){var e,t;try{0!=this.id&&(t=null===(e=this.id)||void 0===e?void 0:e.toString(),l.B.MQTT_CONNECTION&&l.B.MQTT_CONNECTION.publish("compositionUpdate",t))}catch(e){console.log("Error while publishing message",e)}}isUpdating(){this.UpdateAcrossDistributedSystem()}GetDataCache(){var e,t,n;const o={};o[null!==(n=null===(t=null===(e=this.mainConcept)||void 0===e?void 0:e.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=this.cached;const i={};return i.data=o,i.id=this.id,i}}var kt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function At(e){return kt(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,c=null){const a=null!=i?i:999,l=null!=r?r:4,d=null!=s?s:999;let u=null!=o?o:0,h=(0,W.o)();null==c&&(c=new Tt);for(const o in e)if("object"==typeof e[o]||Array.isArray(e[o])){const p=yield(0,J.A)(o,"",!0,a,l,d);if(null==t&&null==n){let t=u;h=p,t=p.id,u=p.id,c.concepts.push(p),c.id=p.id,yield At(e[o],p.id,p.userId,t,i,r,s,c)}else{const a=null!=t?t:999,l=null!=n?n:999,d=u;h=p,c.concepts.push(p);const f=yield(0,ie.q)(a,l,p.id,d);c.connections.push(f),yield At(e[o],p.id,p.userId,d,i,r,s,c)}null!=e[o]&&null!=e[o]&&c.subcompositions.push(p.id)}else{const i=null!=t?t:999,r=null!=n?n:999,s=u,h=yield(0,J.A)(o,e[o],!1,a,l,d);c.concepts.push(h);const p=yield(0,ie.q)(i,r,h.id,s);c.connections.push(p)}return h})}var St=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Nt(e){return St(this,void 0,void 0,function*(){const t=ao.V.logfunction("UpdateComposition")||{};if(Zi){t.serviceWorker=!0;try{const n=yield cr("UpdateComposition",{patcherStructure:e});return ao.V.logUpdate(t),n.data}catch(e){console.error("UpdateComposition sw error: ",e),(0,u.ey)(t,"UpdateComposition",e),hr(e)}}const n=e.userId,o=e.sessionId,i=e.accessId;let r=[];const s=[];let c=(0,W.o)(),a=(0,W.o)();const l=[];let d=e.compositionId;const h=e.ofTheCompositionId;let p=[];if(d<0){let e=yield(0,z.A)(d,n);if(!(e.id>0))return null;d=e.id}r=yield(0,R.s)(d);const f=[],v=new Tt,y=[];v.id=d,v.isUpdating();let g=[];for(let e=0;e<r.length;e++)(0,ht.A)(y,r[e].ofTheConceptId),(0,ht.A)(f,r[e].ofTheConceptId),(0,ht.A)(f,r[e].toTheConceptId),g.push(r[e].ofTheConceptId);v.subcompositions=y,v.connections=r;for(let e=0;e<f.length;e++){const t=yield(0,z.A)(f[e]);d==f[e]&&(c=t),h==f[e]&&(a=t),s.push(t)}const m=e.patchObject;for(const e in m){let t=(0,W.o)();const r=m[e];let d=c;if(a.id>0&&(d=a),Array.isArray(r)||"object"==typeof r){t=yield(0,J.A)(e,"",!0,c.userId,4,999),v.subcompositions.push(t.id);const n=(0,pt.vo)(s,t);for(let e=0;e<n.length;e++)if(n[e].id>0){const t=(0,pt.wS)(v.connections,n[e].id);p=p.concat(t),l.push(n[e])}yield At(m[e],t.id,t.userId,c.id,c.userId,4,999,v)}else{t=yield(0,J.A)(e,r,!1,n,i,o);const c=(0,pt.vo)(s,t);for(let e=0;e<c.length;e++)if(c[e].id>0){const t=(0,pt.wS)(v.connections,c[e].id);p=p.concat(t),l.push(c[e])}}const u=(0,ie.q)(d.id,d.userId,t.id,c.id);s.push(t),v.connections.push(u)}for(let e=0;e<p.length;e++)vt(v.connections,p[e]),(0,q.m)(p[e].id);for(let e=0;e<l.length;e++)ft(s,l[e]);v.concepts=v.concepts.concat(s),v.mainConcept=c,v.id=c.id,yield v.updateCache(),mt.addCompositionToTree(v),M.Y.SyncDataOnline();let C=v.GetDataCache();return ao.V.logUpdate(t),C})}var _t=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function bt(e,t,n,o){return _t(this,arguments,void 0,function*(e,t,n,o,i=10,r=1){var s=(0,d.ab)("application/x-www-form-urlencoded",o),c=new URLSearchParams;c.append("type",e),c.append("search",t),c.append("composition",n),c.append("inpage",i.toString()),c.append("page",r.toString());const a=l.B.SearchCompositionsUrl()+"?"+c.toString();try{const e=yield fetch(a,{method:"GET",headers:s});return e.ok?yield e.json():((0,u.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,u.Mb)(e,a)}})}var Lt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Et(e){return Lt(this,arguments,void 0,function*(e,t=""){var n=(0,d.ab)("application/json",t);const o=l.B.SearchLinkMultipleAll(),i=JSON.stringify(e);try{const e=yield fetch(o,{method:"POST",headers:n,body:i});return e.ok?yield e.json():(console.log("This is the searching error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,u.Mb)(e,o)}})}var xt=n(7139),Ot=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Bt(e){return Ot(this,arguments,void 0,function*(e,t=[]){var n,o;let i=[];const r=[];let s={},c={};const l=yield mt.getNodeFromTree(e),d=[];let u=yield a.I.GetConcept(e);if(0==u.id&&null!=e&&null!=e&&(u=yield(0,xt.r)(e)),null==l){let a=[];a=t.length>0?Rt(e,t):yield(0,R.s)(e),i=a;for(let e=0;e<i.length;e++)d.includes(i[e].ofTheConceptId)||(d.push(i[e].ofTheConceptId),r.push(i[e].ofTheConceptId)),r.includes(i[e].toTheConceptId)||r.push(i[e].toTheConceptId);Pt(u,i,r,d);let l=[];c=yield(0,y.zN)(e,i,d,l),s[null!==(o=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c}else c=l.value.GetDataCache(),s=c;return 0==u.id?"":s})}function Rt(e,t){const n=[];for(let o=0;o<t.length;o++)t[o].typeId==e&&n.push(t[o]);return n}function Dt(e){return Ot(this,arguments,void 0,function*(e,t=[]){var n,o;let i={},r=[];const s=[];let c;const l={},d=yield mt.getNodeFromTree(e),u=[];let h=yield a.I.GetConcept(e);if(0==h.id&&null!=e&&null!=e&&(h=yield(0,xt.r)(e)),null==d){let a=[];a=t.length>0?Rt(e,t):yield(0,R.s)(e),r=a;for(let e=0;e<r.length;e++)u.includes(r[e].ofTheConceptId)||(u.push(r[e].ofTheConceptId),s.push(r[e].ofTheConceptId)),s.includes(r[e].toTheConceptId)||s.push(r[e].toTheConceptId);Pt(h,r,s,u),c=yield(0,y.zN)(e,r,u),l[null!==(o=null===(n=null==h?void 0:h.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c,i.created_at=h.entryTimeStamp,i.data=l,i.id=e}else c=d.value.GetDataCache(),i=c;return 0==h.id?"":i})}function Gt(e,t){return Ot(this,void 0,void 0,function*(){let n=[];const o=[];n=yield(0,it.j)(t);for(let t=0;t<e.length;t++){const i=yield Dt(e[t],n);i&&o.push(i)}return o})}function Pt(e,t,n,o){return Ot(this,void 0,void 0,function*(){const i=new Tt,r=yield function(e){return Ot(this,void 0,void 0,function*(){let t=[];const n=[];for(let o=0;o<(null==e?void 0:e.length);o++){const i=yield a.I.GetConcept(e[o]);0==i.id?n.push(e[o]):t.push(i)}return 0==(null==n?void 0:n.length)||(t=yield(0,ot.I)(n)),t})}(n);i.connections=t,i.concepts=r,i.id=e.id,i.subcompositions=o,i.mainConcept=e;const s=yield wt(e.id,t,r,o,[]);i.cached=s,mt.addCompositionToTree(i)})}var Ft=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ut(e){return Ft(this,void 0,void 0,function*(){try{var t=(0,d.Xr)();const n=JSON.stringify(e),o=yield fetch(l.B.CreateSessionId(),{method:"POST",headers:t,body:n});return o.ok?o.json():(console.log("Creating session failed",yield o.json()),(0,u.ry)(o),null)}catch(e){console.log("Creating session failed",e),(0,u.Mb)(e,l.B.CreateSessionId())}})}var Mt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Wt(e,t){return Mt(this,void 0,void 0,function*(){try{var n=(0,d.Xr)("application/x-www-form-urlencoded");const o=new URLSearchParams;o.append("sessionId",e.toString()),o.append("url",t);const i=yield fetch(l.B.CreateSessionVisitUrl(),{method:"POST",headers:n,body:o});return i.ok?i.json():(console.log("Creating session url failed",yield i.json()),(0,u.ry)(i),null)}catch(e){console.log("Creating session url failed",e),(0,u.Mb)(e,l.B.CreateSessionVisitUrl())}})}var jt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Vt(e,t,n){return jt(this,arguments,void 0,function*(e,t,n,o=10,i=1){let r=[];try{var s=new URLSearchParams;s.append("typeId",`${e}`),s.append("toTheConceptId",`${t}`),s.append("userId",`${n}`),s.append("inpage",`${o}`),s.append("page",`${i}`);var c=(0,d.Xr)("application/x-www-form-urlencoded");const a=yield fetch(l.B.GetAllConnectionsToConceptUrl(),{method:"POST",headers:c,body:s});return a.ok?r=yield a.json():(console.log("Get connection of concept error",a.status),(0,u.ry)(a)),r}catch(e){throw e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),e}})}var $t=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ht(e,t){var n=arguments;return $t(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=ao.V.logfunction("GetRelation",n)||{};if(Zi){s.serviceWorker=!0;try{const n=yield cr("GetRelation",{id:e,relation:t,inpage:o,page:i,reverse:r});return ao.V.logUpdate(s),n.data}catch(e){console.error("GetRelation error sw: ",e),(0,u.ey)(s,"GetRelation",e),hr(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[];if(l.id>0)if(r){d=yield Vt(l.id,a.id,a.userId,o,i);let e=[];for(var h=0;h<d.length;h++)e.push(d[h].ofTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].ofTheConceptId,n=yield(0,z.A)(t),o=yield(0,y.Ez)(n.id);c.push(o)}}else{d=yield F(l.id,a.id,a.userId,o,i);let e=[];for(let t=0;t<d.length;t++)e.push(d[t].toTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].toTheConceptId,n=yield(0,z.A)(t),o=yield(0,y.Ez)(n.id);c.push(o)}}return ao.V.logUpdate(s),c})}function qt(e,t){return $t(this,arguments,void 0,function*(e,t,n=10,o=1,i=!1){let r=new bo;r.conceptIds=[e],r.selectors=[t],r.outputFormat=Sn.y0,r.inpage=n,r.page=o,r.limit=!0;let s=yield Go(r,"");return console.log("this is the output for get relation",s),s})}function zt(e,t){var n=arguments;return $t(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=ao.V.logfunction("GetRelationRaw",n)||{};if(Zi){s.serviceWorker=!0;try{const n=yield cr("GetRelationRaw",{id:e,relation:t,inpage:o,page:i,reverse:r});return ao.V.logUpdate(s),n.data}catch(e){console.error("GetRelationRaw error sw: ",e),(0,u.ey)(s,"GetRelationRaw",e),hr(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[],h=[];if(l.id>0){if(r){d=yield Vt(l.id,a.id,a.userId,o,i);for(var p=0;p<d.length;p++)h.push(d[p].ofTheConceptId)}else{d=yield F(l.id,a.id,a.userId,o,i);for(let e=0;e<d.length;e++)h.push(d[e].toTheConceptId)}c=yield(0,ot.r)(h)}return ao.V.logUpdate(s),c})}var Jt=n(6416),Qt=n(4711);class Yt{constructor(e,t,n,o){this.value=[],this.height=1,this.key=e,this.value.push(t),this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t.value.push(...e.value),t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var n=this.inOrderSuccessor(e.rightNode);return e.value=n.value,e.key=n.key,e.rightNode=this.removeNode(e.rightNode,n.key),e}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var Xt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Zt{static compositeKey(e,t){return("0000"+e.toString(16).toUpperCase()).slice(-4)+("0000"+t.toString(16).toUpperCase()).slice(-4)}static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static waitForDataToLoad(){return Xt(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(Zt.checkFlag,1e3,e)}static addConceptToTree(e,t,n=999){let o=this.compositeKey(t,n);var i=new Yt(o,e,null,null);this.addNodeToTree(i)}static getNodeFromTree(e,t){return Xt(this,void 0,void 0,function*(){let n=this.compositeKey(e,t);return this.root?this.root.getFromNode(n,this.root):null})}static removeNodeFromTree(e){return Xt(this,arguments,void 0,function*(e,t=999){if(this.root){let n=this.compositeKey(e,t);this.root=this.root.removeNode(this.root,n)}})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}Zt.root=null;var Kt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function en(e,t){return Kt(this,arguments,void 0,function*(e,t,n=999){let o=yield Zt.getNodeFromTree(e,n),i=(0,Jt.u)();if(o)for(let e=0;e<o.value.length;e++){let n=o.value[e];n.ghostId==t&&(i=n)}return i})}function tn(e,t){return Kt(this,arguments,void 0,function*(e,t,n=999){Zt.addConceptToTree(e,t,n)})}var nn=n(5312),on=n(1213),rn=n(3729),sn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},cn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function an(e,t,n){return cn(this,void 0,void 0,function*(){try{if(Zi)try{return(yield cr("GetRelationLocal",{id:e,relation:t,userId:n})).data}catch(e){console.error("GetRelationLocal error sw: ",e),hr(e)}let o=yield(0,m.$I)(t),i=[];0!=o.id&&(i=yield function(e,t){return sn(this,void 0,void 0,function*(){try{return yield S.G.GetConnectionOfCompositionAndTypeLocal(t,e)}catch(e){throw e}})}(e,o.id));let r=[];for(let e=0;e<i.length;e++){let t=yield b(i[e].toTheConceptId);r.push(t)}return r}catch(e){throw e}})}var ln=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function dn(e){return ln(this,void 0,void 0,function*(){let t=[];try{var n=(0,d.Xr)();const o=yield fetch(l.B.ViewInternalDataUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(o.ok){let e=yield o.json(),n={};for(let o=0;o<e.length;o++){let i=e[o].concepts;t=e[o].connections;let r=e[o].id;(0,ot.r)(i),n[r]=t}return n}return console.log("View Internal Data error",o.status),(0,u.ry)(o),t}catch(e){throw e instanceof Error?console.log(" This is the view internal data error message: ",e.message):console.log(" This is the view internal data unexpected error: ",e),e}})}var un=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function hn(e){return un(this,void 0,void 0,function*(){var t;try{let n=yield dn(e),o=[];for(let i=0;i<e.length;i++){let r=e[i],s=n[r];if(r&&s){let e=[],t={};for(let t=0;t<s.length;t++)e.includes(s[t].ofTheConceptId)||e.push(s[t].ofTheConceptId);let n=yield(0,y.zN)(r,s,e);t.data=n,t.id=r,o.push(t)}else{let e={};e.id=r;let n=yield(0,z.A)(r),i={};n.type&&(i[null===(t=null==n?void 0:n.type)||void 0===t?void 0:t.characterValue]=n.characterValue,e.data=i,o.push(e))}}return o}catch(e){throw e}})}var pn=n(176),fn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})},vn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function yn(e){return vn(this,arguments,void 0,function*(e,t=""){try{let n=yield function(e){return fn(this,arguments,void 0,function*(e,t=""){var n=(0,d.ab)("application/json",t);let o=l.B.SearchInternalWithAuthenticatedCcsUrl();o=o+"?composition="+e.composition+"&search="+e.search+"&internalComposition="+e.internalComposition+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;try{const e=yield fetch(o,{method:"GET",headers:n});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,u.Mb)(e,o)}})}(e,t);return yield hn(n)}catch(e){throw e}})}function gn(e){return vn(this,arguments,void 0,function*(e,t=""){try{return yield function(e){return fn(this,void 0,void 0,function*(){var t=(0,d.ab)("application/json","");let n=l.B.SearchInternalWithCcsUrl();n=n+"?composition="+e.composition+"&search="+e.search+"&internalComposition="+e.internalComposition+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;try{const e=yield fetch(n,{method:"GET",headers:t});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,u.Mb)(e,n)}})}(e)}catch(e){throw e}})}var mn=n(8095),Cn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function wn(e){return Cn(this,void 0,void 0,function*(){if(Zi)try{return(yield cr("DeleteConceptLocal",{id:e})).data}catch(e){console.error("DeleteConceptLocal error sw: ",e),hr(e)}let t=yield(0,on.f)(e);v.v.RemoveConcept(t)})}var In=n(2803),Tn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function kn(e,t,n,o){return Tn(this,arguments,void 0,function*(e,t,n,o,i=!0){var r,s;const c=ao.V.logfunction("GetConnectionBetweenTwoConceptsLinker")||{};if(Zi){c.serviceWorker=!0;try{const r=yield cr("GetConnectionBetweenTwoConceptsLinker",{ofTheConcept:e,toTheConcept:t,linker:n,fullLinker:o,forward:i});return ao.V.logUpdate(c),r.data}catch(e){console.error("GetConnectionBetweenTwoConceptsLinker sw error: ",e),(0,u.ey)(c,"GetConnectionBetweenTwoConceptsLinker",e),hr(e)}}let a=(0,W.o)();if(""!=n){let o="";o=i?(null===(r=e.type)||void 0===r?void 0:r.characterValue)+"_s_"+n+"_s":(null===(s=t.type)||void 0===s?void 0:s.characterValue)+"_s_"+n+"_by",a=yield(0,J.A)("connection",o,!1,999)}""!=o&&(a=yield pe(o,999));let l=[];return l=i?yield(0,In.x)(e.id,t.id,a.id):yield(0,In.x)(t.id,e.id,a.id),ao.V.logUpdate(c),l})}function An(e,t){return new Promise((n,o)=>{setTimeout(()=>{n(t)},e)})}var Sn=n(3130);const Nn=3,_n=4,bn=5;var Ln=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function En(e,t){return Ln(this,arguments,void 0,function*(e,t,n=""){let o=l.B.SearchAllTypeWithLinker(e.auth);var i=(0,d.ab)("application/json",n);o=o+"?search="+e.search+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;const r=JSON.stringify(t);try{const e=yield fetch(o,{method:"POST",headers:i,body:r});return e.ok?yield e.json():((0,u.ry)(e),console.log("This is the searching multiple error",e.status),[])}catch(e){console.log("This is the searching SearchWithTypeAndLinker error",e),(0,u.Mb)(e,o)}})}var xn=n(4287);class On extends xn.w{constructor(e,t,n=Sn.y0){super(),this.searchQuery=[],this.format=Sn.y0,this.searchQuery=e,this.format=n}bind(){return e=this,t=void 0,o=function*(){return this.data=yield(0,nn.cf)(this.searchQuery,"",this,this.format),this.mainConcept=this.searchQuery[0].composition,this.listenToEvent(this.mainConcept),console.log("this is the data",this.data),this.data},new((n=void 0)||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())});var e,t,n,o}}function Bn(e,t,n=Sn.y0){return new On(e,null!=t?t:"",n)}var Rn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Dn extends xn.w{constructor(e,t=Sn.ZJ){super(),this.id=e,this.format=t}bind(){return Rn(this,void 0,void 0,function*(){if(!this.isDataLoaded){let e=yield(0,y.hL)(this.id);this.mainConcept=this.id,this.compositionIds=e.compositionList;let t=e.connectionList;for(let e=0;e<t.length;e++)this.internalConnections.push(t[e].id);this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return Rn(this,void 0,void 0,function*(){let e=[],t=this.internalConnections;for(let n=0;n<t.length;n++)e.push(yield xe.d.GetConnection(t[n]));return this.format==Sn.ZJ?this.data=yield(0,y.ay)(this.mainConcept,e,this.compositionIds):this.format==Sn.y0?this.data=yield(0,y.$V)(this.mainConcept,e,this.compositionIds):this.format==Sn.yv?this.data=yield(0,y.re)(this.mainConcept,e,this.compositionIds):this.data=yield(0,y.ay)(this.mainConcept,e,this.compositionIds),this.data})}}function Gn(e,t=Sn.ZJ){return new Dn(e,t)}var Pn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Fn extends xn.w{constructor(e,t,n,o,i){super(),this.data=[],this.startPage=0,this.compositionName=e,this.userId=t,this.inpage=n,this.page=o,this.format=i}bind(){return Pn(this,void 0,void 0,function*(){if(!this.isDataLoaded){var e=yield(0,g.A)(this.compositionName);if(e){yield p(this.compositionName,this.userId);let o=yield a.I.GetConceptsByTypeIdAndUser(e.id,this.userId);for(var t=this.inpage*(this.page-1),n=t;n<t+this.inpage;n++)o[n]&&this.compositionIds.push(o[n].id)}yield(0,f.Y)(this.compositionIds),this.isDataLoaded=!0,this.listenToEventType(e.id);for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e])}return yield this.build()})}build(){return Pn(this,void 0,void 0,function*(){if(this.data=[],this.format==Sn.ZJ){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.kx)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==Sn.y0){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.RW)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==Sn.yv){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.XI)(this.compositionIds[e]);this.data.push(t)}}else for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,y.kx)(this.compositionIds[e]);this.data.push(t)}return this.data})}}function Un(e,t,n,o,i=Sn.ZJ){return new Fn(e,t,n,o,i)}var Mn=n(1320),Wn=n(5328),jn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Vn extends xn.w{constructor(e,t,n="",o){super(),this.searchText="",this.connections=[],this.externalConnectionIds=[],this.data=[],this.mainConcept=e,this.searchLinkers=t,this.textSearch=n,o&&(this.format=o)}listenToEvent(e){if(this.eventHandlers[e])return;const t=t=>jn(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return jn(this,void 0,void 0,function*(){try{let n=yield xe.d.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield xe.d.GetConnection(n[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||t.compositionIds.push(e.ofTheConceptId),t.compositionIds.includes(e.toTheConceptId)||t.compositionIds.push(e.toTheConceptId)});t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw console.error("Error in RecursiveSearchObservable event listener:",e),t.isUpdating=!1,e}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}bind(){return jn(this,void 0,void 0,function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;const e=yield qe(this.mainConcept,this.searchLinkers,this.textSearch);this.compositionIds=e.compositionIds||[],this.internalConnections=e.internalConnections||[],this.externalConnectionIds=e.externalConnections||[],this.linkers=this.externalConnectionIds,this.connections=yield(0,it.j)(this.externalConnectionIds);for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return jn(this,void 0,void 0,function*(){return this.externalConnectionIds=this.linkers,this.format&&this.format==Sn.XZ?this.data={compositionIds:this.compositionIds,internalConnections:this.internalConnections,externalConnections:this.externalConnectionIds}:this.data=yield(0,je.p8)(this.compositionIds,this.internalConnections),this.data})}}function $n(e,t,n="",o){return new Vn(e,t,n,o)}var Hn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class qn extends xn.w{constructor(e,t,n,o=Sn.y0){super(),this.searchQuery=[],this.format=Sn.y0,this.mainCompositionIds=[],this.searchCharacter="",this.token="",this.searchStructure=e,this.searchQuery=t,this.searchQuery[0].type=e.composition,this.searchCharacter=e.composition,this.format=o,this.token=Be.b.BearerAccessToken}listenToEventType(e){if(this.eventHandlers[e])return;const t=e=>Hn(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return Hn(this,void 0,void 0,function*(){try{let n=e;t.mainCompositionIds.includes(null==n?void 0:n.detail)||(t.mainCompositionIds.unshift(null==n?void 0:n.detail),t.conceptIds.push(null==n?void 0:n.detail),t.listenToEvent(null==n?void 0:n.detail),xe.d.GetConnectionsOfConcept(null==n?void 0:n.detail).then(e=>{for(let n=0;n<e.length;n++)t.linkers.push(e[n].id)})),t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw console.error("Error in GetLinkListObservable event listener:",e),t.isUpdating=!1,e}})},200)}});this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}bind(){return Hn(this,void 0,void 0,function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;var e=yield(0,g.A)(this.searchCharacter);let t=yield En(this.searchStructure,this.searchQuery,this.token);this.conceptIds=t.compositionIds,this.internalConnections=t.internalConnections,this.linkers=t.linkers,this.reverse=t.reverse,this.mainCompositionIds=t.mainCompositionIds,this.listenToEventType(e.id);for(let e=0;e<this.mainCompositionIds.length;e++)this.listenToEvent(this.mainCompositionIds[e])}return yield this.build()})}build(){return Hn(this,void 0,void 0,function*(){return yield(0,ot.r)(this.conceptIds),this.format==Sn.y0?this.data=yield(0,Mn.yV)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse):this.data=yield(0,Mn._W)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse),this.data})}}function zn(e,t,n,o=Sn.y0){return new qn(e,t,n,o)}var Jn=n(4698),Qn=n(6915),Yn=n(2615);class Xn{constructor(e,t,n,o,i,r,s,c=!1,a,d,u){this.structureType="lconcept",this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=l.B.getRandomizer(),this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=o,this.characterValue=r,this.accessId=i,this.type=null,this.isNew=c,this.typeCharacter=s,this.entryTimeStamp=a,this.updatedTimeStamp=d,this.isSynced=!1,this.referentId=u}getType(){console.log(this.typeId)}}class Zn{constructor(e,t,n,o,i,r){this.isTemp=!1,this.applicationId=l.B.getRandomizer(),this.type=(0,W.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.typeId=o,this.ghostId=e,this.orderId=i,this.typeCharacter="",this.accessId=r,this.typeCharacter="",this.entryTimeStamp=(0,W.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date}}class Kn{constructor(){this.compositionId=0,this.userId=999,this.sessionId=999,this.accessId=4,this.ofTheCompositionId=0,this.patchObject={}}}class eo{constructor(){this.id="0",this.remote_address="",this.server_port="",this.server_address="",this.server_name="",this.server_software="",this.http_user_agent="",this.self="",this.port="",this.userId="",this.email=""}}var to=n(628);class no{constructor(){this.type="",this.search="",this.logicoperator="=",this.index=0,this.composition=!0,this.name="",this.operateon=""}}class oo{constructor(){this.type="",this.search="",this.composition="",this.internalComposition="",this.userId=999,this.inpage=10,this.page=1,this.auth=!0}}var io=n(7887),ro=n(3075),so=n(7869),co=n(9635),ao=n(9700);class lo{static initialize(){try{console.warn("Initialized Application Monitoring for tracking errors..."),this.initGlobalErrorHandlers(),this.logCatchError(),this.logErrorEvent(),this.logUnhandledError(),this.logUserInteractions(),this.logNetworkRequests(),this.logRouteChanges()}catch(e){console.error("Error during Application Monitoring initialization:",e)}}static initGlobalErrorHandlers(){try{if(console.log("this is the window",window),void 0===typeof window)return;window.onerror=(e,t,n,o,i)=>{const r=Be.b.sessionId||"unknown",s={message:e,source:t,lineno:n,colno:o,stack:(null==i?void 0:i.stack)||"undefined",requestFrom:l.B.BASE_APPLICATION,sessionId:r};ao.V.logApplication("ERROR","Runtime Error",s),ao.V.log("ERROR","Runtime Error",s)},window.onunhandledrejection=e=>{const t=Be.b.sessionId||"unknown";ao.V.logApplication("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:t}),ao.V.log("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:t})}}catch(e){console.warn("Failed to initialize global error handlers:",e)}}static logCatchError(){try{const e=console.error;console.log("Inside originalConsoleError..."),console.error=function(...t){if("Intercepted Fetch Error:"==(null==t?void 0:t[0]))return;const n="Console Error",o=Be.b.sessionId||"unknown",i={arguments:t.map(e=>uo(e)),requestFrom:l.B.BASE_APPLICATION,sessionId:o};ao.V.logApplication("ERROR",n,i),ao.V.log("ERROR",n,i),e.apply(console,t)}}catch(e){console.warn("Failed to override console.error:",e)}}static logErrorEvent(){try{window.addEventListener("error",e=>{var t;console.log("Inside error event...");const n=Be.b.sessionId||"unknown",o={error:(null===(t=e.error)||void 0===t?void 0:t.message)||e.message,source:e.filename,line:e.lineno,column:e.colno,stack:e.error?uo(e.error.stack):void 0,requestFrom:l.B.BASE_APPLICATION,sessionId:n},i="Unhandled Error";ao.V.logApplication("ERROR",i,o),ao.V.log("ERROR",i,o)})}catch(e){console.warn("Failed to add error event listener:",e)}}static logUnhandledError(){try{window.addEventListener("unhandledrejection",e=>{var t,n;console.log("Inside unhandledrejection...");const o=Be.b.sessionId||"unknown",i={reason:(null===(t=e.reason)||void 0===t?void 0:t.message)||String(e.reason),stack:(null===(n=e.reason)||void 0===n?void 0:n.stack)||"No stack trace available",requestFrom:l.B.BASE_APPLICATION,sessionId:o};ao.V.logApplication("ERROR","Unhandled Promise Rejection",i),ao.V.log("ERROR","Unhandled Promise Rejection",i)})}catch(e){console.warn("Failed to add unhandled rejection event listener:",e)}}static logUserInteractions(){document.addEventListener("click",e=>{var t;const n=Be.b.sessionId||"unknown",o=e.target,i={element:o.tagName,id:o.id,classes:o.className,text:null===(t=o.innerText)||void 0===t?void 0:t.slice(0,50),requestFrom:l.B.BASE_APPLICATION,sessionId:n};ao.V.logApplication("INFO","User Click",i)}),document.addEventListener("input",e=>{const t=e.target;Be.b.sessionId,t.tagName,t.id,t.value,l.B.BASE_APPLICATION}),document.addEventListener("scroll",()=>{Be.b.sessionId,window.scrollY,l.B.BASE_APPLICATION})}static logNetworkRequests(){try{if(void 0===typeof window)return;Be.b.sessionId;const e=null===window||void 0===window?void 0:window.fetch;if(!e)throw new Error("Original fetch is not available.");const t=[l.B.PostLogger(),l.B.PostPrefetchConceptConnections()];window.fetch=(...n)=>{return o=this,i=void 0,s=function*(){const o=Be.b.sessionId||"unknown",[i,r]=n,s=i instanceof Request?i.url:i instanceof URL?i.toString():i;if(t.includes(s))return console.log("Ignored URLs detected : ",s),e(...n);let c={request:{type:"REQUEST",message:"Network Request",method:(null==r?void 0:r.method)||"GET",url:s,body:null==r?void 0:r.body,requestFrom:l.B.BASE_APPLICATION,sessionId:o}};try{const t=yield e(...n);return c.response={type:"RESPONSE",message:"Network Response",url:s,status:t.status,requestFrom:l.B.BASE_APPLICATION,sessionId:o},t}catch(e){throw c.response={type:"ERROR",message:"Network Request Failed",url:s,error:e instanceof Error?e.message:String(e),requestFrom:l.B.BASE_APPLICATION,sessionId:o},ao.V.logApplication("ERROR","Failed Network Request",c),new Error(`Network request failed for ${s}: ${e.message}`)}},new((r=void 0)||(r=Promise))(function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function c(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r(function(e){e(o)})).then(n,c)}a((s=s.apply(o,i||[])).next())});var o,i,r,s}}catch(e){console.warn("Failed to override network requests:",e)}}static logPerformanceMetrics(){void 0!==typeof window&&(null===window||void 0===window||window.addEventListener("load",()=>{const e=performance.timing;Be.b.sessionId,e.loadEventEnd,e.navigationStart,e.domContentLoadedEventEnd,e.navigationStart,l.B.BASE_APPLICATION}))}static logRouteChanges(){const e=history.pushState;setTimeout(()=>{lo.logOnWindowLoad()},3e3),history.pushState=function(...t){const n=Be.b.sessionId||"unknown",o={url:t[2]?new URL(t[2],location.origin).href:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:n};return ao.V.logApplication("ROUTE","Route Change",o),e.apply(this,t)},null===window||void 0===window||window.addEventListener("beforeunload",()=>{const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};ao.V.logApplication("ROUTE","Unload",t)}),null===window||void 0===window||window.addEventListener("popstate",()=>{const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};ao.V.logApplication("ROUTE","Route Changed (Back/Forward)",t)})}static logOnWindowLoad(){const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};ao.V.logApplication("ROUTE","Initial Load",t)}static logSample(){const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};ao.V.logApplication("ROUTE","Sample",t)}static logWebSocketEvents(){if(void 0===typeof window)return;const e=Be.b.sessionId||"unknown",t=WebSocket;window.WebSocket=class extends t{constructor(t,n){super(t,n);const o={url:t.toString(),requestFrom:l.B.BASE_APPLICATION,sessionId:e};ao.V.logApplication("INFO","WebSocket Open",o),this.addEventListener("message",e=>{const n=Be.b.sessionId||"unknown",o={url:t,data:e.data,requestFrom:l.B.BASE_APPLICATION,sessionId:n};ao.V.logApplication("INFO","WebSocket Message",o)}),this.addEventListener("error",e=>{const n=Be.b.sessionId||"unknown",o={url:t,error:e instanceof Error?e.message:String(e),requestFrom:l.B.BASE_APPLICATION,sessionId:n};ao.V.logApplication("ERROR","WebSocket Error",o)}),this.addEventListener("close",()=>{const e=Be.b.sessionId||"unknown",n={url:t,requestFrom:l.B.BASE_APPLICATION,sessionId:e};ao.V.logApplication("INFO","WebSocket Closed",n)})}}}}function uo(e){try{return JSON.stringify(e,(e,t)=>t&&"object"==typeof t&&t instanceof Error?{message:t.message,stack:t.stack}:t)}catch(e){return"Error while serializing value"}}const ho=(e,t,...n)=>{return o=void 0,i=[e,t,...n],s=function*(e,t,n=!1){try{let o=l.B.sendMail();n&&(o=l.B.sendBulkMail());const i=yield fetch(o,{method:"POST",body:e instanceof FormData?e:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),r=i.headers.get("content-type");if(!i.ok){const e=yield i.json();return console.info(`${i.status} ${e}`),null}const s=yield i.json();return r&&r.includes("text/plain")?yield i.text():s}catch(e){return console.error(e),null}},new((r=void 0)||(r=Promise))(function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function c(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r(function(e){e(o)})).then(n,c)}a((s=s.apply(o,i||[])).next())});var o,i,r,s};class po{constructor(){this.inDevelopment=!1,this.subscribers=[]}notify(e=null){this.subscribers.map(t=>{t(e||this.data)})}dataChange(e){this.subscribers.push(e)}}class fo extends po{constructor(){super(...arguments),this.element=null,this.elementIdentifier=0,this.widgetMounted=!1}getComponent(){return this.element}getElementById(e){let t=this.getComponent(),n=document.body;if(t){let o=t.querySelector("#"+e);if(o)return n=o,n}return null}createWidgetWrapperIdentifier(){return this.elementIdentifier=1e4*Math.random(),this.elementIdentifier.toString()}}class vo extends fo{constructor(){super(...arguments),this.html="",this.css="",this.js="",this.state={},this.previousState={},this.childWidgets=[],this.childWidgetElement=[],this.widgetState={},this.parentElement=""}querySelector(e){return this.element?this.element.querySelector(e):null}querySelectorAll(e){return this.element?this.element.querySelectorAll(e):null}getElement(){return this.element}setTitle(e){document.title=e}getHtml(){return this.html}UpdateChildData(e,t){let n=t;n.data=e,n.render(),n.update()}update(){}setState(e){this.previousState=Object.assign({},this),this.data=e,this.state=Object.assign({},this),this.hasStateChanged()&&(this.notify(),this.render())}setStateProperty(e){this.previousState=Object.assign({},this),Object.assign(this,e),this.state=Object.assign({},this),this.hasStateChanged()&&(this.notify(),this.render())}hasStateChanged(){return!this.isPropertyEqual(this.state,this.previousState)}isPropertyEqual(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let i of n){if(!o.includes(i))return!1;for(let n of o)if(i==n&&"state"!=i&&"previousState"!=i&&e[i]!=t[i])return!1}return!0}loadChildWidgets(){this.childWidgets.map(e=>{let t=this.getElementById(e.parentElement);t&&(t.innerHTML=""),e.mount(t)})}render(){this.element&&(this.element.innerHTML=this.getHtml()),this.loadChildWidgets(),this.after_render()}getElementByClassName(e){let t=this.getComponent();return t?null==t?void 0:t.querySelectorAll("."+e):[]}mount_child(){}mount(e){return t=this,n=void 0,i=function*(){e&&(this.element=document.createElement("div"),this.element.id=this.createWidgetWrapperIdentifier(),this.element.innerHTML=this.getHtml(),this.element.classList.add("mftsccs-marking-rendered"),e.appendChild(this.element),this.parentElement=e.id,this.before_render(),this.mount_child(),this.widgetMounted=!0)},new((o=void 0)||(o=Promise))(function(e,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(s,c)}a((i=i.apply(t,n||[])).next())});var t,n,o,i}before_render(){this.render()}after_render(){console.log("this is calling the after render",this)}renderChildWidgets(){function e(t){var n;t&&(null===(n=t.childWidgets)||void 0===n||n.forEach(t=>{e(t)}),t.render())}console.log("this is the render child widget",this),this.childWidgets.forEach(t=>{e(t)})}setWidgetState(e,t){this.widgetState[e]=t,function e(t){t&&Array.isArray(t.childWidgets)&&t.childWidgets.forEach(n=>{n.widgetState=Object.assign(Object.assign({},n.widgetState),t.widgetState),e(n)})}(this),this.renderChildWidgets()}getWidgetState(e,t){return Object.keys.length&&this.widgetState[e]?this.widgetState[e]:t}}var yo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class go extends vo{constructor(){super(...arguments),this.childComponents=[],this.componentMounted=!1,this.oldHtml=null,this.phonebooks=[],this.childrenData={},this.childWidgets=[],this.typeValueList=[],this.widgetType="the_element_name",this.parentConceptList=[],this.customFunctions=[],this.widgetDependenciesData=""}getUserId(){return yo(this,void 0,void 0,function*(){const e=yield new Promise(e=>{let t=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";t?e(JSON.parse(t)):e()});return null==e?void 0:e.userId})}getTypeValueList(){return yo(this,arguments,void 0,function*(e=""){return new Promise(t=>yo(this,void 0,void 0,function*(){const n=null==(e=this.widgetType)?void 0:e.match(/^[a-z0-9]+_[a-z0-9]+/i),o=n?n[0]:"",i=null==e?void 0:e.match(/^([a-z0-9]+).*_([a-z0-9]+)$/i),r=i?`${i[1]}_${i[2]}`:"";let s=[],c=new no;c.type=r,c.search="1",c.logicoperator=">",c.name="emailfilter",c.operateon="entityEmail",c.composition=!1,s.push(c);let a=new bo;a.typeConnection=e,a.name="entityEmail";let l=new bo;l.type=o,l.filterLogic="( emailfilter )",l.filters=s,l.name="top",l.inpage=100,l.freeschemaQueries=[a],l.outputFormat=Sn.y0,Do(l,"").subscribe(n=>{if(null==n?void 0:n.length){const i=null==n?void 0:n.map(t=>{var n,i,s,c,a,l,d;const u=null===(c=null===(s=null===(i=null===(n=t.data)||void 0===n?void 0:n[o])||void 0===i?void 0:i[e])||void 0===s?void 0:s.data)||void 0===c?void 0:c[r];return{id:null===(d=null===(l=null===(a=t.data)||void 0===a?void 0:a[o])||void 0===l?void 0:l[e])||void 0===d?void 0:d.id,name:u,text:u}});return this.typeValueList=i,t(i),i}})}))})}setTitle(e){document.title=e}getHtml(){return this.html}createRandomNumber(){return this.elementIdentifier=1e4*Math.random(),this.elementIdentifier}mount_child(){return yo(this,void 0,void 0,function*(){try{new Function("tsccs",`\n return (async function() {\n ${this.mountChildWidgetsFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the mount child",e),e}})}setProperty(e){return yo(this,void 0,void 0,function*(){return this.widgetType=e,this.getTypeValueList(this.widgetType).then(()=>{var e,t,n;null===(e=this.element)||void 0===e||e.setAttribute("data-type-value",this.widgetType),null===(n=null===(t=this.element)||void 0===t?void 0:t.parentElement)||void 0===n||n.setAttribute("data-type-value",this.widgetType),this.render()}),this})}createTypeEditor(e){!function(e,t){if(e){const n=document.querySelector("#widget-properties #widget-type"),o=null==n?void 0:n.querySelectorAll("input");null==o||o.forEach(e=>{null==e||e.remove()});const i=e.target.closest(".added-widget-container"),r=e.target.closest("div");let s="";i?s=null==i?void 0:i.getAttribute("data-type-value"):r&&(s=null==r?void 0:r.getAttribute("data-type-value"));const c=document.createElement("input");c.setAttribute("type","text"),c.setAttribute("name","input-widgetTypeValue"),c.setAttribute("of",t.elementIdentifier.toString()),c.setAttribute("class","form-control"),c.setAttribute("id","widgetType"),c.setAttribute("onchange","updateWidgetTypeValue(event)"),t.widgetType?c.value=t.widgetType:c.setAttribute("placeholder","e.g. the_entity");let a=t;c.addEventListener("change",function(e){var t,n,o;const i=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value;a.widgetType=i,a.before_render(),a.loadChildWidgets(),null===(o=null===(n=a.element)||void 0===n?void 0:n.parentElement)||void 0===o||o.setAttribute("data-type-value",a.widgetType)}),null==n||n.appendChild(c)}}(e,this)}mount(e){return yo(this,void 0,void 0,function*(){if(e){this.element=document.createElement("div"),this.element.id=this.createWidgetWrapperIdentifier();let t=this;this.inDevelopment?(this.element.onclick=function(e){e.preventDefault(),t.createTypeEditor(e)},this.element.className="mftsccs-marking-element"):this.element.classList.add("mftsccs-marking-rendered"),this.element.innerHTML=this.getHtml(),null==e||e.setAttribute("data-type-value",t.widgetType),e.appendChild(this.element),this.parentElement=e.id,0==this.componentMounted||0==this.widgetMounted?(this.render_custom_functions(),this.render_widgetDependencies(),this.before_render(),this.mount_child(),this.widgetMounted=!0,this.componentMounted=!0):this.render(),this.childWidgetElement=this.getElementByClassName("added-widget-container")}})}render_widgetDependencies(){try{new Function("tsccs",`\n return (async function() {\n ${this.widgetDependenciesData}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}render_custom_functions(){var e;const t=null===(e=this.customFunctions)||void 0===e?void 0:e.map(e=>null==e?void 0:e.code).join("");try{new Function("tsccs",`\n return (async function() {\n ${t}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.error("This is the error in the render_custom_functions",e),e}}before_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.componentDidMountFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}after_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.addEventFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the after render",e),e}}CreateConnectionBetweenEntityLocal(e,t,n){return yo(this,void 0,void 0,function*(){var o;const i=e.userId,r=(null===(o=e.type)||void 0===o?void 0:o.characterValue)+"_"+n,s=yield(0,le.$)(r,999,999,i);return yield(0,Qt.F)(e.id,t.id,s.id,1e3),"connection created"})}}var mo=n(3077),Co=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class wo{constructor(){this.actions={concepts:[],connections:[]},this.success=!0,this.transactionId=Math.random().toString().substring(5)}initialize(){return Co(this,void 0,void 0,function*(){yield to.H.initializeTransaction(this.transactionId)})}commitTransaction(){return Co(this,void 0,void 0,function*(){if(!this.success)throw Error("Query Transaction Expired");yield to.H.SyncDataOnline(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1})}commitTransactionWithoutAuth(){return Co(this,void 0,void 0,function*(){if(!this.success)throw Error("Query Transaction Expired");yield to.H.SyncDataOnlineWithoutAuth(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1})}rollbackTransaction(){return Co(this,void 0,void 0,function*(){this.success=!1,this.actions={concepts:[],connections:[]},yield to.H.rollbackTransaction(this.transactionId,this.actions)})}markAction(){return Co(this,void 0,void 0,function*(){yield to.H.markTransactionActions(this.transactionId,this.actions)})}MakeTheInstanceConceptLocal(e,t){return Co(this,arguments,void 0,function*(e,t,n=!1,o,i,r=999,s=0){try{if(!this.success)throw Error("Query Transaction Expired");const c=yield(0,K.k)(e,t,n,o,i,r,s,this.actions);return yield this.markAction(),c}catch(e){throw console.log(e),this.success=!1,e}})}MakeTheTypeConceptLocal(e,t,n,o){return Co(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,le.$)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}})}CreateTheConceptLocal(e,t,n,o,i,r){return Co(this,arguments,void 0,function*(e,t,n,o,i,r,s=!1,c=0,a={concepts:[],connections:[]}){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,mo.A)(e,t,n,o,i,r,s,c,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}})}CreateConnectionBetweenTwoConceptsLocal(e,t,n){return Co(this,arguments,void 0,function*(e,t,n,o=!1){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,mn.h)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}})}CreateTheConnectionLocal(e,t,n){return Co(this,arguments,void 0,function*(e,t,n,o=1,i="",r=999){try{if(!this.success)throw Error("Query Transaction Expired");const s=yield(0,Qt.F)(e,t,n,o,i,r,this.actions);return yield this.markAction(),s}catch(e){throw console.log(e),this.success=!1,e}})}CreateConnection(e,t,n){return Co(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield(0,Qt.d)(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}})}CreateConnectionBetweenEntityLocal(e,t,n){return Co(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield Uo(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}})}CreateTheCompositionLocal(e){return Co(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,c=!1){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,G.R)(e,t,n,o,i,r,s,c,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}})}}const Io={number:/^\d+(\.\d+)?$/,text:/^[\s\S]*$/,textOnly:/^[A-Za-z\s]+$/,email:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,document:/\.(pdf|docx?|pptx?|xlsx?)$/i,sound:/\.(mp3|wav|ogg|flac)$/i,image:/\.(jpg|jpeg|png|gif|bmp|svg|webp)$/i,video:/\.(mp4|avi|mov|mkv|flv|webm)$/i,url:/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/,date:/^\d{4}-\d{2}-\d{2}$/,time:/^(?:[01]\d|2[0-3]):[0-5]\d$/,password:/^.{6,}$/,ipaddress:/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$|^([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})$/,uuid:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/};var To=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class ko{constructor(){ko.cacheInitialized||ko.initializeAnomalyParameters()}static initializeAnomalyParameters(){return To(this,void 0,void 0,function*(){try{yield ko.getAnomalyParameters(),ko.refreshCache(),ko.cacheInitialized=!0}catch(e){console.error("Error during anomaly parameter initialization:",e)}})}static getAnomalyParameters(){return To(this,void 0,void 0,function*(){const e=Date.now();if(ko.anomalyParamsCache&&e-ko.lastFetchedTime<ko.cacheExpiryThreshold)return console.log("Returning cached anomaly parameters"),ko.anomalyParamsCache;try{return yield ko.fetchAnomalyParameters()}catch(e){throw console.error("Error fetching anomaly parameters:",e),e}})}static fetchAnomalyParameters(){return To(this,void 0,void 0,function*(){try{const e=yield fetch("https://devai.freeschema.com/v1/get-frontend-anomaly-parameters",{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to fetch anomaly parameters");const t=yield e.json();return ko.anomalyParamsCache=t.data,ko.lastFetchedTime=Date.now(),t.data}catch(e){throw console.error("API Fetch Error:",e),e}})}static refreshCache(){return To(this,void 0,void 0,function*(){try{Date.now()-ko.lastFetchedTime>ko.cacheExpiryThreshold&&(yield ko.getAnomalyParameters())}catch(e){console.error("Error refreshing anomaly parameters cache:",e)}})}detectDataType(e){for(const[t,n]of Object.entries(Io))if(n.test(e))return t;return null}checkConceptAnomaly(e,t){return To(this,void 0,void 0,function*(){const n=[];try{if(!t)return n.push("Null value"),{valid:!1,warnings:n};const o=ko.anomalyParamsCache;e.startsWith("the_")||(e=`the_${e}`);const i=o[e];if(console.log("Concept Details : ",i),!i)return console.warn(`No concept details found for type: ${e}`),n.push(`No concept details found for type: ${e}`),{valid:!1,warnings:n};const r=t.length,{min_length:s,max_length:c,data_types:a}=i,l=r>=s&&r<=c,d=this.detectDataType(t),u=a.includes(d);return l||n.push(`Length of '${t}' is outside the allowed range (min: ${s}, max: ${c}). Current length: ${r}.`),u||n.push(`Type mismatch for '${t}'. Expected types: ${a.join(", ")}, detected type: ${d}.`),l&&u&&n.push(`Concept ${e} is valid. Length: ${r}, Type: ${d}`),{valid:l&&u,warnings:n}}catch(o){return console.error(`Error checking anomaly for ${e} with value ${t}:`,o),{valid:!1,warnings:n}}})}static checkAnomalyInBulk(e){return To(this,void 0,void 0,function*(){ko.cacheInitialized||(yield ko.initializeAnomalyParameters());try{const t={};for(const[n,o]of Object.entries(e)){const e=o.value,{valid:i,warnings:r}=yield(new ko).checkConceptAnomaly(n,e);t[n]={valid:i,warnings:r}}return t}catch(e){throw console.error("Bulk Anomaly Check Error:",e),e}})}static getExportedFunction(){console.log("Main : ",o);const e=Object.keys(o);return console.log("The exported List : ",e),e}static getFunctionaAnomalyParameters(){}}ko.anomalyParamsCache=null,ko.cacheInitialized=!1,ko.lastFetchedTime=0,ko.cacheExpiryThreshold=6e5;var Ao=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class So{checkUniqueness(e,t){return Ao(this,void 0,void 0,function*(){const n=ao.V.logfunction("checkUniqueness");e.startsWith("the_")||(e="the_"+e);let o=(yield pe(e,999)).id,i=yield(0,re.A)(t,o);return console.log("This is the concept for validator",i),!(i.id>0||(ao.V.logUpdate(n),0))})}validateField(e){return Ao(this,void 0,void 0,function*(){var t;const n=ao.V.logfunction("validateField");try{performance.now();const o={},{name:i,value:r,type:s,dataType:c,pattern:a,conceptType:l,maxLength:d,minLength:u,minValue:h,maxValue:p,accept:f,file:v,required:y,isUnique:g}=e;if(console.log("Validation is happening on : \n",e),!y||null!==r&&""!==r||(o.required=`The field ${i} is required.`),c&&r){let e=Io[c];e&&""!==r&&!e.test(r)&&(o.dataType=`Invalid value for ${c}`)}if(a&&r){const e="string"==typeof a?new RegExp(a):a;""===r||e.test(r)||(o.pattern="Pattern doesn't match with value")}if(r&&null!=d&&r.length>d&&(o.maxLength=`Length exceeds the maximum length of ${d}`),r&&null!=u&&r.length<u&&(o.minLength=`Length must be at least ${u} characters long`),null!=h&&r&&!isNaN(Number(r))&&Number(r)<h&&(o.minValue=`Value must be greater than or equal to ${h}`),null!=p&&r&&!isNaN(Number(r))&&Number(r)>p&&(o.maxValue=`Value must be less than or equal to ${p}`),v&&s&&f){const e=f.split(",").map(e=>e.trim().toLowerCase()),n=null===(t=v.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();n&&!e.includes(n)&&(o.accept=`File must be a valid file type: ${e.join(", ")}`)}return l&&g&&r&&((yield this.checkUniqueness(l,r))||(o.unique="Value is not unique")),ao.V.logUpdate(n),console.log("Before Validation Result : ",o),o}catch(e){throw(0,u.ey)(n,"Validator.validateField",e),e}})}validateForm(e){return Ao(this,void 0,void 0,function*(){const t=ao.V.logfunction("validateForm");try{performance.now();const n={};for(const t in e){const o=yield this.validateField(e[t]);Object.keys(o).length>0&&(n[t]=o)}return ao.V.logUpdate(t),n}catch(e){throw(0,u.ey)(t,"Validator.validateForm",e),e}})}validate(e){const t=ao.V.logfunction("validate");try{let n={};return this.validateField(e).then(e=>{Object.keys(e).length>0?(n.status=!1,n.details=e):n.status=!0}),console.error("Error on validate object"),ao.V.logUpdate(t),n}catch(e){(0,u.ey)(t,"Validator.validate",e)}}}const No=e=>{var t;const n=document.getElementsByName(e)[0];if(!n)return console.warn(`Element with NAME "${e}" not found.`),{name:null,value:null,type:null,dataType:null,pattern:null,conceptType:null,maxLength:null,minLength:null,minValue:null,maxValue:null,accept:null,file:null,required:!1,isUnique:!0};const o=n.hasAttribute("required")||"true"===n.getAttribute("data-required"),i=n.hasAttribute("isUnique")&&"true"===n.getAttribute("isUnique");return{name:n.name,value:n.value,type:n.type,dataType:n.getAttribute("data-type"),pattern:n.getAttribute("data-pattern"),conceptType:n.getAttribute("concept-type"),maxLength:n.getAttribute("maxlength")?parseInt(n.getAttribute("maxlength")):null,minLength:n.getAttribute("minlength")?parseInt(n.getAttribute("minlength")):null,minValue:n.getAttribute("min")?parseInt(n.getAttribute("min")):null,maxValue:n.getAttribute("max")?parseInt(n.getAttribute("max")):null,accept:n.getAttribute("accept")||null,file:"file"===n.type&&(null===(t=n.files)||void 0===t?void 0:t[0])||null,required:o,isUnique:i}};var _o=n(2289);class bo{constructor(){this.type="",this.inpage=10,this.page=1,this.concepts=[],this.conceptIds=[],this.selectors=[],this.freeschemaQueries=[],this.filters=[],this.filterLogic="",this.typeConnection="",this.order="DESC",this.outputFormat=Sn.yv,this.name="",this.filterAncestor="",this.reverse=!1,this.limit=!1,this.isSecure=!0,this.includeInFilter=!1,this.isOldConnectionType=!1}}var Lo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Eo{static getHash(e){return Lo(this,void 0,void 0,function*(){return yield function(e){return Lo(this,void 0,void 0,function*(){const t=JSON.stringify(e,(e,t)=>t&&"object"==typeof t&&!Array.isArray(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t),n=(new TextEncoder).encode(t),o=yield crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("")})}(e)})}static get(e){const t=localStorage.getItem(this.prefix+e);return t?JSON.parse(t):null}static set(e,t){const n=localStorage.getItem(this.prefix+e),o=JSON.stringify(t);n!==o&&(localStorage.setItem(this.prefix+e,o),window.dispatchEvent(new CustomEvent(this.prefix+e,{detail:t})))}static subscribe(e,t){const n=e=>{t(e.detail)};return window.addEventListener(this.prefix+e,n),()=>{window.removeEventListener(this.prefix+e,n)}}static remove(e){localStorage.removeItem(this.prefix+e)}static clearAll(){Object.keys(localStorage).filter(e=>e.startsWith(this.prefix)).forEach(e=>localStorage.removeItem(e))}}Eo.prefix="FREESCHEMA_CACHE_";var xo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Oo(e){var t=arguments;return xo(this,arguments,void 0,function*(e,n=""){const o=ao.V.logfunction("FreeschemaQueryApi",t);var i=(0,d.ab)("application/json",n);const r=l.B.FreeschemaQueryUrl(),s=JSON.stringify(e),c=yield Eo.getHash(e),a=Eo.get(c);if(a)return fetch(r,{method:"POST",headers:i,body:s}).then(e=>xo(this,void 0,void 0,function*(){if(e.ok){const t=yield e.json();Eo.set(c,t)}else(0,u.ry)(e)})).catch(e=>{(0,u.Mb)(e,r),(0,u.ey)(o,"FreeschemaQueryApi",e)}),console.log("This is the cached response",a),a;try{const e=yield fetch(r,{method:"POST",headers:i,body:s});if(e.ok){let t=yield e.json();return Eo.set(c,t),ao.V.logUpdate(o),t}return(0,u.ry)(e),[]}catch(e){(0,u.Mb)(e,r),(0,u.ey)(o,"FreeschemaQueryApi",e)}})}var Bo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Ro extends xn.w{constructor(e,t){super(),this.query=new bo,this.countInfoStrings=[],this.order="DESC",this.totalCount=0,this.unsubscribeCache=null,this.query=e,this.format=e.outputFormat,this.order=e.order,Eo.getHash(e).then(e=>{this.unsubscribeCache=Eo.subscribe(e,e=>Bo(this,void 0,void 0,function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()}))})}run(){return Bo(this,void 0,void 0,function*(){var e,t;try{this.query.outputFormat=Sn.BG,this.compositionIds=[];let n=yield Oo(this.query,"");return this.conceptIds=n.conceptIds,this.internalConnections=null!==(e=n.internalConnections)&&void 0!==e?e:[],this.linkers=null!==(t=n.linkers)&&void 0!==t?t:[],this.reverse=n.reverse,this.compositionIds=n.mainCompositionIds,this.totalCount=n.mainCount,this.countInfoStrings=n.countinfo,yield this.build()}catch(e){throw console.error("Error in SchemaQueryObservable.run():",e),e}})}bind(){return Bo(this,void 0,void 0,function*(){var e,t;try{if(this.compositionIds.length>0)for(let e=0;e<this.compositionIds.length;e++)this.removeListenToEvent(this.compositionIds[e]);if(this.isDataLoaded)for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);else{this.query.outputFormat=Sn.BG,this.compositionIds=[];let n=yield Oo(this.query,"");this.conceptIds=n.conceptIds,this.internalConnections=null!==(e=n.internalConnections)&&void 0!==e?e:[],this.linkers=null!==(t=n.linkers)&&void 0!==t?t:[],this.reverse=n.reverse,this.compositionIds=n.mainCompositionIds,this.totalCount=n.mainCount,this.countInfoStrings=n.countinfo}let n=yield this.build();if(!this.isDataLoaded){this.isDataLoaded=!0;for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);if(""!=this.query.type){let e=yield pe(this.query.type,999);e.id>0&&this.listenToEventType(e.id)}}for(let e=0;e<this.newIds.length;e++)this.listenToEvent(this.newIds[e]);return this.newIds=[],n}catch(e){throw console.error("Error in SchemaQueryObservable.bind():",e),e}})}build(){return Bo(this,void 0,void 0,function*(){try{ao.V.logfunction("build",["schemaquery",this.compositionIds]);let e=(0,Jn.w)(this.countInfoStrings);return this.format==Sn.y0?this.data=yield(0,Mn.e$)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==Sn.ZJ?this.data=yield(0,Mn.y6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==Sn.pU?this.data=yield(0,Mn.rq)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==Sn.XZ?(this.data={},this.data.linkers=this.linkers,this.data.conceptIds=this.conceptIds,this.data.compositionIds=this.compositionIds,this.data.reverse=this.reverse,this.data.countInfos=e,this.data.order=this.order):this.data=yield(0,Mn.b6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e),this.data}catch(e){throw console.error("Error in SchemaQueryObservable.build():",e),e}})}}function Do(e,t){return new Ro(e,t)}function Go(e,t){return new Ro(e,t).execute()}class Po{constructor(){this.id=0,this.name="",this.html="",this.css="",this.js="",this.library={css:[],js:[]},this.assistant={id:"",input:"",type:""},this.timestamp="",this.widgetId=0,this.type="",this.clean="",this.after_render="",this.before_render="",this.custom_functions=[],this.update="",this.origin=0,this.version=0,this.mount_child="",this.children=[],this.wrapper="0",this.widget=new go,this.dependency="",this.root=0}}var Fo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Uo(e,t,n){return Fo(this,arguments,void 0,function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,c,a;const l=ao.V.logfunction("CreateConnectionBetweenEntityLocal",[e.id,t.id,n]);if(Zi)try{const a=yield cr("CreateConnectionBetweenEntityLocal",{concept1Data:e,concept2Data:t,linker:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(c=null===(s=null==a?void 0:a.actions)||void 0===s?void 0:s.connections)||void 0===c?void 0:c.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.log("CreateConnectionBetweenEntityLocal error sw: ",e),hr(e)}const d=e.userId,u=(null===(a=e.type)||void 0===a?void 0:a.characterValue)+"_"+n,h=yield(0,le.$)(u,999,999,d,o);console.log(yield(0,Qt.F)(e.id,t.id,h.id,1e3,void 0,void 0,o)),ao.V.logUpdate(l)})}var Mo=n(3256);function Wo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var jo=n(490),Vo=n(276);function $o(e,t,n){const o=Be.b.sessionId||"unknown",i={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:o,description:t};ao.V.logApplication("USER_EVENT",e,i)}class Ho extends vo{constructor(e,t,n,o="",i=10){super(),this.inpage=10,this.selector=t,this.mainType=e,this.filterType=o,this.inpage=i,this.parentDomElement=n,this.mount(this.parentDomElement)}before_render(){this.render()}addFilter(e){if(""!=e){let t=new no;t.search=e,t.type=this.filterType,t.logicoperator="like",t.operateon="selector",t.name="selector_filter";let n="( selector_filter )";this.query.filters=[t],this.query.filterLogic=n}else this.query.filters=[],this.query.filterLogic="";console.log("this is the filters",this.query)}after_render(){let e=this.getElementById("selector"),t=this.getElementById("search-bar"),n=this;t.onchange=()=>{n.addFilter(t.value),n.mainDetails.update()};let o=new bo;o.type=this.mainType,o.inpage=this.inpage;let i=new bo;i.typeConnection=this.selector,i.name="selector",o.freeschemaQueries=[i],this.query=o,Do(this.query,"").subscribe((t,n)=>{let o={};this.mainDetails=n;for(let e=0;e<t.length;e++){let n=t[e],i=n.id,r=n[this.mainType];if(console.log("this is the selected data myItem",r,t[e],this.mainType,n),r){let e=r[this.selector];if(e){const t=Object.values(e)[0];o[i]=t}}}Wo(e);for(const[t,n]of Object.entries(o)){const o=document.createElement("option");o.value=t,o.textContent=n,e.appendChild(o)}console.log("this is the output from selector",t)})}getHtml(){const e=document.createElement("style");return e.textContent="\n.search-select-wrapper {\n width: 300px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-family: Arial, sans-serif;\n}\n\n#search-bar {\n padding: 8px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 6px;\n}\n\n#selector {\n padding: 6px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 6px;\n}\n",document.head.prepend(e),this.html='\n <div class="search-select-wrapper">\n <input type="text" placeholder="Select or type..." id=\'search-bar\'>\n <select id=\'selector\'>\n </div>',this.html}}var qo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class zo{static get baseUrl(){return l.B.ACCESS_CONTROL_BASE_URL}static getAsync(e){return qo(this,void 0,void 0,function*(){const t=yield fetch(`${this.baseUrl}${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error(`GET '${e}' failed with status ${t.status}`);const n=yield t.json();if(null==n)throw new Error(`The response for GET '${e}' returned null.`);return n})}static postAsync(e,t){return qo(this,void 0,void 0,function*(){const n=yield fetch(`${this.baseUrl}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`POST '${e}' failed with status ${n.status}`);const o=yield n.json();if(null==o)throw new Error(`The response for POST '${e}' returned null.`);return o})}static deleteAsync(e,t){return qo(this,void 0,void 0,function*(){const n={method:"DELETE",headers:{"Content-Type":"application/json"}};null!=t&&(n.body=JSON.stringify(t));const o=yield fetch(`${this.baseUrl}${e}`,n);if(!o.ok)throw new Error(`DELETE '${e}' failed with status ${o.status}`);const i=yield o.json();if(null==i)throw new Error(`The response for DELETE '${e}' returned null.`);return i})}assignAccessAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/assign",e)})}checkAccessAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/check",e)})}revokeAccessAsync(e){return qo(this,void 0,void 0,function*(){return zo.deleteAsync("/access/revoke",e)})}assignAccessBulkAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/assign/bulk",e)})}revokeAccessBulkAsync(e){return qo(this,void 0,void 0,function*(){return zo.deleteAsync("/access/revoke/bulk",e)})}checkAccessBulkAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/check/bulk",e)})}getAccessByIdAsync(e){return qo(this,void 0,void 0,function*(){return zo.getAsync(`/access/${e}`)})}setAccessInheritanceAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/inheritance",e)})}getAccessInheritanceStatusAsync(e){return qo(this,arguments,void 0,function*(e,t=999){return zo.getAsync(`/access/inheritance/status?accessId=${e}&connectionTypeId=${t}`)})}assignSuperAdminAccessAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/super-admin",e)})}revokeSuperAdminAccessAsync(e){return qo(this,void 0,void 0,function*(){return zo.deleteAsync("/access/super-admin",e)})}checkSuperAdminStatusAsync(e){return qo(this,void 0,void 0,function*(){return zo.getAsync(`/access/super-admin?accessId=${e}`)})}assignConceptAccessAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/concept/assign",e)})}assignConceptAccessBulkAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/concept/assign/bulk",e)})}revokeConceptAccessBulkAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/concept/revoke/bulk",e)})}setParentAccessInheritanceAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/inheritance/parent",e)})}removeParentAccessInheritanceAsync(e,t){return qo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent?accessId=${e}`;return null!=t&&(n+=`&parentAccessId=${t}`),zo.deleteAsync(n)})}hasParentAccessInheritanceAsync(e,t){return qo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/status?accessId=${e}`;return null!=t&&(n+=`&parentAccessId=${t}`),zo.getAsync(n)})}getParentAccessIdAsync(e){return qo(this,void 0,void 0,function*(){return zo.getAsync(`/access/inheritance/parent?accessId=${e}`)})}setParentAccessInheritanceByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/inheritance/parent/concept",e)})}setParentAccessInheritanceBulkByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/inheritance/parent/concept/bulk",e)})}removeParentAccessInheritanceByConceptAsync(e,t){return qo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/concept?childConceptId=${e}`;return null!=t&&(n+=`&parentConceptId=${t}`),zo.deleteAsync(n)})}removeParentAccessInheritanceBulkByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.deleteAsync("/access/inheritance/parent/concept/bulk",e)})}hasParentAccessInheritanceByConceptAsync(e,t){return qo(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/concept/status?childConceptId=${e}`;return null!=t&&(n+=`&parentConceptId=${t}`),zo.getAsync(n)})}getParentAccessIdByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.getAsync(`/access/inheritance/parent/concept?childConceptId=${e}`)})}assignSuperAdminByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/super-admin/concept",e)})}revokeSuperAdminByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.deleteAsync("/access/super-admin/concept",e)})}checkSuperAdminByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.getAsync(`/access/super-admin/concept?conceptId=${e}`)})}setAccessInheritanceByConceptAsync(e){return qo(this,void 0,void 0,function*(){return zo.postAsync("/access/inheritance/concept",e)})}getAccessInheritanceStatusByConceptAsync(e){return qo(this,arguments,void 0,function*(e,t=999){return zo.getAsync(`/access/inheritance/concept/status?conceptId=${e}&connectionTypeId=${t}`)})}}var Jo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class Qo{constructor(e){this.apiClient=e||new zo}checkAccess(e,t,n){return Jo(this,void 0,void 0,function*(){var o;if(!t||""===t.trim())throw new Error("Permission is required");return null!==(o=(yield this.checkAccessBulk([e],t.toLowerCase(),n)).get(e))&&void 0!==o&&o})}checkAccessBulk(e,t,n){return Jo(this,void 0,void 0,function*(){var o,i,r,s,c,a;if(!t||""===t.trim())throw new Error("Permission is required");t=t.toLowerCase();const l=new Map;if(!e||0===e.length)return l;if(null!=n&&n>0)try{if(yield this.isSuperAdmin(n)){for(const t of e)l.set(t,!0);return l}}catch(e){}const d=[],u=new Set,h=new Map;let p=null;if(null!=n&&n>0)try{p=yield(0,z.A)(n)}catch(e){}const f=yield(0,ot.r)(e),v=new Map;for(const e of f)v.set(e.id,e);const y=new Map;for(const t of e){const e=null!==(o=v.get(t))&&void 0!==o?o:yield(0,z.A)(t);if(!e||0===e.id){l.set(t,!1);continue}const n=null!==(i=e.accessId)&&void 0!==i?i:0,c=null!==(r=e.typeId)&&void 0!==r?r:0;if(p&&p.userId&&p.userId===e.userId){l.set(t,!0);continue}if(null===e.referentId||void 0===e.referentId||0===e.referentId){l.set(t,!0);continue}if(n<1e4){l.set(t,!0);continue}let a=0;if(c>0){let e=y.get(c);if(!e)try{e=yield(0,z.A)(c),y.set(c,e)}catch(e){}e&&(a=null!==(s=e.accessId)&&void 0!==s?s:0)}d.push({conceptId:t,accessId:n,typeAccessId:a}),n>0&&(u.add(n),h.set(n,t)),a>0&&u.add(a)}if(0===d.length)return l;const g=yield this.resolveBulkInheritanceGraph(u,0,h),m=[],C=new Set;for(const e of g.values())for(const t of e)C.has(t)||(C.add(t),m.push(t));const w=yield this.resolveSubjects(n),I=yield this.resolveBulkDecisions(m,t,w);for(const e of d){const t=null!==(c=g.get(e.accessId))&&void 0!==c?c:[e.accessId],n=e.typeAccessId>0?null!==(a=g.get(e.typeAccessId))&&void 0!==a?a:[e.typeAccessId]:[];l.set(e.conceptId,this.hasAnyGrant(t,n,w,I))}return l})}getConceptIdsWithPermission(e,t,n){return Jo(this,void 0,void 0,function*(){if(!e||""===e.trim())throw new Error("Permission is required");if(!t||0===t.length)return[];const o=yield this.checkAccessBulk(t,e.toLowerCase(),n);return t.filter(e=>!0===o.get(e))})}resolveBulkInheritanceGraph(e,t,n){return Jo(this,void 0,void 0,function*(){var o,i,r,s,c,a,l,d,u,h,p,f,v,y;const g=new Map,m=new Set;let C=new Set(e),w=0;for(;C.size>0;){if(w>=10){console.warn("[AccessControl] BFS depth limit (10) reached.");break}w++;const e=new Set;for(const e of C)m.add(e);const I=Array.from(C);for(const t of I)try{const n=null!==(o=yield(0,fe.l)(t))&&void 0!==o?o:[];for(const o of n){if("the_parent_access_inheritance"!==(null!==(c=null!==(r=null!==(i=o.connectionTypeName)&&void 0!==i?i:o.typeName)&&void 0!==r?r:null===(s=o.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"").toString().toLowerCase())continue;const n=null!==(l=null!==(a=o.toTheConceptId)&&void 0!==a?a:o.toConceptId)&&void 0!==l?l:0;n>0&&!m.has(n)&&(g.has(t)||g.set(t,[]),g.get(t).push(n),e.add(n))}}catch(e){}for(const t of I)try{const n=yield this.apiClient.getParentAccessIdAsync(t);if(!0===(null==n?void 0:n.status)&&void 0!==n.data&&null!==n.data){const o=Qo.parseIntData(n);null!==o&&o>0&&!m.has(o)&&(g.has(t)||g.set(t,[]),g.get(t).push(o),e.add(o))}}catch(e){}for(const o of I)try{const i=yield this.apiClient.getAccessInheritanceStatusAsync(o);if(!Qo.parseBoolData(i))continue;const r=n.get(o);if(!r||0===r)continue;const s=null!==(d=yield(0,fe.l)(r))&&void 0!==d?d:[];for(const i of s){if((null!==(h=null!==(u=i.ofTheConceptId)&&void 0!==u?u:i.ofConceptId)&&void 0!==h?h:0)!==r)continue;if(t>0&&(null!==(p=i.typeId)&&void 0!==p?p:0)!==t)continue;const s=null!==(v=null!==(f=i.toTheConceptId)&&void 0!==f?f:i.toConceptId)&&void 0!==v?v:0;if(s)try{const t=yield(0,z.A)(s),i=null!==(y=null==t?void 0:t.accessId)&&void 0!==y?y:0;i>0&&!m.has(i)&&(g.has(o)||g.set(o,[]),g.get(o).push(i),n.set(i,s),e.add(i))}catch(e){}}}catch(e){}for(const t of m)e.delete(t);C=e}const I=new Map;for(const t of e){const e=[t],n=new Set([t]),o=[t];for(;o.length>0&&e.length<100;){const t=o.shift(),i=g.get(t);if(i)for(const t of i)n.has(t)||(n.add(t),e.push(t),o.push(t))}I.set(t,e)}return I})}resolveBulkDecisions(e,t,n){return Jo(this,void 0,void 0,function*(){var o;const i=new Map;for(const r of n)try{const n={accessIds:e,permission:t,entityId:r},s=yield this.apiClient.checkAccessBulkAsync(n);if(!0===(null==s?void 0:s.status)&&s.data&&Array.isArray(s.data)){const t=new Map;for(const e of s.data)t.set(e.accessId,e.hasAccess);for(const n of e)i.set(`${n}:${null!=r?r:0}`,null!==(o=t.get(n))&&void 0!==o&&o)}else for(const t of e)i.set(`${t}:${null!=r?r:0}`,!1)}catch(t){for(const t of e)i.set(`${t}:${null!=r?r:0}`,!1)}return i})}resolveSubjects(e){return Jo(this,void 0,void 0,function*(){var t,n,o,i,r,s,c;const a=[null];if(null!=e&&e>0){a.push(e);try{const l=null!==(t=yield(0,fe.l)(e))&&void 0!==t?t:[];for(const e of l){if("the_entity_s_group"!==(null!==(r=null!==(o=null!==(n=e.connectionTypeName)&&void 0!==n?n:e.typeName)&&void 0!==o?o:null===(i=e.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"").toString().toLowerCase())continue;const t=null!==(c=null!==(s=e.toTheConceptId)&&void 0!==s?s:e.toConceptId)&&void 0!==c?c:0;t>0&&a.push(t)}}catch(e){}}return a})}hasAnyGrant(e,t,n,o){for(const t of e)for(const e of n)if(!0===o.get(`${t}:${null!=e?e:0}`))return!0;for(const e of t)for(const t of n)if(!0===o.get(`${e}:${null!=t?t:0}`))return!0;return!1}assignAccess(e){return Jo(this,void 0,void 0,function*(){if(!e||!e.conceptIds||0===e.conceptIds.length)throw new Error("Request must contain at least one conceptId");try{const t=yield this.apiClient.assignConceptAccessBulkAsync(e);if(!0!==(null==t?void 0:t.status))throw new Error((null==t?void 0:t.message)||"Failed to assign bulk access");return(null==t?void 0:t.data)&&Array.isArray(t.data)?t.data:[]}catch(e){throw console.error("Failed to assign bulk access:",e),e}})}revokeAccess(e,t,n){return Jo(this,void 0,void 0,function*(){var o;try{const i=null!==(o=(yield(0,z.A)(e)).accessId)&&void 0!==o?o:0;if(0===i)throw new Error(`Concept with ID ${e} does not have a valid accessId`);const r=yield this.apiClient.revokeAccessAsync({accessId:i,permission:t,entityId:n});return!0===(null==r?void 0:r.status)}catch(o){throw new Error(`Error revoking access for concept ${e}, permission '${t}', entityId ${n}: ${o}`)}})}revokeAccessBulk(e){return Jo(this,void 0,void 0,function*(){if(!e||!e.conceptIds||0===e.conceptIds.length)throw new Error("Request must contain at least one conceptId");try{const t=yield this.apiClient.revokeConceptAccessBulkAsync(e);if(!0!==(null==t?void 0:t.status))throw new Error((null==t?void 0:t.message)||"Failed to revoke bulk concept access");return(null==t?void 0:t.data)&&Array.isArray(t.data)?t.data:[]}catch(e){throw console.error("Failed to revoke bulk concept access:",e),e}})}setAccessInheritance(e){return Jo(this,void 0,void 0,function*(){var t;try{const n=yield this.apiClient.setAccessInheritanceByConceptAsync({conceptId:e,connectionTypeId:999});return null!==(t=null==n?void 0:n.status)&&void 0!==t&&t}catch(t){throw new Error(`Error setting access inheritance for conceptId ${e}: ${t}`)}})}getAccessInheritanceStatus(e){return Jo(this,arguments,void 0,function*(e,t=999){try{const n=yield this.apiClient.getAccessInheritanceStatusByConceptAsync(e,t);return Qo.parseBoolData(n)}catch(t){throw new Error(`Error getting access inheritance status for conceptId ${e}: ${t}`)}})}setAccessInheritanceStatus(e,t){return Jo(this,arguments,void 0,function*(e,t,n=999){var o;try{const i=yield this.apiClient.setAccessInheritanceByConceptAsync({conceptId:e,enable:t,connectionTypeId:n});return null!==(o=null==i?void 0:i.status)&&void 0!==o&&o}catch(t){throw new Error(`Error setting access inheritance status for conceptId ${e}: ${t}`)}})}setParentAccessInheritance(e,t){return Jo(this,void 0,void 0,function*(){try{const n=yield this.apiClient.setParentAccessInheritanceByConceptAsync({parentConceptId:t,childConceptId:e});if(!0===(null==n?void 0:n.status)){const e=Qo.parseIntData(n);if(null!==e&&e>0)return e}return 0}catch(t){throw new Error(`Error setting parent access inheritance for conceptId ${e}: ${t}`)}})}setParentAccessInheritanceBulk(e,t){return Jo(this,void 0,void 0,function*(){try{const n=yield this.apiClient.setParentAccessInheritanceBulkByConceptAsync({parentConceptId:t,childConceptIds:e});return!0===(null==n?void 0:n.status)&&Array.isArray(n.data)?n.data:[]}catch(e){throw new Error(`Error setting bulk parent access inheritance for parentConceptId ${t}: ${e}`)}})}removeParentAccessInheritance(e,t){return Jo(this,void 0,void 0,function*(){var n;try{const o=yield this.apiClient.removeParentAccessInheritanceByConceptAsync(e,t);return null!==(n=null==o?void 0:o.message)&&void 0!==n?n:"Parent access inheritance removal failed"}catch(t){throw new Error(`Error removing parent access inheritance for conceptId ${e}: ${t}`)}})}removeParentAccessInheritanceBulk(e,t){return Jo(this,void 0,void 0,function*(){try{const n=yield this.apiClient.removeParentAccessInheritanceBulkByConceptAsync({parentConceptId:null!=t?t:0,childConceptIds:e});return!0===(null==n?void 0:n.status)&&Array.isArray(n.data)?n.data:[]}catch(e){throw new Error(`Error removing bulk parent access inheritance: ${e}`)}})}hasParentAccessInheritance(e,t){return Jo(this,void 0,void 0,function*(){try{const n=yield this.apiClient.hasParentAccessInheritanceByConceptAsync(e,t);return Qo.parseBoolData(n)}catch(t){throw new Error(`Error checking parent access inheritance for conceptId ${e}: ${t}`)}})}getParentAccessId(e){return Jo(this,void 0,void 0,function*(){try{const t=yield this.apiClient.getParentAccessIdByConceptAsync(e);return Qo.parseIntData(t)}catch(t){throw new Error(`Error getting parent access ID for conceptId ${e}: ${t}`)}})}isSuperAdmin(e){return Jo(this,void 0,void 0,function*(){try{if(0===e)return!1;const t=yield this.apiClient.checkSuperAdminByConceptAsync(e);return Qo.parseBoolData(t)}catch(t){throw new Error(`Error checking super admin status for entityId ${e}: ${t}`)}})}assignSuperAdmin(e){return Jo(this,void 0,void 0,function*(){try{const t=yield this.apiClient.assignSuperAdminByConceptAsync({conceptId:e});return!0===(null==t?void 0:t.status)&&void 0!==t.data?e:0}catch(t){throw new Error(`Failed to assign super admin for entityId ${e}: ${t}`)}})}revokeSuperAdmin(e){return Jo(this,void 0,void 0,function*(){try{const t=yield this.apiClient.revokeSuperAdminByConceptAsync({conceptId:e});return!0===(null==t?void 0:t.status)&&t.message?t.message:"Super admin access deletion failed"}catch(t){throw new Error(`Failed to revoke super admin for entityId ${e}: ${t}`)}})}makeConceptPrivate(e){return Jo(this,void 0,void 0,function*(){var t,n,o,i,r,s,c,l;try{if(!e)throw new Error("conceptId is required");const d=yield(0,z.A)(e);if(!d||0===d.id)throw new Error(`Concept with ID ${e} not found`);const u="function"==typeof globalThis.getUserDetails?globalThis.getUserDetails():null;let h=Number(null!==(i=null!==(o=null!==(n=null!==(t=null==u?void 0:u.entity)&&void 0!==t?t:null==u?void 0:u.entityId)&&void 0!==n?n:null==u?void 0:u.userConcept)&&void 0!==o?o:null==u?void 0:u.userId)&&void 0!==i?i:0)||0;if(!h)throw new Error("Logged-in entity id not found");if(d.userId!==h)throw new Error("Only the owner may make the concept private");const p=["read","write","execute","delete"];let f=null!==(r=d.accessId)&&void 0!==r?r:0;const v={conceptIds:[e],permissions:p,entityId:h},y=yield this.apiClient.assignConceptAccessBulkAsync(v);if(!y||!0!==y.status)throw new Error(`Failed to assign permissions for entity ${h} via bulk API`);if(Array.isArray(y.data))for(const e of y.data){const t=null!==(c=null!==(s=e.accessId)&&void 0!==s?s:e.data)&&void 0!==c?c:0;"number"==typeof t&&t>f&&(f=t)}else"number"==typeof y.data&&y.data>f&&(f=y.data);return f&&f!==(null!==(l=d.accessId)&&void 0!==l?l:0)&&(d.accessId=f,a.I.AddConcept(d)),!0}catch(t){throw new Error(`Error making concept ${e} private: ${t}`)}})}static parseBoolData(e){if(!(null==e?void 0:e.status)||void 0===e.data||null===e.data)return!1;const t=e.data;if("boolean"==typeof t)return t;if("string"==typeof t)return"true"===t.toLowerCase();if("number"==typeof t)return 0!==t;if("object"==typeof t)for(const e of["enabled","Enabled","isEnabled","IsEnabled","status","Status","hasAccess","HasAccess"])if(e in t){const n=t[e];if("boolean"==typeof n)return n;if("string"==typeof n)return"true"===n.toLowerCase()}return!1}static parseIntData(e){if(!(null==e?void 0:e.status)||void 0===e.data||null===e.data)return null;const t=e.data;if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,10);return isNaN(e)?null:e}if("object"==typeof t)for(const e of["id","Id","accessId","AccessId","parentAccessId","ParentAccessId"])if(e in t){const n=t[e];if("number"==typeof n)return n;if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return e}}return null}static isSuperAdmin(e){return Jo(this,void 0,void 0,function*(){return Xo().isSuperAdmin(e)})}static assignSuperAdmin(e){return Jo(this,void 0,void 0,function*(){return Xo().assignSuperAdmin(e)})}static revokeSuperAdmin(e){return Jo(this,void 0,void 0,function*(){return Xo().revokeSuperAdmin(e)})}static checkAccess(e,t,n){return Jo(this,void 0,void 0,function*(){return Xo().checkAccess(e,t,n)})}static checkAccessBulk(e,t,n){return Jo(this,void 0,void 0,function*(){return Xo().checkAccessBulk(e,t,n)})}static assignAccess(e){return Jo(this,void 0,void 0,function*(){return Xo().assignAccess(e)})}static revokeAccess(e,t,n){return Jo(this,void 0,void 0,function*(){return Xo().revokeAccess(e,t,n)})}static revokeAccessBulk(e){return Jo(this,void 0,void 0,function*(){return Xo().revokeAccessBulk(e)})}static setParentAccessInheritance(e,t){return Jo(this,void 0,void 0,function*(){return Xo().setParentAccessInheritance(e,t)})}static setParentAccessInheritanceBulk(e,t){return Jo(this,void 0,void 0,function*(){return Xo().setParentAccessInheritanceBulk(e,t)})}static removeParentAccessInheritance(e,t){return Jo(this,void 0,void 0,function*(){return Xo().removeParentAccessInheritance(e,t)})}static removeParentAccessInheritanceBulk(e,t){return Jo(this,void 0,void 0,function*(){return Xo().removeParentAccessInheritanceBulk(e,t)})}static hasParentAccessInheritance(e,t){return Jo(this,void 0,void 0,function*(){return Xo().hasParentAccessInheritance(e,t)})}static getParentAccessId(e){return Jo(this,void 0,void 0,function*(){return Xo().getParentAccessId(e)})}}let Yo=null;function Xo(){return Yo||(Yo=new Qo),Yo}const Zo='\n/* CKEditor content styles */\n.ck-content {\n /* Container styles */\n max-width: 100%;\n margin: 0 auto;\n font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;\n line-height: 1.5;\n padding: 0.75rem;\n background: #fff;\n color: #333;\n border: 1px solid #ccced1;\n}\n\n/* Headings */\n.ck-content h1, .ck-content h2, .ck-content h3, \n.ck-content h4, .ck-content h5, .ck-content h6 {\n font-weight: 700;\n line-height: 1.2;\n margin: 1em 0 0.5em;\n}\n\n.ck-content h1 { font-size: 2.5em; }\n.ck-content h2 { font-size: 2em; }\n.ck-content h3 { font-size: 1.75em; }\n.ck-content h4 { font-size: 1.5em; }\n.ck-content h5 { font-size: 1.25em; }\n.ck-content h6 { font-size: 1em; }\n\n/* Paragraphs and spacing */\n.ck-content p {\n margin: 1em 0;\n line-height: 1.6;\n}\n\n/* Links */\n.ck-content a {\n color: #1a73e8;\n text-decoration: none;\n}\n\n.ck-content a:hover {\n text-decoration: underline;\n}\n\n/* Lists */\n.ck-content ul,\n.ck-content ol {\n padding-left: 2em;\n margin: 1em 0;\n}\n\n.ck-content ul {\n list-style: disc;\n}\n\n.ck-content ol {\n list-style: decimal;\n}\n\n.ck-content li {\n margin: 0.5em 0;\n}\n\n/* Blockquotes */\n.ck-content blockquote {\n margin: 1em 0;\n padding-left: 1em;\n border-left: 5px solid #ccc;\n font-style: italic;\n color: #666;\n}\n\n/* Code blocks */\n.ck-content pre {\n background: #f5f5f5;\n border: 1px solid #ddd;\n border-radius: 4px;\n padding: 1em;\n margin: 1em 0;\n overflow-x: auto;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n}\n\n.ck-content code {\n background: #f5f5f5;\n padding: 0.2em 0.4em;\n border-radius: 3px;\n font-size: 0.9em;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n}\n\n/* Tables */\n.ck-content table {\n border-collapse: collapse;\n width: 100%;\n margin: 1em 0;\n}\n\n.ck-content table th,\n.ck-content table td {\n border: 1px solid #ddd;\n padding: 0.75em;\n text-align: left;\n}\n\n.ck-content table th {\n background: #f5f5f5;\n font-weight: bold;\n}\n\n/* Images */\n.ck-content img {\n max-width: 100%;\n height: auto;\n margin: 1em 0;\n}\n\n.ck-content figure {\n margin: 1em 0;\n text-align: center;\n}\n\n.ck-content figure img {\n margin: 0;\n}\n\n.ck-content figcaption {\n color: #666;\n font-size: 0.9em;\n margin-top: 0.5em;\n}\n\n/* Dark mode */\n/*\n@media (prefers-color-scheme: dark) {\n .ck-content {\n background: #1a1a1a;\n color: #e0e0e0;\n }\n\n .ck-content a {\n color: #64b5f6;\n }\n\n .ck-content blockquote {\n border-left-color: #404040;\n color: #b0b0b0;\n }\n\n .ck-content pre,\n .ck-content code {\n background: #2d2d2d;\n border-color: #404040;\n }\n\n .ck-content table th,\n .ck-content table td {\n border-color: #404040;\n }\n\n .ck-content table th {\n background: #2d2d2d;\n }\n\n .ck-content figcaption {\n color: #b0b0b0;\n }\n}\n*/\n\n/* CUSTOM DOCUMENTATION CSS */\n\n#documentation-preview {\n border: 1px solid #ccc;\n padding: 1rem;\n}\n\n#documentation-preview h3 {\n font-size: 1.5rem;\n margin-bottom: 1rem;\n}\n\n.pre-wrapper {\n background: #f2f5f9;\n border: 1px solid #cecece;\n display: block;\n padding: 1rem;\n border-radius: 0.25rem;\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pre-wrapper pre {\n margin: 0;\n color: #e87aa2;\n}\n\n.widget-doc-section pre {\n background-color: transparent;\n}\n\n.widget-doc-section p {\n margin: 0;\n}\n\n.widget-doc-section code {\n color: #e87aa2;\n font-size: 0.875rem;\n}\n\n.mv-3 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pv-3 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n\n .widget-documentation-heading {\n background-color: #6e757d;\n color: #eee;\n font-size: 1.5rem;\n padding: 0.5rem 1rem;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .widget-documentation-heading h4 {\n margin-bottom: 0;\n }\n\n .close-documentation-button {\n border: none;\n outline: none;\n background-color: transparent;\n line-height: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n .close-documentation-button:hover,\n .close-documentation-button:focus {\n background-color: transparent;\n }\n\n .documentation-creator {\n text-align: right;\n color: #666;\n margin: 0;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n }\n\n .documentation-creator span {\n font-style: italic;\n }\n\n .documentation-attachments {\n display: flex;\n flex-wrap: wrap;\n }\n\n .documentation-attachments img {\n width: 25%;\n height: auto;\n border: 1px solid #ccc;\n padding: 0.25rem;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .documentation-attachments iframe {\n width: 50%;\n border: 1px solid #ccc;\n padding: 0.25rem;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .widget-documentation-footer {\n text-align: right;\n margin-top: 1rem;\n }\n\n .widget-documentation-footer button {\n border-radius: 0;\n border: none;\n padding: 0.5rem 1.5rem;\n text-align: center;\n background: #6e757d;\n color: #eee;\n }\n\n #widget-details {\n position: absolute;\n right: 0px;\n top: 0px;\n z-index: 9999;\n }\n\n #widget-details button {\n background: #fff;\n border: 1px solid #ccc;\n border-radius: 0 0 0 0.25rem;\n height: auto;\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n }\n\n #widget-details button:hover, \n #widget-details button:focus {\n opacity: 0.75;\n }\n\n #widget-details button span {\n pointer-events: none;\n font-size: 1rem;\n }\n\n #widget-details button svg {\n pointer-events: none;\n width: 16px;\n height: 16px;\n fill: #999;\n }\n\n #widget-documentation-preview-modal {\n border: none;\n }\n\n @media (min-width: 768px) {\n #widget-documentation-preview-modal {\n flex: 0 0 auto;\n width: 66.66666667%;\n }\n }\n\n',Ko={PAGE_COMP_NAME:"page",WIDGET_COMP_NAME:"widget",PROJECT_COMP_NAME:"project"};var ei=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class ti{static get(e,t){return ei(this,void 0,void 0,function*(){if(ti.cache.has(e))return ti.cache.get(e);if(ti.promises.has(e))return ti.promises.get(e);const n=t().then(t=>(ti.cache.set(e,t),ti.promises.delete(e),t)).catch(t=>{throw ti.promises.delete(e),t});return ti.promises.set(e,n),n})}static has(e){return ti.cache.has(e)}static peek(e){return ti.cache.get(e)}static invalidate(e){ti.cache.delete(e),ti.promises.delete(e)}static clear(){ti.cache.clear(),ti.promises.clear()}static set(e,t){return ei(this,void 0,void 0,function*(){return ti.promises.delete(e),ti.cache.set(e,t),t})}static stats(){return{cacheSize:ti.cache.size,pendingRequests:ti.promises.size,keys:Array.from(ti.cache.keys())}}}ti.cache=new Map,ti.promises=new Map;var ni=n(2895);const oi=ni;ni.stringify,ni.fromJSON,ni.plugin,ni.parse,ni.list,ni.document,ni.comment,ni.atRule,ni.rule,ni.decl,ni.root,ni.CssSyntaxError,ni.Declaration,ni.Container,ni.Processor,ni.Document,ni.Comment,ni.Warning,ni.AtRule,ni.Result,ni.Input,ni.Rule,ni.Root,ni.Node;var ii=n(2110),ri=n.n(ii),si=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function ci(e){return si(this,void 0,void 0,function*(){try{return(yield oi([ri()()]).process(e,{from:void 0})).css}catch(e){return console.error("Error processing CSS:",e),null}})}var ai=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function li(e){const t=document.getElementById("fspage-properties");if(!t)return;let n=null==t?void 0:t.textContent;n=n?n.replace(new RegExp(e,"g"),""):"",t.textContent=n}function di(e,t){let n=document.querySelector(`meta[name="${e}"]`);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t)}var ui=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function hi(e){return ui(this,void 0,void 0,function*(){var t,n,o,i;(null===(n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.css)||void 0===n?void 0:n.length)&&function(e){var t;const n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.css,o=`vde-css-${(null==e?void 0:e.origin)?null==e?void 0:e.origin:null==e?void 0:e.widgetId}`;(function(e){const t=`link.${e}`,n=document.querySelectorAll(t);(null==n?void 0:n.length)&&(null==n||n.forEach(e=>{e.remove()}))})(o),(null==n?void 0:n.length)&&(null==n||n.sort((e,t)=>Number(null==e?void 0:e.order)-Number(null==t?void 0:t.order))),null==n||n.forEach(e=>{const t=document.createElement("link");t.classList.add(o),t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.url),document.head.appendChild(t)})}(e),(null===(i=null===(o=null==e?void 0:e.library)||void 0===o?void 0:o.js)||void 0===i?void 0:i.length)&&(yield function(e){return ui(this,void 0,void 0,function*(){var t;const n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.js,o=`vde-js-${(null==e?void 0:e.origin)?null==e?void 0:e.origin:null==e?void 0:e.widgetId}`;if(function(e){const t=`script.${e}`,n=document.querySelectorAll(t);(null==n?void 0:n.length)&&(null==n||n.forEach(e=>{e.remove()}))}(o),null==n?void 0:n.length){n.sort((e,t)=>Number(null==e?void 0:e.order)-Number(null==t?void 0:t.order));for(const e of n)(null==e?void 0:e.url)?document.querySelector(`script[src="${e.url}"]`)?console.log("Library already loaded:",e.url):yield new Promise((t,n)=>{const i=document.createElement("script");i.classList.add(o),i.setAttribute("type","text/javascript"),i.setAttribute("src",e.url),i.setAttribute("crossorigin","anonymous"),i.onload=()=>{t()},i.onerror=t=>{console.error("Failed to load script:",e.url,t),n(new Error(`Failed to load script: ${e.url}`))},document.head.appendChild(i)}):console.warn("Skipping library with invalid URL:",e);console.log("All JavaScript libraries loaded successfully")}})}(e))})}var pi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function fi(e,t,n,o){return pi(this,void 0,void 0,function*(){var i,r,s,c,a,l,d,u,h,p;const f=new bo;f.conceptIds=[e],f.inpage=100,f.outputFormat=Sn.y0,f.selectors=["the_page_body","the_page_title","the_page_slug","the_page_font_family","the_page_font_size","the_page_width","the_page_type","the_page_meta_title","the_page_meta_description","the_page_meta_keywords"];let v=yield Go(f,"");!function(e){ai(this,void 0,void 0,function*(){var t,n,o,i,r,s,c,a,l,d,u,h,p,f;[{key:"meta_title",value:null===(n=null===(t=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_meta_title`])||void 0===t?void 0:t.data)||void 0===n?void 0:n.the_meta_title},{key:"meta_description",value:null===(i=null===(o=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_meta_description`])||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_meta_description},{key:"meta_keywords",value:null===(s=null===(r=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_meta_keywords`])||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_meta_keywords},{key:"width",value:null===(a=null===(c=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_width`])||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_width},{key:"font_size",value:null===(d=null===(l=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_font_size`])||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_font_size},{key:"font_family",value:null===(h=null===(u=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_font_family`])||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_font_family},{key:"type",value:null===(f=null===(p=null==e?void 0:e[`the_${Ko.PAGE_COMP_NAME}_type`])||void 0===p?void 0:p.data)||void 0===f?void 0:f.the_type}].forEach(e=>{e.value&&function(e,t){ai(this,void 0,void 0,function*(){const n=document.getElementById("fspage-properties")||function(){const e=document.createElement("style");return e.id="fspage-properties",document.head.appendChild(e),e}();let o="";switch(e){case"width":li(".fspage { width: [^;]+ !important; }"),o=t?`.fspage { width: ${t} !important; }`:"";break;case"font_size":li(".fspage { font-size: [^;]+; }"),o=t?`.fspage { font-size: ${t}px; }`:"";break;case"font_family":li(".fspage { font-family: [^;]+; }"),o=t?`.fspage { font-family: ${t}; }`:"";break;case"type":li(".fspage { width: 1200px; margin: 0 auto; }"),li(".fspage { width: 100%; padding: 0; }"),o="fixed"===t?".fspage { width: 1200px; margin: 0 auto; }":"fluid"===t?".fspage { width: 100%; padding: 0; }":"";break;case"meta_title":document.title=t;break;case"meta_keywords":di(e.replace("meta_",""),t);break;case"meta_description":return void di(e.replace("meta_",""),t)}n.textContent+=o})}(e.key,e.value)})})}(null===(r=null===(i=null==v?void 0:v[0])||void 0===i?void 0:i.data)||void 0===r?void 0:r[`the_${Ko.PAGE_COMP_NAME}`]),document.getElementById("app").classList.add("fspage");const y=document.head.querySelectorAll("style#mystyleid");Array.from(y).forEach(e=>e.remove()),(null===(l=null===(a=null===(c=null===(s=null==v?void 0:v[0])||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_page)||void 0===a?void 0:a.the_page_body)||void 0===l?void 0:l.id)?yield mi(null===(p=null===(h=null===(u=null===(d=null==v?void 0:v[0])||void 0===d?void 0:d.data)||void 0===u?void 0:u.the_page)||void 0===h?void 0:h.the_page_body)||void 0===p?void 0:p.id,t,n,o):t.innerHTML="<h4>Invalid or Page doesn't exist</h4>"})}function vi(e,t,n,o){return pi(this,void 0,void 0,function*(){try{let t=yield(0,Mo.qj)(e),n=t.mainId,o=t.data;const i=yield Ti(o,n),r=yield Ai(n,[],i);return ti.cache.set(`wdgt_${n}`,r),console.log("DataCache after, widgetTree --\x3e",ti.cache,r),r}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function yi(e,t,n,o){return pi(this,void 0,void 0,function*(){try{let t=yield(0,Mo.ml)(e),n=t.mainId,o=t.data;const i=yield Ti(o,n);return yield Ai(n,[],i)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function gi(e,t,n,o){return pi(this,void 0,void 0,function*(){let i=(yield(0,Mo.qj)(e)).mainId;console.log("renderImportedWidget latestWidgetId, DataCache.cache --\x3e",i,ti.cache);const r=ti.cache.get(`wdgt_${i}`);if(console.log("renderImportedWidget widgetTree --\x3e",r),!r.name)return void(t.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=t;yield hi(r);const c=yield Si(r,s,void 0,n),a=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");t.classList.add(`${a}`),t.style.position="relative";const l=document.createElement("style");l.id="mystyleid",l.classList.add("mftsccs-css");const d=`\n .${a} {\n ${r.css+c.css+Zo} \n }\n `,u=(yield ci(d))||"";if(l.innerHTML=u,document.head.appendChild(l),r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&hi(e)})),o){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;xi(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{Oi("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),c})}function mi(e,t,n,o){return pi(this,void 0,void 0,function*(){try{let i=yield(0,Mo.qj)(e),r=i.mainId,s=i.data;const c=yield Ti(s,r);return yield wi(r,c,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`),t.textContent=`Error: ${e.message}`}})}function Ci(e,t,n,o){return pi(this,void 0,void 0,function*(){try{const i=yield(0,Mo.Cp)(e);return yield wi(e,i,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function wi(e,t,n,o){return pi(this,arguments,void 0,function*(e,t,n,o,i=!0){const r=yield Ai(e,[],t);if(!r.name)return void(n.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=n;yield hi(r);const c=yield Si(r,s,void 0,o),a=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");n.classList.add(`${a}`),n.style.position="relative";const l=document.createElement("style");l.id="mystyleid",l.classList.add("mftsccs-css");const d=`\n .${a} {\n ${r.css+c.css+Zo} \n }\n `,u=(yield ci(d))||"";l.innerHTML=u,r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&hi(e)})),document.head.appendChild(l);const h=document.createElement("script");if(h.innerHTML=r.js,s.appendChild(h),i){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n \x3c!-- <div id="documentation-preview" class="ck-content"></div> --\x3e\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;xi(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{Oi("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),c})}function Ii(e,t){return pi(this,void 0,void 0,function*(){var n,o,i,r,s,c,a,l,d,u,h;const p=null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.the_widget)||void 0===o?void 0:o.the_widget_s_child;if(t.push(e),p&&p.length)for(let e=0;e<p.length;e++){const n=p[e];let o=null===(a=null===(c=null===(s=null===(r=null===(i=null==n?void 0:n.data.the_child_widget)||void 0===i?void 0:i.the_child_widget_info)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_widget)||void 0===c?void 0:c.the_widget_root)||void 0===a?void 0:a.id;const f=!!(null===(u=null===(d=null===(l=null==n?void 0:n.data)||void 0===l?void 0:l.the_child_widget)||void 0===d?void 0:d.the_child_widget_use_latest)||void 0===u?void 0:u.data);o=Number(o)||!1;let v=null;if(f&&o){const e=yield(0,Mo.qj)(o);v=(null===(h=null==e?void 0:e.data)||void 0===h?void 0:h[0])||[],v.useLatest=!0,n.data.the_child_widget.the_child_widget_info=v}n.data.the_child_widget.the_child_widget_info.sChildId=n.id,yield Ii(n.data.the_child_widget.the_child_widget_info,t)}})}function Ti(e,t){return pi(this,void 0,void 0,function*(){const n=[],o=[...e];try{const e=o.find(e=>e.id===t);yield Ii(e,n)}catch(e){console.error("convert to real bulk error",e)}return n})}function ki(e){return pi(this,arguments,void 0,function*(e,t=[],n=""){let o=yield(0,Mo.Cp)(e);const i=yield Ti(o,e);return yield Ai(e,[],i)})}function Ai(e){return pi(this,arguments,void 0,function*(e,t=[],n,o=""){var i,r,s,c,a,l,d,u,h,p,f,v,y,g,m,C,w,I,T,k,A,S,N,_,b,L,E,x,O,B,R,D,G,P,F,U,M,W,j,V,$,H,q,z,J,Q,Y,X,Z,K,ee,te,ne,oe,ie,re,se;try{const ce=new Po,ae=(0,Mo.ix)(n,e);t.push(e);const le=null===(i=null==ae?void 0:ae.data)||void 0===i?void 0:i.the_widget;ce.name=null===(s=null===(r=null==le?void 0:le.the_widget_name)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_name,ce.html=null===(a=null===(c=null==le?void 0:le.the_widget_html)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_html,ce.css=null===(d=null===(l=null==le?void 0:le.the_widget_css)||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_css,ce.js=null===(h=null===(u=null==le?void 0:le.the_widget_js)||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_js,ce.root=Number(null!==(f=null===(p=null==le?void 0:le.the_widget_root)||void 0===p?void 0:p.id)&&void 0!==f?f:0),ce.origin=ce.root,ce.version=null===(y=null===(v=null==le?void 0:le.the_widget_version)||void 0===v?void 0:v.data)||void 0===y?void 0:y.the_version,ce.clean=null===(m=null===(g=null==le?void 0:le.the_widget_clean)||void 0===g?void 0:g.data)||void 0===m?void 0:m.the_clean,ce.timestamp=null===(w=null===(C=null==le?void 0:le.the_widget_timestamp)||void 0===C?void 0:C.data)||void 0===w?void 0:w.the_timestamp,ce.id=null==ae?void 0:ae.id;const de=null===(T=null===(I=null==le?void 0:le.the_widget_type)||void 0===I?void 0:I.data)||void 0===T?void 0:T.the_type;ce.type="null"==de||null==de?"the_element_name":de,ce.after_render=null===(A=null===(k=null==le?void 0:le.the_widget_after_render)||void 0===k?void 0:k.data)||void 0===A?void 0:A.the_after_render,ce.before_render=null===(N=null===(S=null==le?void 0:le.the_widget_before_render)||void 0===S?void 0:S.data)||void 0===N?void 0:N.the_before_render,ce.dependency=null===(b=null===(_=null==le?void 0:le.the_widget_dependency)||void 0===_?void 0:_.data)||void 0===b?void 0:b.the_dependency,ce.update=null===(E=null===(L=null==le?void 0:le.the_widget_update)||void 0===L?void 0:L.data)||void 0===E?void 0:E.the_update,ce.widgetId=e,ce.mount_child=null===(O=null===(x=null==le?void 0:le.the_widget_mount_child)||void 0===x?void 0:x.data)||void 0===O?void 0:O.the_mount_child;const ue=null==le?void 0:le.the_widget_s_child;(null==ae?void 0:ae.useLatest)&&(ce.useLatest=!0),(null==ae?void 0:ae.sChildId)&&(ce.sChildId=ae.sChildId);const he=null===(B=null==le?void 0:le.the_widget_s_css_library)||void 0===B?void 0:B.map(e=>{var t,n,o,i,r,s,c,a;return{order:null===(i=null===(o=null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_css_library)||void 0===n?void 0:n.the_css_library_order)||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_order,url:null===(a=null===(c=null===(s=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_css_library)||void 0===s?void 0:s.the_css_library_url)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_url}}),pe=null===(R=null==le?void 0:le.the_widget_s_js_library)||void 0===R?void 0:R.map(e=>{var t,n,o,i,r,s,c,a;return{order:null===(i=null===(o=null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_js_library)||void 0===n?void 0:n.the_js_library_order)||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_order,url:null===(a=null===(c=null===(s=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_js_library)||void 0===s?void 0:s.the_js_library_url)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_url}});ce.library={css:he||[],js:pe||[]};const fe=null===(G=null===(D=null==le?void 0:le.the_widget_assistant)||void 0===D?void 0:D.data)||void 0===G?void 0:G.the_assistant;ce.assistant={id:null===(F=null===(P=null==fe?void 0:fe.the_assistant_id)||void 0===P?void 0:P.data)||void 0===F?void 0:F.the_id,input:null===(M=null===(U=null==fe?void 0:fe.the_assistant_input)||void 0===U?void 0:U.data)||void 0===M?void 0:M.the_input,type:null===(j=null===(W=null==fe?void 0:fe.the_assistant_type)||void 0===W?void 0:W.data)||void 0===j?void 0:j.the_type};const ve=null===(V=null==le?void 0:le.the_widget_s_custom_function)||void 0===V?void 0:V.map(e=>{var t,n,o,i,r,s,c;const a=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_custom_function;return{id:null==e?void 0:e.id,name:null===(o=null===(n=null==a?void 0:a.the_custom_function_name)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_name,slug:null===(r=null===(i=null==a?void 0:a.the_custom_function_slug)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_slug,code:null===(c=null===(s=null==a?void 0:a.the_custom_function_code)||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_code}});if(ce.custom_functions=ve,null==ue?void 0:ue.length)for(let e=0;e<ue.length;e++){const i=(null===(q=null===(H=null===($=ue[e])||void 0===$?void 0:$.data.the_child_widget)||void 0===H?void 0:H.the_child_widget_info)||void 0===q?void 0:q.id)||(null===(Y=null===(Q=null===(J=null===(z=ue[e])||void 0===z?void 0:z.data.the_child_widget)||void 0===J?void 0:J.the_child_widget_parent)||void 0===Q?void 0:Q.data)||void 0===Y?void 0:Y.the_parent),r=yield Ai(i,t,n,o),s=null===(te=null===(ee=null===(K=null===(Z=null===(X=ue[e])||void 0===X?void 0:X.data)||void 0===Z?void 0:Z.the_child_widget)||void 0===K?void 0:K.the_child_widget_type)||void 0===ee?void 0:ee.data)||void 0===te?void 0:te.the_type,c=null===(se=null===(re=null===(ie=null===(oe=null===(ne=ue[e])||void 0===ne?void 0:ne.data)||void 0===oe?void 0:oe.the_child_widget)||void 0===ie?void 0:ie.the_child_widget_wrapper)||void 0===re?void 0:re.data)||void 0===se?void 0:se.the_wrapper;r.type="null"==s||null==s?"the_element_name":s,r.wrapper=c,ce.children.push(r)}return ce}catch(e){throw e instanceof Error&&console.error("error converting bulkwidget to widget tree",e.message),e}})}function Si(e,t){return pi(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,c;const a=new go;a.html=e.html,r&&(a.parentWidget=Ni(r)),a.widgetType=e.type,a.componentDidMountFunction=e.before_render,a.addEventFunction=e.after_render,a.mountChildWidgetsFunction=e.mount_child,a.widgetState=Object.assign({},i),a.customFunctions=e.custom_functions,a.widgetDependenciesData=e.dependency,o&&(a.data=o),t.innerHTML="";const l=t;if(l&&(yield a.mount(l),e.widget=a,e.children.length>0&&(null===(s=a.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){const n=e.children[t];for(let e=0;e<a.childWidgetElement.length;e++){const t=a.childWidgetElement[e];if(n.wrapper===t.id){const e=bi(n);n.html=`<div id="${n.wrapper}">${n.html}</div>`;const o=yield Si(e,t,!1,a.data,a.widgetState,a);a.childWidgets.push(o),a.css=a.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange(e=>{var t;const n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(a.childrenData[n]=e)})}}}return console.log("newWidget ->",a,e),yield Ei(t,".widget_container"),a})}function Ni(e){const t={};for(const[n,o]of Object.entries(e))"object"==typeof o&&null!==o&&Array.isArray(o)||(t[n]=o);return t}function _i(e,t){return pi(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,c;let a=new go;a.html=e.html,r&&(a.parentWidget=Ni(r)),a.widgetState=Object.assign({},o),a.widgetType=e.type,a.componentDidMountFunction=e.before_render,a.addEventFunction=e.after_render,a.mountChildWidgetsFunction=e.mount_child,a.customFunctions=e.custom_functions,a.widgetDependenciesData=e.dependency,a.inDevelopment=!1!==i,t.innerHTML="";let l=t;if(l&&(yield a.mount(l),e.widget=a,e.children.length>0&&(null===(s=a.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){let n=e.children[t];for(let e=0;e<a.childWidgetElement.length;e++){let t=a.childWidgetElement[e];if(n.wrapper===t.id){const e=bi(n),o=yield _i(e,t,!1,a.widgetState,i,a);a.childWidgets.push(o),a.css=a.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange(e=>{var t;console.log("This is the data change in child",e);let n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(a.childrenData[n]=e),console.log("new child data",a.childrenData)})}}}return console.log("newWidget ->",a,e),a})}function bi(e){return e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bwidget_container\b[^"']*["'][^>]*>/g,e=>e.replace(/\bwidget_container\b/g,"").trim()),e.html=e.html.replace(/<[^>]*\bdraggable=["'][^"']*\btrue\b[^"']*["'][^>]*>/g,e=>e.replace(/\btrue\b/g,"false").trim()),e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bhover-element\b[^"']*["'][^>]*>/g,e=>e.replace(/\bhover-element\b/g,"").trim()),e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bwb-block\b[^"']*["'][^>]*>/g,e=>e.replace(/\bwb-block\b/g,"").trim()),e.html=e.html.replace(/<[^>]*onclick="widgetSelected\(event\)"\s*,?\s*ondragover="_dragService\.dragOverWidgetElement\(event\)"\s*,?\s*ondrop="_dragService\.dropWidgetElement\(event\)"\s*,?\s*ondragstart="_dragService\.dragStartWidgetElement\(event\)"\s*,?\s*ondragend="_dragService\.dragEndWidgetElement\(event\)"[^>]*>/g,e=>e.replace(/onclick="widgetSelected\(event\)"/g,'onclick=""').replace(/ondragover="_dragService\.dragOverWidgetElement\(event\)"/g,'ondragover=""').replace(/ondrop="_dragService\.dropWidgetElement\(event\)"/g,'ondrop=""').replace(/ondragstart="_dragService\.dragStartWidgetElement\(event\)"/g,'ondragstart=""').replace(/ondragend="_dragService\.dragEndWidgetElement\(event\)"/g,'ondragend=""').trim()),e.html=e.html.replace(/<[^>]*\bondragstart=["'][^"']*\b_dragService\.onWidgetDragStart\(event\)\b[^"']*["'][^>]*>/g,e=>e.replace(/\b_dragService\.onWidgetDragStart\(event\)\b/g,"").trim()),e}function Li(e,t){return pi(this,void 0,void 0,function*(){return e&&1===e.nodeType&&e.querySelectorAll(t).forEach(e=>{for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.remove()}),e})}function Ei(e,t){return pi(this,void 0,void 0,function*(){const n=e.querySelectorAll(t);for(const e of n){const n=e.parentElement;if(n){for(;e.firstChild;){const o=yield Li(e.firstChild,t);n.insertBefore(o,e)}n.removeChild(e)}}})}function xi(e){return pi(this,void 0,void 0,function*(){const t=new bo;t.typeConnection="the_widget_documentation",t.name="documentationText",t.selectors=["the_documentation_text"];const n=new bo;n.typeConnection="the_widget_s_documentation",n.name="documentationBlank",n.selectors=["the_documentation_text","the_documentation_content","the_documentation_language","the_documentation_doc_title","the_documentation_folder","the_documentation_creator_email","the_documentation_created_by","the_documentation_content","the_documentation_type","the_documentation_s_doc_url","the_documentation_s_image_url","the_documentation_s_video_link","the_documentation_auth_type","the_documentation_bearer_token","the_documentation_method","the_documentation_method_url","the_documentation_username","the_documentation_password","the_documentation_s_json_list","the_documentation_api_script","the_documentation_api_body","the_documentation_code_editor","the_documentation_return"];const o=new bo;o.typeConnection="the_documentation_s_json_list",o.name="documentationJSON",o.selectors=["the_json_list_key","the_json_list_value"],n.freeschemaQueries=[o];const i=new bo;i.conceptIds=[e],i.freeschemaQueries=[t,n],i.inpage=100,i.outputFormat=Sn.y0,yield Do(i,"").subscribe(t=>pi(this,void 0,void 0,function*(){var n,o,i,r,s,c,a,d,u,h,p;let f;const v=(null===(d=null===(a=null===(c=null===(s=null===(r=null===(i=null===(o=null===(n=null==t?void 0:t[0])||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_widget)||void 0===i?void 0:i.the_widget_documentation)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_documentation)||void 0===c?void 0:c.the_documentation_text)||void 0===a?void 0:a.data)||void 0===d?void 0:d.the_text)||"";v&&(f=v);const y=null===(p=null===(h=null===(u=null==t?void 0:t[0])||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_widget)||void 0===p?void 0:p.the_widget_s_documentation;if(null==y?void 0:y.length){const e=null==y?void 0:y.map(e=>{var t,n,o,i,r,s,c,a,l,d,u,h,p,f,v,y,g,m,C,w,I,T,k,A,S,N,_,b,L,E,x;const O=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_documentation,B=null===(o=null===(n=null==O?void 0:O.the_documentation_type)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_type,R=null===(r=null===(i=null==O?void 0:O.the_documentation_content)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_content,D=null===(c=null===(s=null==O?void 0:O.the_documentation_creator_email)||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_creator_email,G=null===(l=null===(a=null==O?void 0:O.the_documentation_doc_title)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_doc_title,P=null===(u=null===(d=null==O?void 0:O.the_documentation_method)||void 0===d?void 0:d.data)||void 0===u?void 0:u.the_method,F=null===(p=null===(h=null==O?void 0:O.the_documentation_method_url)||void 0===h?void 0:h.data)||void 0===p?void 0:p.the_method_url,U=null===(v=null===(f=null==O?void 0:O.the_documentation_bearer_token)||void 0===f?void 0:f.data)||void 0===v?void 0:v.the_bearer_token,M=null===(g=null===(y=null==O?void 0:O.the_documentation_username)||void 0===y?void 0:y.data)||void 0===g?void 0:g.the_username,W=null===(C=null===(m=null==O?void 0:O.the_documentation_password)||void 0===m?void 0:m.data)||void 0===C?void 0:C.the_password,j=null===(I=null===(w=null==O?void 0:O.the_documentation_auth_type)||void 0===w?void 0:w.data)||void 0===I?void 0:I.the_auth_type,V=null==O?void 0:O.the_documentation_s_json_list,$=null===(k=null===(T=null==O?void 0:O.the_documentation_api_script)||void 0===T?void 0:T.data)||void 0===k?void 0:k.the_api_script,H=null===(S=null===(A=null==O?void 0:O.the_documentation_api_body)||void 0===A?void 0:A.data)||void 0===S?void 0:S.the_api_body,q=null===(_=null===(N=null==O?void 0:O.the_documentation_language)||void 0===N?void 0:N.data)||void 0===_?void 0:_.the_language,z=null===(L=null===(b=null==O?void 0:O.the_documentation_return)||void 0===b?void 0:b.data)||void 0===L?void 0:L.the_return,J=null===(x=null===(E=null==O?void 0:O.the_documentation_code_editor)||void 0===E?void 0:E.data)||void 0===x?void 0:x.the_code_editor,Q=null==O?void 0:O.the_documentation_s_doc_url,Y=null==O?void 0:O.the_documentation_s_image_url,X=null==O?void 0:O.the_documentation_s_video_link;let Z={type:B,content:R,creatorEmail:D,title:G};if("blank"===B)Z=Object.assign({},Z);else if("api"===B){const e=[];(null==V?void 0:V.length)&&(null==V||V.forEach(t=>{var n,o,i,r,s,c,a,l;e.push({key:null===(r=null===(i=null===(o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.the_json_list)||void 0===o?void 0:o.the_json_list_key)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_key,value:null===(l=null===(a=null===(c=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.the_json_list)||void 0===c?void 0:c.the_json_list_value)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_value})})),Z=Object.assign(Object.assign({},Z),{method:P,methodURL:F,authType:j,username:M,password:W,bearerToken:U,json:e,script:$,body:H})}else"function"===B&&(Z=Object.assign(Object.assign({},Z),{language:q,return:z,codeEditor:J}));const K=[],ee=[],te=[];return(null==Y?void 0:Y.length)&&(null==Y||Y.forEach(e=>{var t;K.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_image_url)})),(null==X?void 0:X.length)&&(null==X||X.forEach(e=>{var t;ee.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_video_link)})),(null==Q?void 0:Q.length)&&(null==Q||Q.forEach(e=>{var t;te.push(null===(t=e.data)||void 0===t?void 0:t.the_doc_url)})),Z=Object.assign(Object.assign({},Z),{imageList:K,linkList:te,videoList:ee}),Z});f=e}yield function(){return pi(this,void 0,void 0,function*(){document.getElementById("widget-documentation-preview-modal").showModal()})}(),function(e,t){pi(this,void 0,void 0,function*(){const n=document.getElementById("documentation-view");if(0!=l.B.DOCUMENTATION_WIDGET)return void(yield mi(l.B.DOCUMENTATION_WIDGET,n,{currentWidgetId:t}));const o=document.getElementById("documentation-preview");o.innerHTML="",e&&(null==e?void 0:e.length)&&"string"!=typeof e?null==e||e.forEach(e=>{var t,n,i,r;const s=document.createElement("h3");let c="";switch(null==e?void 0:e.type){case"api":c="API";break;case"function":c="Functions and Classes";break;case"imgAndLink":c="Images and Links";break;default:c=""}s.innerHTML=`\n ${null==e?void 0:e.title} ${c?"("+c+")":""}\n `,null==o||o.appendChild(s);const a=document.createElement("div");a.classList.add("widget-doc-content"),(null==e?void 0:e.content)&&(a.innerHTML=e.content,null==o||o.appendChild(a));const l=document.createElement("div");if(l.classList.add("widget-doc-section"),"api"===e.type){let n="";n="basicAuth"===e.authType?`\n <p>username: <code>${null==e?void 0:e.username}</code></p>\n <p>password: <code>${null==e?void 0:e.password}</code></p>\n `:"bearerToken"===e.authType?`\n <h6>Token: <code>${null==e?void 0:e.bearerToken}</code></h6>\n `:"None";const o=e.json.map(e=>`${null==e?void 0:e.key}: ${null==e?void 0:e.value}`).join(", "),i=document.createElement("pre");i.textContent=o,l.innerHTML=`\n <div class="pv-3">\n <h6>Method Type: <code>${null==e?void 0:e.method.toUpperCase()}</code></h6>\n <h6>Endpoint: <code>${null==e?void 0:e.methodURL}</code></h6>\n </div>\n <div class="pv-3">\n <h6>Auth Type: <code>${(null===(t=null==e?void 0:e.authType)||void 0===t?void 0:t.toUpperCase())||""}</code></h6>\n ${n}\n </div>\n <div class="pv-3">\n <h6>JSON</h6>\n <code class="pre-wrapper" id="json-list-pre"></code>\n </div>\n <div class="pv-3">\n <h6>Body</h6>\n ${e.body}\n </div>\n <div class="pv-3">\n <h6>Scripts</h6>\n ${e.script}\n </div>\n `;const r=l.querySelector("#json-list-pre");r&&(r.appendChild(i),r.removeAttribute("id"))}else if("function"===e.type){const t=document.createElement("pre");t.textContent=null==e?void 0:e.codeEditor;const n=document.createElement("pre");n.textContent=null==e?void 0:e.return,l.innerHTML=`\n <div class="mv-3">\n <h6>Parameter</h6>\n <p>Language: ${null==e?void 0:e.language}</p>\n <code class="pre-wrapper" id="editor-pre"></pre></code>\n <h6>Returns</h6>\n <code class="pre-wrapper" id="return-pre"></code>\n </div>\n `;const o=l.querySelector("#editor-pre");o&&(o.appendChild(t),o.removeAttribute("id"));const i=l.querySelector("#return-pre");i&&(i.appendChild(n),i.removeAttribute("id"))}const d=document.createElement("div");d.classList.add("mv-3");const u=null===(n=null==e?void 0:e.linkList)||void 0===n?void 0:n.map(e=>`\n <p>${e}</p>\n `).join(""),h=null===(i=null==e?void 0:e.imageList)||void 0===i?void 0:i.map(e=>`\n <img src="${e}">\n `).join(""),p=null===(r=null==e?void 0:e.videoList)||void 0===r?void 0:r.map(e=>`\n <iframe width="560" height="315" src="${e}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>\n `).join(""),f=(null==u?void 0:u.length)?`\n <div class="mv-3">\n <h6>Web links</h6>\n ${u}\n </div>\n `:"",v=(null==h?void 0:h.length)?`\n <h6>Attachments</h6>\n <div class="documentation-attachments">\n ${h}\n </div>\n `:"",y=(null==p?void 0:p.length)?`\n <h6>Videos</h6>\n <div class="documentation-attachments">\n ${p}\n </div>\n `:"";d.innerHTML=`\n <div class="mv-3">\n ${f}\n ${v}\n ${y}\n </div>\n <p class="documentation-creator">- added by: <span>${null==e?void 0:e.creatorEmail}</span></p>\n `,null==l||l.appendChild(d),null==o||o.appendChild(l)}):void 0!==e&&(o.innerHTML=e)})}(f,e)}))})}function Oi(e){return pi(this,void 0,void 0,function*(){const t=document.getElementById(e),n=null==t?void 0:t.querySelector("form");null==n||n.reset(),null==t||t.close()})}var Bi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ri(e){return Bi(this,arguments,void 0,function*(e,t=null,n="",o={concepts:[],connections:[]}){var i,r,s,c;if(Zi)try{const a=yield cr("CreateData",{json:e,ofConcept:t,typeConcept:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(c=null===(s=null==a?void 0:a.actions)||void 0===s?void 0:s.connections)||void 0===c?void 0:c.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.error("CreateTheComposition sw error: ",e),hr(e)}let a=999,l=999,d=(0,W.o)();for(const i in e){let r=Di(i);if("string"!=typeof e[i]&&"number"!=typeof e[i])if(null==t||0==t.id)d=yield(0,K.k)(r,"",!0,a,4,l,void 0,o),Array.isArray(e[i])&&(r=Gi(r)),yield Ri(e[i],d,r,o);else{Array.isArray(e[i])&&(r=Pi(r));let s=Pi(i),c=yield(0,K.k)(r,"",!0,a,4,l,void 0,o);d=c;let u=Ui(n,s),h=yield(0,le.$)(u,l,a,a,o);yield(0,Qt.F)(t.id,c.id,h.id,1e3,h.characterValue,a,o),Array.isArray(e[i])&&(r=Gi(r)),yield Ri(e[i],c,r,o)}else{let r=Ui(n,i),s=yield(0,le.$)(r,l,a,a,o),c=yield(0,K.k)(i,e[i].toString(),!1,a,4,l,void 0,o);console.log("this is the type concept in down",s,c),null!=t&&(yield(0,Qt.F)(t.id,c.id,s.id,1e3,r,a,o))}}return d})}function Di(e){return e.startsWith("the_")?e:"the_"+e}function Gi(e){return e.endsWith("_s")?e:e+"_s"}function Pi(e){return e.replace(/_s$/,"")}const Fi=e=>/^[+-]?\d+(\.\d+)?$/.test(e);function Ui(e,t){return Fi(t)?e+"_":e+"_"+function(e){return e.startsWith("the_")?e.slice(4):e}(t)}class Mi{constructor(){this.prototype="",this.required=[],this.optional=[],this.field="string",this.childPrototypes=[],this.isCompositional=!1,this.options=[],this.isQueryType=!1,this.querySelector=null,this.concepts=[],this.connections=[],this.addedConcepts=[],this.addedConnections=[]}}class Wi{static getValue(e){return e in this.environments?this.environments[e]:null}static setValue(e,t){return this.environments[e]=t,this}}function ji(e,t){if(Array.isArray(e)&&Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);return e}Wi.environments={};var Vi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function $i(e){return Vi(this,arguments,void 0,function*(e,t=null){let n=[],o=[],i=[],r=(0,W.o)();try{null==t&&(t=new wo,yield t.initialize());let s=[];if(e.isCompositional){if(r=yield function(e,t,n,o){return Vi(this,void 0,void 0,function*(){let i=(0,W.o)(),r=yield o.MakeTheInstanceConceptLocal("the_composition","",!0,999,999,999),s=yield o.MakeTheTypeConceptLocal("the_composition_type",999,999,999),c=yield o.MakeTheTypeConceptLocal(e,999,999,999),a=yield o.CreateTheConnectionLocal(r.id,c.id,s.id,1e3,"the_composition_type");return i=r,t.push(s),t.push(c),n.push(a),i})}(e.prototype,n,o,t),e.isQueryType){let o=yield function(e,t,n){return Vi(this,void 0,void 0,function*(){let o=[],i=[],r="the_composition_filter_type",s="the_composition_selector",c=yield n.MakeTheTypeConceptLocal(r,999,999,999),a=yield n.MakeTheTypeConceptLocal(s,999,999,999);if(null!=e){let l=yield n.MakeTheTypeConceptLocal(e.selector,999,999,999);o.push(l);let d=yield n.MakeTheTypeConceptLocal(e.filterType,999,999,999);o.push(l),o.push(d);let u=yield n.CreateTheConnectionLocal(t.id,l.id,a.id,1e3,s,999);i.push(u);let h=yield n.CreateTheConnectionLocal(t.id,d.id,c.id,1e3,r,999);i.push(h)}return{concepts:o,connections:i}})}(e.querySelector,r,t),s=o.concepts;ji(i,o.connections),ji(n,s)}if(e.options.length>0){let o=yield function(e,t,n){return Vi(this,void 0,void 0,function*(){let o=[],i=[],r="the_composition_s_option",s=yield n.MakeTheTypeConceptLocal(r,999,999,999);for(let c=0;c<e.length;c++){let a=e[c].type,l=e[c].value,d=yield n.MakeTheInstanceConceptLocal(a,l,!1,999,999,999);o.push(d);let u=yield n.CreateTheConnectionLocal(t.id,d.id,s.id,1e3,r,999);i.push(u)}return{concepts:o,connections:i}})}(e.options,r,t),s=o.concepts;ji(i,o.connections),ji(n,s)}}else r=yield function(e,t){return Vi(this,void 0,void 0,function*(){let n=yield(0,z.A)(5124),o=yield t.MakeTheTypeConceptLocal(e,999,999,999),i=yield function(e,t,n,o){return Vi(this,void 0,void 0,function*(){let n=yield o.CreateTheConceptLocal("",t.characterValue,999,e.id,t.id,4,!1);return n.characterValue=t.characterValue,n.typeCharacter=t.characterValue,n.isComposition=!0,n.type=t,n})}(n,o,0,t);return i})}(e.prototype,t),i=yield qi(e.required,r,n,t,!0),s=yield qi(e.optional,r,n,t),n.push(r);let c=Hi(r,!0,!0),a=yield t.MakeTheTypeConceptLocal(c,999,999,999);if(n.push(a),e.childPrototypes.length>0)for(let o=0;o<e.childPrototypes.length;o++){let s=yield $i(e.childPrototypes[o]),l=s.mainConcept,d=s.connections,u=s.concepts,h=yield t.CreateTheConnectionLocal(r.id,l.id,a.id,1e3,c,999);i.push(h),ji(i,d),ji(n,u),n.push(l)}ji(i,s),ji(i,o),ji(n,e.addedConcepts),ji(i,e.addedConnections),e.concepts=n,e.connections=i,console.log("this is the connections",i)}catch(e){null==t||t.rollbackTransaction()}return{concepts:n,connections:i,mainConcept:r}})}function Hi(e,t=!0,n=!1){var o;let i="the_prototype_of_"+(null===(o=e.type)||void 0===o?void 0:o.characterValue);return i+=t?"_requires":"_optional",n&&(i+="_the_composition"),i}function qi(e,t,n,o){return Vi(this,arguments,void 0,function*(e,t,n,o,i=!1,r=!1){let s=[],c=[],a=Hi(t,i,r),l=yield o.MakeTheTypeConceptLocal(a,999,999,999);n.push(l);for(let t=0;t<e.length;t++){let n=yield o.MakeTheTypeConceptLocal(e[t],999,999,999);s.push(n)}for(let e=0;e<s.length;e++){let n=yield o.CreateTheConnectionLocal(t.id,s[e].id,l.id,1e3,a,999);c.push(n)}for(let e=0;e<s.length;e++)n.push(s[e]);return c})}var zi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Ji(e){return zi(this,void 0,void 0,function*(){let t;try{const n=yield fetch(l.B.GetCachedImage(e),{method:"GET"});return n.ok?t=n.body:(console.log("Error in Getting Image",n.status),(0,u.ry)(n)),t}catch(e){throw e instanceof Error?console.log("Error in Getting Local concept by character value error message: ",e):console.log("Error in Getting Local concept by character value unexpected error: ",e),t}})}var Qi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function Yi(e){return Qi(this,arguments,void 0,function*(e,t="normal"){let n,o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");e&&(o=e[0]+"_small."+e[1])}return o&&(n=yield Ji(o)),n})}function Xi(e,t="normal"){let n=e;try{if(e){let o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");e&&(o=e[0]+"_small."+e[1])}o&&(n=l.B.GetCachedImage(o))}}catch(t){console.log("This url has error",e)}return n}var Zi,Ki=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const er=Date.now().toString(36)+Math.random().toString(36).substring(2);let tr=[],nr=[],or=!1;function ir(e){or=e}function rr(e="",t){Be.b.BearerAccessToken=e,Zi&&cr("updateAccessToken",{accessToken:e,session:Be.b.sessionId})}function sr(){return Ki(this,arguments,void 0,function*(e="",t="",n="",o="",i=!0,s="",c=void 0,a={},d={},h=""){var p,f;try{l.B.BASE_URL=e,l.B.AI_URL=t,l.B.NODE_URL=o,l.B.BASE_APPLICATION=s,l.B.LOG_SERVER=null!==(p=d.logserver)&&void 0!==p?p:"https://logdev.freeschema.com",l.B.ACCESS_CONTROL_BASE_URL=h,console.log("setting the logserver",l.B.LOG_SERVER,d.logserver),n&&rr(n);let i=Math.floor(1e8*Math.random());l.B.setRandomizer(i),l.B.isPwa=null!==(f=d.isPwa)&&void 0!==f&&f;const v={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1};if(l.B.FLAGS=v,l.B.FLAGS=Object.assign(Object.assign({},v),a),function(e){const t=ao.V.logfunction("initializeFlags",arguments);try{return e.logApplication&&(lo.initialize(),ao.V.logApplicationActivationStatus=!0,console.warn("Application log started.")),e.logPackage&&(ao.V.logPackageActivationStatus=!0,console.warn("Package log started.")),e.accessTracker&&(Ee.J.activateStatus=!0,console.warn("Access Tracker Activated.")),e.isTest&&(r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0,r.B.isLocalDataLoaded=!0,r.B.isLocalTypeLoaded=!0,r.B.isLocalCharacterLoaded=!0,r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0,r.B.isLocalConnectionLoaded=!0),ao.V.logUpdate(t),e}catch(e){throw(0,u.ey)(t,"initializeFlags",e),e}}(l.B.FLAGS),!("serviceWorker"in navigator))return yield lr(),void console.warn("Service Worker not supported in this browser.");if(yield function(){return Ki(this,void 0,void 0,function*(){var e;let t=l.B.BASE_APPLICATION+"_cacheServers",n=l.B.BASE_APPLICATION+"_config",o=l.B.BASE_APPLICATION+"_session",i=sessionStorage.getItem(t),r=sessionStorage.getItem(n),s=null!==(e=sessionStorage.getItem(o))&&void 0!==e?e:"999",c=parseInt(s);void 0!==i&&"undefined"!==i||(l.B.NODE_CACHE_URL=l.B.BASE_URL),i=JSON.parse(i);const a=JSON.parse(r);i&&a&&a.documentationWidget&&999!=c?(Array.isArray(i)&&i.length?l.B.NODE_CACHE_URL=i[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,Be.b.setSession(c),l.B.DOCUMENTATION_WIDGET=a.documentationWidget):yield function(){return Ki(this,void 0,void 0,function*(){var e;let i;try{let r=null!==(e=l.B.BASE_APPLICATION)&&void 0!==e?e:"boomconsole";if(i=yield fetch(l.B.getAppConfig()+"?application="+r,{method:"POST"}),!i.ok)throw new Error("Failed to sync data to the server.");const s=yield i.json();s.success&&(sessionStorage.setItem(t,JSON.stringify(s.servers)),sessionStorage.setItem(n,JSON.stringify(s.config)),sessionStorage.setItem(o,s.session),Be.b.setSession(s.session),s.servers?l.B.NODE_CACHE_URL=s.servers[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,s.config&&(l.B.DOCUMENTATION_WIDGET=s.config.documentationWidget))}catch(e){console.error("error getting app config from server",e.message)}})}(),console.log("before the payload in app",Be.b.sessionId),navigator.serviceWorker&&navigator.serviceWorker.controller&&cr("SESSION_DATA",{type:"SESSION_DATA",data:l.B.NODE_CACHE_URL,session:Be.b.sessionId})})}(),function(){navigator.serviceWorker.addEventListener("message",e=>Ki(this,void 0,void 0,function*(){var t,n,o,i;try{if(e.data&&"API_401"===e.data.type){const{requestDetails:o}=e.data,i={method:o.method,headers:new Headers(o.headers),body:o.body},r=yield fetch(o.url,i),s=yield null==r?void 0:r.json();null===(n=null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||void 0===n||n.postMessage({type:"API_RESPONSE",messageId:e.data.messageId,response:new Response(s,{status:r.status,statusText:r.statusText,headers:r.headers})})}}catch(t){console.error("Error during listenPostMessage",t),null===(i=null===(o=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===o?void 0:o.controller)||void 0===i||i.postMessage({type:"API_RESPONSE",messageId:e.data.messageId})}}))}(),function(){co.x.addEventListener("message",e=>Ki(this,void 0,void 0,function*(){const{type:t,payload:n}=e.data;if(!t)return;let o={success:!1,data:void 0};ar[t]?yield ar[t](n):console.warn(`Unable to handle "${t}" case in BC service worker`)}))}(),c&&c.activate&&c.manual)yield new Promise((e,t)=>{navigator.serviceWorker.ready.then(t=>Ki(this,void 0,void 0,function*(){console.log("registraions ready",t),Zi=t.active,yield pr(),e("done")})).catch(e=>{console.error("Error: Ready service worker",e),t(e)}).finally(()=>console.log("Finally service worker ready done")),setTimeout(()=>t("Timeout ready"),3e4)});else if(c&&(null==c?void 0:c.activate))try{console.log("service worker initialiing"),yield function(e){var t=arguments;return Ki(this,void 0,void 0,function*(){const n=ao.V.logfunction("handleRegisterServiceWorker",t);yield new Promise((t,o)=>{var i,r;let s=!1;navigator.serviceWorker.register(null!==(i=e.pathToSW)&&void 0!==i?i:"./serviceWorker.bundle.js",{scope:null!==(r=e.scope)&&void 0!==r?r:"/"}).then(e=>Ki(this,void 0,void 0,function*(){console.log("Service Worker registered:",e),setInterval(()=>{nr.length&&ur()},2e3),console.log("update listen start"),e.onupdatefound=()=>{const n=e.installing;console.log("new worker",n),n&&(n.onstatechange=()=>Ki(this,void 0,void 0,function*(){console.warn("on state change triggered",n.state,navigator.serviceWorker.controller),"installing"===n.state&&(console.log("Service Worker installing"),Zi=void 0),"activated"!==n.state&&"redundant"!==n.state||!navigator.serviceWorker.controller||(Zi=n,console.log("New Service Worker is active",e),setTimeout(()=>{console.log("Message Processed after some time"),ur()},5e3),yield pr(),s=!0,ur(),t())}))},e.addEventListener("controllerchange",()=>Ki(this,void 0,void 0,function*(){console.warn("controller change triggered",navigator.serviceWorker.controller),navigator.serviceWorker.controller&&(Zi=navigator.serviceWorker.controller,console.warn("Service worker has been activated; controller change"),yield pr())})),(e.installing||e.waiting||e.active)&&e.addEventListener("statechange",e=>Ki(this,void 0,void 0,function*(){var t;"activating"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.state)&&(Zi=navigator.serviceWorker.controller,console.warn("Service Worker is activating statechange"),yield pr())})),e.active?(console.log("active sw"),Zi=e.active,yield pr(),ur(),t()):setTimeout(()=>{s||o("Not Completed Initialization")},1e4)})).catch(e=>Ki(this,void 0,void 0,function*(){yield lr(),o(e),console.error("Service Worker registration failed:",e),(0,u.ey)(n,"handleRegisterServiceWorker",e)}))})})}(c)}catch(e){yield lr(),console.error("Unable to start service worker",e)}else yield lr(),console.warn("Service Worker not activated");return!0}catch(e){yield lr(),console.warn("Cannot initialize the system",e)}})}function cr(e,t){return Ki(this,arguments,void 0,function*(e,t,n=0){let o=!1;const i=Math.random().toString(36).substring(2);t.messageId=i,t.TABID=er;const r=JSON.parse(JSON.stringify(t));let s;return"checkProcess"!=e&&0==n&&(s=setInterval(()=>Ki(this,void 0,void 0,function*(){if(!o&&!(yield function(e,t){return Ki(this,void 0,void 0,function*(){var n;try{const o=yield cr("checkProcess",{checkMessageId:e});if(console.log("check interval data res for type ",t,e,o.data),null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.processing)return!0}catch(n){return console.error("error on checing executing process",t,e,n),!1}})}(i,e))&&(clearInterval(s),!o)){if(console.log("Failed to handle type "+e+" message not found "+i,"retrying: ",0==n,e),0==n&&"checkProcess"!=e)return console.log("retrying ",e,i),yield cr(e,t,n+1);console.log("Failed to handle type "+e+" "+i)}}),2e3)),new Promise((n,c)=>{if(navigator.serviceWorker.controller||Zi||console.log("",navigator.serviceWorker.controller,Zi,e),navigator.serviceWorker.controller||Zi){const a=r=>{var l,d,h,p,f,v;(null===(l=null==r?void 0:r.data)||void 0===l?void 0:l.messageId)==i&&(o=!0,clearInterval(s),r.data.success||(401==(null===(d=null==r?void 0:r.data)||void 0===d?void 0:d.status)?c((0,u.ry)(new Response("Unauthorized",{status:401,statusText:null===(h=null==r?void 0:r.data)||void 0===h?void 0:h.statusText}))):500==(null===(p=null==r?void 0:r.data)||void 0===p?void 0:p.status)?c((0,u.Mb)(new Response("Internal Server Error",{status:500,statusText:null===(f=null==r?void 0:r.data)||void 0===f?void 0:f.statusText}))):(console.error("Error in the response from worker:",r),c(`Failed to handle action ${e} ${JSON.stringify(t)}, Response: ${JSON.stringify(r.data)}`))),(null===(v=r.data)||void 0===v?void 0:v.actions)&&(t.actions=JSON.parse(JSON.stringify(r.data.actions))),n(r.data),navigator.serviceWorker.removeEventListener("message",a))};if(navigator.serviceWorker.addEventListener("message",a),navigator.serviceWorker.controller)"checkProcess"!=e&&console.log("sent to sw",e,i),navigator.serviceWorker.controller.postMessage({type:e,payload:r});else if(Zi){console.warn(`controller not found but serviceWorker is available. messageId: ${i}, type: ${e}`);try{Zi.postMessage({type:e,payload:r})}catch(t){console.log("Retrying again on catch service worker",t),Zi.postMessage({type:e,payload:r})}}else console.warn(`Service Worker hasn't loaded yet. messageId: ${i}, type: ${e}`),console.info("ready",navigator.serviceWorker.ready),setTimeout(()=>{console.warn(`Re-Trying after certain time. messageId: ${i}, type: ${e}`),Zi?(console.info("This is triggered "),null==Zi||Zi.postMessage({type:e,payload:t})):(console.log("not ready",e),clearInterval(s),c("Service worker not ready"))},3e4);setTimeout(()=>{clearInterval(s),c(`No response from service worker after timeout: ${e}`),navigator.serviceWorker.removeEventListener("message",a)},21e4)}else nr.push({message:{type:e,payload:r}}),"init"==e&&(clearInterval(s),n(null))})})}const ar={GetLinkListener:e=>Ki(void 0,void 0,void 0,function*(){const t=tr.find(t=>t.listenerId==e.listenerId);return null==t||t.callback(e.data),{success:!0}}),dispatchEvent:e=>Ki(void 0,void 0,void 0,function*(){if(Zi){let t=new CustomEvent(e.id||"",e.data);dispatchEvent(t)}return{success:!0}}),checkInit:e=>Ki(void 0,void 0,void 0,function*(){return console.log("service worker init 0"),navigator.serviceWorker.controller&&(console.log("service worker init 1"),Zi=navigator.serviceWorker.controller),yield pr(),{success:!0}})};function lr(){return Ki(this,void 0,void 0,function*(){yield(0,so.A)();const e=(new Date).getTime();yield(0,i.A)().then(()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare concept data is ",t)}).catch(e=>{throw e}),yield(0,ro.Ay)().then(()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare local concept ",t)}).catch(e=>{throw e}),yield(0,io.p)().then(()=>{r.B.isLocalConnectionLoaded=!0}).catch(e=>{throw e}),yield(0,ro.xd)().catch(e=>{throw console.log("This is the error in populating binary tree"),e}),yield(0,io.a)().then(()=>{r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0;let t=(new Date).getTime()-e;console.log("The time taken to prepare connections ",t)}).catch(e=>{throw e})})}function dr(e,t={}){if(Zi||"undefined"!=typeof window){let n=new CustomEvent(`${e}`,t);dispatchEvent(n)}else co.x.postMessage({type:"dispatchEvent",payload:{id:e,data:t}})}function ur(){return Ki(this,void 0,void 0,function*(){console.log("message queue",nr);const e=nr.find(e=>{var t;return"init"==(null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.type)});if(e){console.log("Processing Init Queue poped",null==e?void 0:e.type,e);const t=nr.indexOf(e);t>-1&&nr.splice(t,1),yield cr(null==e?void 0:e.type,null==e?void 0:e.payload)}for(console.log("message queue while",nr);nr.length>0;){const{message:e,resolve:t,reject:n}=nr.shift();console.log("Queue poped",e.type,e),yield cr(e.type,e.payload)}})}const hr=e=>{if(e instanceof V.z)throw console.error("FreeSchemaResponse Error",e),e;console.error("Service Worker Error",e)};function pr(){return Ki(this,void 0,void 0,function*(){yield cr("init",{url:l.B.BASE_URL,aiurl:l.B.AI_URL,accessToken:Be.b.BearerAccessToken,nodeUrl:l.B.NODE_URL,enableAi:!1,applicationName:l.B.BASE_APPLICATION,flags:l.B.FLAGS,accessControlUrl:l.B.ACCESS_CONTROL_BASE_URL})})}},9371:(e,t,n)=>{let o=n(3152);class i extends o{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},9577:(e,t,n)=>{let o=n(7793),i=n(1106),r=n(8339);function s(e,t){let n=new i(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=s,s.default=s,o.registerParse(s)},9581:(e,t,n)=>{n.d(t,{B:()=>o});class o{static setRandomizer(e){console.log("set randomizer",e),this.BASE_RANDOMIZER=e}static getRandomizer(){return this.BASE_RANDOMIZER}static GetConceptUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/getConcept":this.NODE_CACHE_URL+"/api/getConcept"}static GetConnectionUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get-connection-by-id":this.NODE_CACHE_URL+"/api/get-connection-by-id"}static GetConceptBulkUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get_concept_bulk":this.NODE_CACHE_URL+"/api/get_concept_bulk"}static GetConnectionBulkUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get_connection_bulk":this.NODE_CACHE_URL+"/api/get_connection_bulk"}static GetAllConceptsOfUserUrl(){return this.BASE_URL+"/api/get_all_concepts_of_user"}static GetAllConnectionsOfUserUrl(){return this.BASE_URL+"/api/get_all_connections_of_user"}static GetAllConnectionsOfCompositionUrl(){return this.BASE_URL+"/api/get_all_connections_of_composition"}static GetAllConnectionsOfCompositionBulkUrl(){return this.BASE_URL+"/api/get_all_connections_of_composition_bulk"}static GetConceptByCharacterValueUrl(){return this.BASE_URL+"/api/get_concept_by_character_value"}static GetConceptByCharacterAndTypeUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_type"}static GetConceptByCharacterAndCategoryUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_category"}static GetConceptByCharacterAndCategoryDirectUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_category_direct"}static GetCharacterByCharacterUrl(){return this.BASE_URL+"/api/get_character_by_character"}static GetAllConceptsByTypeUrl(){return this.BASE_URL+"/api/get_all_concepts_by_type"}static GetAllConnectionsOfConceptUrl(){return this.BASE_URL+"/api/get-link-connections"}static GetAllConnectionsToConceptUrl(){return this.BASE_URL+"/api/get-link-reverse-connections"}static GetAllAiData(){return this.BASE_URL+"/api/get-preloaded-concepts"}static getAppConfig(){return this.NODE_URL+"/api/v1/config"}static PostPrefetchConceptConnections(){return this.NODE_URL+"/api/v1/access-tracker/sync-access-tracker"}static GetSuggestedConcepts(){return this.NODE_URL+"/api/v1/access-tracker/list-concepts-file"}static GetSuggestedConnections(){return this.NODE_URL+"/api/v1/access-tracker/list-connections-file"}static PostLogger(){return this.LOG_SERVER+"/api/logger"}static LogHealth(){return this.LOG_SERVER+"/api/check"}static GetAllPrefetchConnectionsUrl(){return this.BASE_URL+"/api/get_all_connections_of_user?inpage=500"}static GetAllLinkerConnectionOfConceptUrl(){return this.BASE_URL+"/api/get-all-linkers-from-concept"}static GetAllLinkerConnectionToConceptUrl(){return this.BASE_URL+"/api/get-all-linkers-to-concept"}static DeleteConceptUrl(){return this.BASE_URL+"/api/delete_concept"}static DeleteUserUrl(){return this.BASE_URL+"/api/deleteuser"}static RecursiveSearchUrl(){return this.BASE_URL+"/api/recursivesearch-concept-connection"}static SearchLinkMultipleAllApiUrl(){return this.BASE_URL+"/api/Connection/search-link-multiple-all-ccs"}static MakeTheNameInBackendUrl(){return this.BASE_URL+"/api/make-name-from-frontend"}static SearchAllTypeWithLinker(e=!0){return e?this.BASE_URL+"/api/search-all-with-linker-ccs":this.BASE_URL+"/api-search-compositions-internal-clean-ccs"}static LoginUrl(){return this.BASE_URL+"/api/auth/login"}static SignupUrl(){return this.BASE_URL+"/api/auth/signup"}static GetCompositionConnectionBetweenTwoConceptsUrl(){return this.BASE_URL+"/api/get-composition-connection-between-two-concepts"}static SearchCompositionsUrl(){return this.BASE_URL+"/api/search-compositions"}static SearchLinkMultipleAll(){return this.BASE_URL+"/api/Connection/search-link-multiple-all"}static CreateSessionId(){return this.BASE_URL+"/api/create-session-id-remote"}static CreateSessionVisitUrl(){return this.BASE_URL+"/api/create-remote-session-visit"}static ViewInternalDataUrl(){return this.BASE_URL+"/api/view-api-internal-data-ccs-id-bulk"}static SearchInternalWithAuthenticatedCcsUrl(){return this.BASE_URL+"/api/search-composition-internal-authenticated-ccs"}static SearchInternalWithCcsUrl(){return this.BASE_URL+"/api-search-compositions-internal-clean-ccs"}static CreateGhostConceptApiUrl(e=!0){return e?o.NODE_URL+"/api/v1/local-concepts":o.NODE_URL+"/api/v1/local-concepts-without-auth"}static CreateGhostConnectionApiUrl(){return o.NODE_URL+"/api/v1/local-connections"}static GetRealConceptById(){return o.NODE_URL+"/api/v1/local-concepts-translate"}static GetReservedIdUrl(){return this.BASE_URL+"/api/get_reserved_ids"}static GetReservedConnectionIdUrl(){return this.BASE_URL+"/api/get_reserved_connection_ids"}static CreateTheTextDataUrl(){return this.BASE_URL+"/api/create_text_data"}static CreateTheCharacterDataUrl(){return this.BASE_URL+"/api/create_character_data"}static CreateTheConceptUrl(){return this.BASE_URL+"/api/create_the_concept"}static CreateTheConnectionUrl(){return this.BASE_URL+"/api/create_the_connection"}static CreateTheConnectionNewUrl(){return this.BASE_URL+"/api/create_the_connection_new"}static MakeTheTypeConceptUrl(){return this.BASE_URL+"/api/make_the_type_concept"}static DeleteTheConnectionUrl(){return this.BASE_URL+"/api/delete_connection"}static DeleteTheConnectionBulkUrl(){return this.BASE_URL+"/api/delete_connection_bulk"}static GetTypeConceptBulk(){return this.BASE_URL+"/api/get_type_concept_by_character_bulk"}static UploadFileLimitUrl(){return this.BASE_URL+"/api/upload/limit"}static FreeschemaQueryUrl(){return this.BASE_URL+"/api/freeschema-query"}static uploadImageUrl(){return this.BASE_URL+"/api/Image/UploadImage"}static uploadImageUrlWithSmall(){return this.BASE_URL+"/api/Image/UploadImageV2"}static uploadFileUrl(){return this.BASE_URL+"/api/Image/UploadFile"}static sendMail(){return this.BASE_URL+"/api/sendmail"}static sendBulkMail(){return this.BASE_URL+"/api/sendmail/bulk"}static getWidgetData(){return this.BASE_URL+"/api/get-widget"}static getLatestWidgetData(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get-latest-widget":this.NODE_CACHE_URL+"/api/get-latest-widget"}static getRecentWidgetData(){return this.BASE_URL+"/api/get-recent-widget"}static getConnectionsByTypes(){return this.BASE_URL+"/api/get-connection-by-types"}static CreatePrototypeUrl(){return this.BASE_URL+"/api/create-prototype"}static GetCachedImage(e){return"https://cdn.boomconcole.com/freeschema/"+e}}o.BASE_URL="https://localhost:7053/",o.NODE_CACHE_URL="",o.AI_URL="https://ai.freeschema.com",o.MQTT_URL="192.168.1.249",o.NODE_URL="http://localhost:5001",o.LOG_SERVER="https://logdev.freeschema.com",o.BASE_APPLICATION="",o.DOCUMENTATION_WIDGET=0,o.isNearestCache=!0,o.ACCESS_CONTROL_BASE_URL="http://localhost:5001",o.isPwa=!1,o.FLAGS={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1},o.BASE_RANDOMIZER=999},9606:(e,t,n)=>{t.__esModule=!0,t.unesc=t.stripComments=t.getProp=t.ensureObject=void 0;var o=c(n(5286));t.unesc=o.default;var i=c(n(6291));t.getProp=i.default;var r=c(n(1557));t.ensureObject=r.default;var s=c(n(8354));function c(e){return e&&e.__esModule?e:{default:e}}t.stripComments=s.default},9635:(e,t,n)=>{n.d(t,{x:()=>o});const o=new BroadcastChannel("Freeschema_mftsccs_browser_channel")},9700:(e,t,n)=>{n.d(t,{V:()=>l});var o,i=n(9311),r=n(3278),s=n(1863),c=n(3518),a=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class l{static startAutoSync(){this.autoSyncInterval?console.warn("Auto-sync is already running."):(this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS,setInterval(()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&(this.nextSyncTime=e+this.SYNC_INTERVAL_MS,this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())},3e4))}static stopAutoSync(){null!==this.autoSyncInterval&&(clearInterval(this.autoSyncInterval),this.autoSyncInterval=null,this.nextSyncTime=null)}static setLogLevel(e){this.logLevel=e}static shouldLog(e){return this.LOG_LEVELS.indexOf(e)>=this.LOG_LEVELS.indexOf(this.logLevel)}static formatLogData(e,t,n){const o=Object.assign({timestamp:(new Date).toISOString(),level:e,message:t},n);return this.packageLogsData.push(o),"ERROR"==e&&(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer()),o}static log(e,t,n){if(this.logPackageActivationStatus)try{this.formatLogData(e,t,n||null)}catch(e){console.error("Error on Logger Log : ",e)}}static logUpdate(e){var t;try{if(!this.logPackageActivationStatus)return{};if(!e)return{};const n=Date.now();e.startTime=null!==(t=e.startTime)&&void 0!==t?t:n;const o=n-e.startTime;e.responseTime=`${o} ms`,1==!e.serviceWorker&&(e.serviceWorker=!1)}catch(t){(0,s.ey)(e,"Logger.logUpdate",t)}}static logfunction(e,...t){if(!this.logPackageActivationStatus)return{};const n=Date.now();let o=t;const s=i.BaseUrl.getRandomizer(),c=r.b.sessionId;let a={startTime:n,functionName:e,functionParameters:o,requestFrom:i.BaseUrl.BASE_APPLICATION,sessionId:c,applicationId:s};return this.formatLogData("INFO","function called",a)}static logError(e,t,n,o,i,s,c,a,l,d,u){try{const h=r.b.sessionId,p={startTime:e,userId:t,operationType:n,requestFrom:o,requestIP:i,responseStatus:s,responseTime:`${(performance.now()-e).toFixed(3)}ms`,responseSize:c?`${JSON.stringify(c).length}`:"0",sessionId:null==h?void 0:h.toString(),functionName:a,functionParameters:l,userAgent:d,conceptsUsed:u};this.formatLogData("ERROR",`Information logged for ${a}`,p)}catch(e){console.error("Error on logError")}}static logApplication(e,t,n){if(this.logApplicationActivationStatus)try{const o={timestamp:(new Date).toISOString(),level:e,message:t,data:n||null};this.applicationLogsData.push(o),"ROUTE"!=e&&"USER_EVENT"!=e||(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())}catch(e){console.error("Failed to log application activity:",e)}}static checkLoggerServerStatus(){return a(this,void 0,void 0,function*(){let e=1e4+o.checkInterval;const t=new Date;if(o.lastCheck&&t.getTime()-o.lastCheck.getTime()<e)console.log("still cooling down");else{try{let e=i.BaseUrl.LogHealth();o.lastCheck=new Date,(yield fetch(e,{method:"GET"})).ok&&(o.isLoggerActive=!0,o.checkInterval=0)}catch(e){console.warn("This is error in the logger check")}o.checkInterval=o.checkInterval+500}})}static sendApplicationLogsToServer(){return a(this,void 0,void 0,function*(){const e=this.applicationLogsData;try{if(!o.isLoggerActive)return void o.checkLoggerServerStatus();if(0===e.length)return;this.applicationLogsData=[],r.b.BearerAccessToken;const t=50;let n=(0,c.Xr)(),s=0;for(;0!=e.length;){const r=e.slice(0,t),c=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:n,body:JSON.stringify({logType:this.appLogs,logData:r})});c.ok||404===c.status&&(o.isLoggerActive=!1),e.splice(0,t),s+=t,s++}}catch(e){o.isLoggerActive=!1}})}static sendPackageLogsToServer(){return a(this,void 0,void 0,function*(){const e=this.packageLogsData;try{if(!o.isLoggerActive)return void o.checkLoggerServerStatus();if(0===e.length)return;this.packageLogsData=[];const t=300;let n=0;for(;0!=e.length;){const r=e.slice(0,t);let s=(0,c.Xr)();const a=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:s,body:JSON.stringify({logType:this.mftsccsBrowser,logData:r})});if(!a.ok)return void(404===a.status&&(o.isLoggerActive=!1));e.splice(0,t),n++}}catch(e){o.isLoggerActive=!1}})}static saveLogToLocalStorage(e,t){try{if(void 0===typeof localStorage)return void console.warn("Local Storage type undefined");{const n=JSON.parse((null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))||"[]");n.push(t),null===localStorage||void 0===localStorage||localStorage.setItem(e,JSON.stringify(n))}}catch(e){console.error("Error on saving log in localstorage"),this.log("ERROR","Error while saving log in local storage")}}static clearLogsFromLocalStorage(e){void 0!==typeof localStorage?null===localStorage||void 0===localStorage||localStorage.removeItem(e):console.warn("localStorage is not available")}}o=l,l.isLoggerActive=!0,l.lastCheck=new Date,l.checkInterval=0,l.logLevel="INFO",l.packageLogsData=[],l.applicationLogsData=[],l.LOG_LEVELS=["DEBUG","INFO","WARNING","ERROR","ROUTE"],l.SYNC_INTERVAL_MS=6e4,l.nextSyncTime=null,l.appLogs="app",l.mftsccsBrowser="mftsccs",l.logApplicationActivationStatus=!1,l.logPackageActivationStatus=!1,l.autoSyncInterval=null,o.startAutoSync()},9720:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3295))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.TAG,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=c,e.exports=t.default},9736:(e,t,n)=>{n.d(t,{v:()=>C});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class s{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addConceptToTree(e){var t=new i.x(e.id,e,null,null);new i.x(e.characterValue,e,null,null),this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static getNodeFromTree(e){return r(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static getCharacterAndTypeFromTree(e,t){return this.root?this.root.getFromNodeWithCharacterAndType(e,t,this.root):this.root}static updateSyncStatus(e){return this.root?this.root.updateNodeSyncStatus(e,!0,this.root):this.root}static removeNodeFromTree(e){return r(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}}s.root=null;var c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class a{static waitForDataToLoad(){return c(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalCharacterLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addNodeToTree(e){return c(this,void 0,void 0,function*(){return null==this.LocalCharacterRoot?(this.LocalCharacterRoot=e,this.LocalCharacterRoot):(this.LocalCharacterRoot=this.LocalCharacterRoot.addCharacterNode(e,this.LocalCharacterRoot,this.LocalCharacterRoot.height),this.LocalCharacterRoot)})}static addConceptToTree(e){if(""!=e.characterValue){var t=new i.x(e.characterValue,e,null,null);this.addNodeToTree(t)}}static getNodeFromTree(e){return this.LocalCharacterRoot?this.LocalCharacterRoot.getCharacterFromNode(e,this.LocalCharacterRoot):this.LocalCharacterRoot}static getCharacterAndTypeFromTree(e,t){return c(this,void 0,void 0,function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndType(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot})}static getCharacterAndCategoryFromTree(e,t){return c(this,void 0,void 0,function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndCategory(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot})}static removeConceptType(e,t){this.LocalCharacterRoot&&(this.LocalCharacterRoot=this.LocalCharacterRoot.removeNodeWithVariants(this.LocalCharacterRoot,e,t))}}a.LocalCharacterRoot=null;var l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class d{static addNodeToTree(e){return l(this,void 0,void 0,function*(){return null==this.LocalTypeRoot?(this.LocalTypeRoot=e,this.LocalTypeRoot):(this.LocalTypeRoot=this.LocalTypeRoot.addTypeNode(e,this.LocalTypeRoot,this.LocalTypeRoot.height),this.LocalTypeRoot)})}static addConceptToTree(e){if(0!=e.typeId){var t=new i.x(e.typeId,e,null,null);this.addNodeToTree(t)}}static removeConceptType(e,t){this.LocalTypeRoot&&(this.LocalTypeRoot=this.LocalTypeRoot.removeNodeWithVariants(this.LocalTypeRoot,e,t))}static getNodeFromTree(e){return this.LocalTypeRoot?this.LocalTypeRoot.getFromNode(e,this.LocalTypeRoot):this.LocalTypeRoot}static getTypeVariantsFromTree(e){var t=this.getNodeFromTree(e),n=[];if(t){n.push(null==t?void 0:t.value);for(let e=0;e<t.variants.length;e++)n.push(t.variants[e].value);return n}}static waitForDataToLoad(){return l(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(o.B.isLocalTypeLoaded)return e("done");setTimeout(d.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserId(e,t){return l(this,void 0,void 0,function*(){var n=[],o=this.getNodeFromTree(e);if(o){console.log("this is the node to type",o),o.value.userId!=t&&999!=o.value.userId||n.push(null==o?void 0:o.value);for(let e=0;e<o.variants.length;e++)o.variants[e].value.userId!=t&&999!=o.value.userId||n.push(o.variants[e].value)}return n})}}d.LocalTypeRoot=null;var u=n(6416),h=n(3026),p=n(7820),f=n(4864),v=n(628),y=n(9311),g=n(3278),m=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};class C{constructor(){this.name="conceptsArray"}static AddConcept(e){0!=e.id&&(s.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e),this.localconceptsArray.push(e))}static AddPermanentConcept(e){0!=e.id&&(s.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId),p.G.addConceptToTree(e),h.I.AddConcept(e),(0,y.AddGhostConcept)(e,e.userId,g.b.sessionId))}static RemoveConcept(e){return m(this,void 0,void 0,function*(){try{0!=e.id&&(s.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId))}catch(e){throw e}})}static RemoveConceptById(e){return m(this,void 0,void 0,function*(){try{let t=yield C.GetConcept(e);0!=t.id&&(s.removeNodeFromTree(e),a.removeConceptType(t.characterValue,t.ghostId),d.removeConceptType(t.typeId,t.ghostId),v.H.RemoveConcept(t))}catch(e){throw e}})}static AddConceptToMemory(e){0!=e.id&&(s.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e))}static GetConcept(e){return m(this,void 0,void 0,function*(){var t=(0,u.u)(),n=yield s.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static UpdateConceptSyncStatus(e){return m(this,void 0,void 0,function*(){s.updateSyncStatus(e)})}static GetConceptByGhostId(e){return m(this,void 0,void 0,function*(){var t=(0,u.u)(),n=yield p.G.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static GetConceptByCharacter(e){return m(this,void 0,void 0,function*(){var t=(0,u.u)(),n=a.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterAndTypeLocal(e,t){return m(this,void 0,void 0,function*(){var n=(0,u.u)(),o=yield a.getCharacterAndTypeFromTree(e,t);return o&&(n=o.value),n})}static GetConceptByCharacterAndCategoryLocal(e,t){return m(this,void 0,void 0,function*(){var n=(0,u.u)(),o=yield a.getCharacterAndCategoryFromTree(e,t);return o&&(n=o.value),n})}static GetConceptsByTypeId(e){let t=[];for(var n=0;n<this.localconceptsArray.length;n++)this.localconceptsArray[n].typeId==e&&t.push(this.localconceptsArray[n]);return t}static GetConceptsByTypeIdAndUser(e,t){return m(this,void 0,void 0,function*(){let n=[];return n=yield d.getTypeVariantsFromTreeWithUserId(e,t),n})}static ClearData(){return m(this,void 0,void 0,function*(){this.localconceptsArray=[],f.G.connectionArray=[]})}getName(){return this.name}}C.localconceptsArray=[]},9746:()=>{},9934:(e,t,n)=>{function o(e,t){return-1===e.indexOf(t)&&e.push(t),e}n.d(t,{A:()=>o})},9975:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(9311),i=n(9736),r=n(3077),s=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};function c(e,t,n,c,a){return s(this,arguments,void 0,function*(e,t,n,s,c,a={concepts:[],connections:[]}){var l,d,u,h;if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("MakeTheConceptLocal",{referent:e,typeCharacter:t,userId:n,categoryId:s,typeId:c,actions:a});return(null===(d=null===(l=null==i?void 0:i.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(h=null===(u=null==i?void 0:i.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(a.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("MakeTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let p=yield i.v.GetConceptByCharacterAndTypeLocal(e,c),f=p;return"the"==t&&(s=1),0==f.id&&(p=yield(0,r.A)(e,t,n,s,c,4,void 0,null,a),f=p),f})}},9977:()=>{}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=n(9311),i=n(9635),r=n(205),s=n(3278),c=n(5020),a=n(7887),l=n(7869),d=n(3075),u=n(2803),h=n(7139),p=n(5284),f=n(8939),v=n(6687),y=n(2013),g=n(7876),m=n(1213),C=n(5328),w=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const I={GetConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,h.r)(e.id)}}),GetTheConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetTheConcept)(e.id,e.userId)}}),AddTypeConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,g.K)(e.concept)}}),GetConceptBulk:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptBulk)(e.passedConcepts)}}),GetLink:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetLink)(e.id,e.linker,e.inpage,e.page)}}),GetRelation:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetRelation)(e.id,e.relation,e.inpage,e.page,e.reverse)}}),GetRelationRaw:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetRelationRaw)(e.id,e.relation,e.inpage,e.page,e.reverse)}}),GetComposition:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.Nj)(e.id)}}),GetCompositionList:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionList)(e.compositionName,e.userId,e.inpage,e.page)}}),GetCompositionListWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListWithId)(e.compositionName,e.userId,e.inpage,e.page)}}),GetCompositionById:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.hL)(e.id)}}),GetCompositionWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.yz)(e.id)}}),GetCompositionListAllWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListAllWithId)(e.compositionName,e.userId,e.inpage,e.page)}}),GetConceptByCharacter:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptByCharacter)(e.characterValue)}}),GetConceptByCharacterUpdated:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,y.w)(e.characterValue)}}),GetConceptByCharacterAndType:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptByCharacterAndType)(e.characterValue,e.typeId)}}),GetCompositionFromConnectionsWithDataId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.p8)(e.conceptIds,e.connectionIds)}}),GetCompositionFromConnectionsWithDataIdIndex:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.Nt)(e.conceptIds,e.connectionIds)}}),GetCompositionConnectionsBetweenTwoConcepts:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,u.x)(e.ofConceptId,e.toConcept,e.mainKey)}}),GetConnectionDataPrefetch:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.QL)(e.connectionIds)}}),GetCompositionWithIdFromMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.RW)(e.id)}}),GetCompositionWithIdAndDateFromMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.Ez)(e.id)}}),GetCompositionFromMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.kx)(e.id)}}),GetCompositionFromMemoryNormal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.XI)(e.id)}}),GetCompositionWithIdFromMemoryNew:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.$N)(e.id)}}),FindConnectionsOfCompositionsBulkInMemory:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,p.B)(e.composition_ids)}}),GetAllTheConnectionsByTypeAndOfTheConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetAllTheConnectionsByTypeAndOfTheConcept)(e.id,e.linker,e.reverse)}}),GetCompositionFromMemoryWithConnections:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,f.JA)(e.id,e.connectionList)}}),GetCompositionFromConnectionsWithIndexFromConnections:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.hG)(e.conceptIds,e.connectionIds)}}),GetCompositionFromConnectionsWithDataIdFromConnections:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,v.km)(e.conceptIds,e.connectionIds)}}),GetTheConceptLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,m.f)(e.id)}}),GetCompositionLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionLocal)(e.id)}}),GetCompositionLocalWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionLocalWithId)(e.id)}}),GetCompositionListLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListLocal)(e.compositionName,e.userId)}}),GetCompositionListLocalWithId:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetCompositionListLocalWithId)(e.compositionName,e.userId)}}),GetConceptByCharacterAndCategoryLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConceptByCharacterAndCategoryLocal)(e.character)}}),ConceptsData__AddConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.AddConcept(e.concept)}}),ConceptsData__AddWidget:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.AddWidget(e.widgetDetails)}}),ConceptsData__RemoveWidget:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.RemoveWidget(e.id)}}),ConceptsData__GetConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.GetConcept(e.id)}}),ConceptsData__GetWidget:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.GetWidget(e.id)}}),ConceptsData__GetConceptsByTypeIdAndUser:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConceptsData.GetConceptsByTypeIdAndUser(e.typeId,e.userId)}}),ConnectionData__GetConnectionByOfTheConceptAndType:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e.ofTheConceptId,e.typeId)}}),ConnectionData__GetConnection:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnection(e.id)}}),ConnectionData__GetConnectionsOfCompositionLocal:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnectionsOfCompositionLocal(e.id)}}),ConnectionData__GetConnectionsOfConcept:e=>w(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.ConnectionData.GetConnectionsOfConcept(e.id)}}),GetLinkListener:e=>w(void 0,void 0,void 0,function*(){let t=!1;return new Promise((n,o)=>{(0,C.d)(e.id,e.linker,e.inpage,e.page,e.format).subscribe(o=>{var r,s;t?(console.log("isSubscribed",t),n({success:!0,data:o}),t=!0):(console.log("is not isSubscribed",t),i.x.postMessage({type:"GetLinkListener",payload:{id:null===(r=null==e?void 0:e.listener)||void 0===r?void 0:r.listenerId,listenerId:null===(s=null==e?void 0:e.listener)||void 0===s?void 0:s.listenerId,data:o}}))}).catch(e=>{console.log("Error : ",e),o("Error Occured")})})})};var T=n(1320),k=n(3256),A=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const S={SearchLinkMultipleAll:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.SearchLinkMultipleAll)(e.searchQuery,e.token,e.caller,e.format)}}),RecursiveSearchApi:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApi)(e.composition,e.listLinkers,e.textSearch,e.fullLinkers)}}),RecursiveSearchApiWithInternalConnections:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiWithInternalConnections)(e.composition,e.listLinkers,e.textSearch)}}),RecursiveSearchApiRaw:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiRaw)(e.composition,e.listLinkers,e.textSearch,e.fullLinkers)}}),RecursiveSearchApiRawFullLinker:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiRawFullLinker)(e.composition,e.fullLinkers,e.textSearch)}}),RecursiveSearchApiNewRawFullLinker:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.RecursiveSearchApiNewRawFullLinker)(e.composition,e.fullLinkers,e.textSearch)}}),formatConnectionsDataId:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.e$)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos,e.order)}}),formatConnectionsJustId:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.y6)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos,e.order)}}),formatConnectionsV2:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.rq)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos,e.order)}}),formatConnections:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,T.b6)(e.linkers,e.conceptIds,e.mainCompositionIds,e.reverse,e.countInfos)}}),BuildWidgetFromId:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,k.Cp)(e.id)}}),BuildWidgetFromIdForLatest:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,k.qj)(e.id)}}),BuildWidgetFromCache:e=>A(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,k.xJ)(e.id)}})};var N=n(1218),_=n(3077),b=n(9975),L=n(5868),E=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const x={MakeTheInstanceConcept:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.MakeTheInstanceConcept)(e.type,e.referent,e.composition,e.userId,e.passedAccessId,e.passedSessionId,e.referentId)}}),MakeTheConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,b.A)(e.referent,e.typeCharacter,e.userId,e.categoryId,e.typeId,e.actions)}}),MakeTheTimestamp:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.MakeTheTimestamp)(e.type,e.referent,e.userId,e.accessId,e.sessionInformationId)}}),CreateTheComposition:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,N.A)(e.json,e.ofTheConceptId,e.ofTheConceptUserId,e.mainKey,e.userId,e.accessId,e.sessionInformationId)}}),MakeTheInstanceConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,L.k)(e.type,e.referent,e.composition,e.userId,e.accessId,e.sessionInformationId,e.referentId,e.actions),actions:e.actions}}),MakeTheTypeConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.MakeTheTypeConceptLocal)(e.typeString,e.sessionId,e.sessionUserId,e.userId,e.actions),actions:e.actions}}),CreateTheConceptLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,_.A)(e.referent,e.typecharacter,e.userId,e.categoryId,e.typeId,e.accessId,e.isComposition,e.referentId,e.actions),actions:e.actions}}),CreateTheCompositionLocal:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateTheCompositionLocal)(e.json,e.ofTheConceptId,e.ofTheConceptUserId,e.mainKey,e.userId,e.accessId,e.sessionInformationId,e.automaticSync,e.actions),actions:e.actions}}),CreateData:e=>E(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateData)(e.json,e.ofConcept,e.typeConcept,e.actions),actions:e.actions}})};var O=n(3729),B=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const R={UpdateComposition:e=>B(void 0,void 0,void 0,function*(){return yield(0,o.UpdateComposition)(e.patcherStructure),{success:!0}}),UpdateCompositionLocal:e=>B(void 0,void 0,void 0,function*(){return yield(0,O.D)(e.patcherStructure,e.actions),{success:!0}})};var D=n(8095),G=n(4711),P=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const F={GetConnectionById:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionById)(e.id)}}),GetConnectionBulk:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionBulk)(e.connectionIds)}}),GetConnectionOfTheConcept:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionOfTheConcept)(e.typeId,e.ofTheConceptId,e.userId,e.inpage,e.page)}}),GetAllConnectionsOfCompositionBulk:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetAllConnectionsOfCompositionBulk)(e.composition_ids)}}),GetConnectionBetweenTwoConceptsLinker:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.GetConnectionBetweenTwoConceptsLinker)(e.ofTheConcept,e.toTheConcept,e.linker,e.fullLinker,e.forward)}}),CreateConnectionBetweenTwoConcepts:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateConnectionBetweenTwoConcepts)(e.ofTheConcept,e.toTheConcept,e.linker,e.both)}}),CreateConnectionBetweenTwoConceptsLocal:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,D.h)(e.ofTheConcept,e.toTheConcept,e.linker,e.both,e.actions),actions:e.actions}}),CreateTheConnectionLocal:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateTheConnectionLocal)(e.ofTheConceptId,e.toTheConceptId,e.typeId,e.orderId,e.typeString,e.userId,e.actions),actions:e.actions}}),CreateConnection:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,G.d)(e.ofTheConcept,e.toTheConcept,e.connectionTypeString,e.actions),actions:e.actions}}),CreateConnectionBetweenEntityLocal:e=>P(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.CreateConnectionBetweenEntityLocal)(e.concept1Data,e.concept2Data,e.linker,e.actions),actions:e.actions}})};var U=n(4818),M=n(2289),W=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const j={DeleteConceptById:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConceptById)(e.id)}}),DeleteConnectionById:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConnectionById)(e.id)}}),DeleteUser:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteUser)(e.id)}}),DeleteConnectionByType:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConnectionByType)(e.id,e.linker)}}),DeleteConnectionByTypeBulk:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,M.L0)(e.id,e.linkers)}}),DeleteConnectionByIdBulk:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,U.E)(e.ids)}}),DeleteConceptLocal:e=>W(void 0,void 0,void 0,function*(){return{success:!0,data:yield(0,o.DeleteConceptLocal)(e.id)}})};var V=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};const $={SyncData__SyncDataOnline:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.SyncData.SyncDataOnline()}}),LocalSyncData__SyncDataOnline:e=>V(void 0,void 0,void 0,function*(){return console.log("This is the transaction inside syncing",e),{success:!0,data:yield o.LocalSyncData.SyncDataOnline(e.transactionId,void 0,e.withAuth)}}),LocalSyncData__initializeTransaction:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.LocalSyncData.initializeTransaction(e.transactionId)}}),LocalSyncData__markTransactionActions:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.LocalSyncData.markTransactionActions(e.transactionId,e.actions),actions:e.actions}}),LocalSyncData__rollbackTransaction:e=>V(void 0,void 0,void 0,function*(){return{success:!0,data:yield o.LocalSyncData.rollbackTransaction(e.transactionId,e.actions),actions:e.actions}})};var H=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};let q=!1,z=new Map,J=!1,Q=[];const Y=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({checkProcess:e=>H(void 0,void 0,void 0,function*(){return(null==e?void 0:e.checkMessageId)&&Q.includes(null==e?void 0:e.checkMessageId)?{success:!0,data:{processing:!0},name:"init"}:{success:!0,data:{processing:!1},name:"init"}}),init:e=>H(void 0,void 0,void 0,function*(){return q?(console.warn("Already Initialized"),{success:!0,name:"init"}):(console.log("init has started"),q=!0,console.log("init has set value"),console.log("Payload log in service worker : ",e),yield function(){return H(this,arguments,void 0,function*(e="",t="",n="",i="",u=!0,h="",p,f){var v,y;o.BaseUrl.BASE_URL=e,o.BaseUrl.AI_URL=t,o.BaseUrl.NODE_URL=i,o.BaseUrl.BASE_APPLICATION=h,n&&(s.b.BearerAccessToken=n);let g=Math.floor(1e8*Math.random());if(console.log("Flags came in init of service worker is ",p),o.BaseUrl.setRandomizer(g),o.BaseUrl.FLAGS=p,null===(v=o.BaseUrl.FLAGS)||void 0===v?void 0:v.isTest)return r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0,r.B.isLocalDataLoaded=!0,r.B.isLocalTypeLoaded=!0,r.B.isLocalCharacterLoaded=!0,r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0,r.B.isLocalConnectionLoaded=!0,!0;o.BaseUrl.ACCESS_CONTROL_BASE_URL=null!=f?f:"",console.log("This is the base url",o.BaseUrl.BASE_URL,g),console.log("service worker BaseUrl.FLAGS is ",o.BaseUrl.FLAGS),(null===(y=o.BaseUrl.FLAGS)||void 0===y?void 0:y.accessTracker)&&(console.log("From service worker, flag of Access Tracker."),o.AccessTracker.activateStatus=!0,console.log("Access Tracker Activation status from service worker",o.AccessTracker.activateStatus)),yield(0,l.A)();const m=(new Date).getTime();yield(0,c.A)().then(()=>{let e=(new Date).getTime()-m;console.log("The time taken to prepare concept data is ",e)}).catch(e=>{throw e}),yield(0,d.Ay)().then(()=>{let e=(new Date).getTime()-m;console.log("The time taken to prepare local concept ",e)}).catch(e=>{throw e}),yield(0,a.p)().then(()=>{r.B.isLocalConnectionLoaded=!0}).catch(e=>{throw e}),yield(0,d.xd)(),yield(0,a.a)().then(()=>{r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0;let e=(new Date).getTime()-m;console.log("The time taken to prepare connections ",e)}).catch(e=>{throw e})})}(null==e?void 0:e.url,null==e?void 0:e.aiurl,null==e?void 0:e.accessToken,null==e?void 0:e.nodeUrl,null==e?void 0:e.enableAi,null==e?void 0:e.applicationName,null==e?void 0:e.flags,null==e?void 0:e.accessControlUrl),console.log("init has completed"),{success:!0,data:void 0,name:"init"})}),updateAccessToken:e=>H(void 0,void 0,void 0,function*(){return yield(0,o.updateAccessToken)(e.accessToken,e.session),{success:!0,name:"updateAccessToken"}}),SESSION_DATA:e=>H(void 0,void 0,void 0,function*(){return console.log("this is the payload",e),o.BaseUrl.NODE_CACHE_URL=e.data,s.b.setSession(e.session),{success:!0,name:"SESSION_DATA"}})},I),S),x),R),F),j),$),X=()=>!!q||(i.x.postMessage({type:"checkInit",payload:{}}),!1);var Z=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,c)}a((o=o.apply(e,t||[])).next())})};self.addEventListener("install",e=>{console.log("Service Worker installing... sw"),e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>Z(void 0,void 0,void 0,function*(){yield(0,o.setHasActivatedSW)(!0),console.log("Service Worker activating... sw"),e.waitUntil(new Promise((e,t)=>{try{self.clients.claim(),console.log("claimed"),X(),e(void 0)}catch(e){console.error("Error during service worker activation:",e),t(e)}}))})),self.addEventListener("fetch",e=>{e.clientId||e.respondWith(K(e))}),self.addEventListener("message",e=>{!function(e){H(this,void 0,void 0,function*(){var t,n;let i={success:!1,data:void 0};const{type:r,payload:s}=e.data,c=s.TABID;let a=!1;try{if(!r||!s.TABID)return;Q.push(s.messageId),"init"==r||X()||(console.warn("Message received before sw initialization",r,s.messageId),yield new Promise(e=>{console.log("is it stuck here???? type",r,s.messageId);const t=setInterval(()=>{console.log("Interval check 0",q,r,s.messageId),q?(console.log("Interval check 2",q,r,s.messageId),console.log(n,t),clearInterval(t),clearTimeout(n),e(void 0)):console.warn("Watring for init 1:",r)},200),n=setTimeout(()=>{console.warn("Tried waiting for init but couldn't complete in time: ",r,s.messageId),clearInterval(t),e(void 0)},9e4)}),console.log("After timeout promise",r,s.messageId,q),q||(console.log("wait failed",q,s.messageId,r),Q=yield Promise.all(Q.filter(e=>e!=s.messageId)),e.source.postMessage(i)),console.log("After timeout promise nice",r,q)),z.has(c)||z.set(c,{concepts:[],connections:[]});let l=z.get(c);if(Array.isArray(null===(t=null==s?void 0:s.actions)||void 0===t?void 0:t.concepts)&&Array.isArray(null===(n=null==s?void 0:s.actions)||void 0===n?void 0:n.connections)||(s.actions={concepts:[],connections:[]},a=!0),"LocalSyncData__SyncDataOnline"==r&&!s.transactionId&&l){console.log("this is the tab syncing for data",s);const e=o.LocalSyncData.SyncDataOnline(void 0,JSON.parse(JSON.stringify(l)),s.withAuth);z.delete(c),l=void 0,console.log("Syncing the tab here",r),i={success:!0,data:yield e,actions:{concepts:[],connections:[]}}}else Y[r]?i=yield Y[r](s):console.warn(`Unable to handle "${r}" case in service worker`);if(i.messageId=s.messageId,J&&console.warn("Race condition has been met",r),J=!0,l=z.get(c),i.actions&&l){let e={concepts:[...l.concepts,...i.actions.concepts],connections:[...l.connections,...i.actions.connections]};const[t,n]=yield Promise.all([Promise.all(Array.from(new Map(e.concepts.map(e=>[`${e.id}-${e.ghostId}`,e])).values())),Promise.all(Array.from(new Map(e.connections.map(e=>[`${e.id}-${e.ghostId}`,e])).values()))]);z.set(c,JSON.parse(JSON.stringify({concepts:t,connections:n})))}J=!1,a&&delete i.actions,Q=yield Promise.all(Q.filter(e=>e!=s.messageId)),e.source.postMessage(i)}catch(t){console.error("Service worker Message Handle Error: ",r,t),401!=(null==t?void 0:t.status)&&500!=(null==t?void 0:t.status)||(i={success:!1,data:{status:t.status,statusText:null==t?void 0:t.url},messageId:s.messageId}),Q=yield Promise.all(Q.filter(e=>e!=s.messageId)),e.source.postMessage(i)}})}(e)});const K=e=>Z(void 0,void 0,void 0,function*(){try{const t=yield fetch(e.request);if(401===t.status){const n=Math.random().toString(36).substring(2);return e.waitUntil(e.source.postMessage({type:"API_401",messageId:n,message:"Unauthorized",payload:{method:e.request.method,url:e.request.url,headers:Array.from(e.request.headers.entries()),body:yield e.request.clone().json()}})),yield new Promise(e=>{console.log("Re resolving 401",t.url),setTimeout(()=>e(t),6e4),navigator.serviceWorker.addEventListener("message",o=>{var i,r,s;o.data&&(null===(i=o.data)||void 0===i?void 0:i.messageId)==n&&"API_RESPONSE"===(null===(r=o.data)||void 0===r?void 0:r.type)&&((null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.response)?e(o.data.response):(console.log("Unable to resolve re 401",t.url),e(t)))})})}return t}catch(e){throw console.error("Error occured during 401 intercepting",e),e}});