1"use strict";(self.webpackChunkonirix=self.webpackChunkonirix||[]).push([[447],{16234:($,x,s)=>{s.d(x,{X:()=>A});var r=s(54438),_=s(13443),p=s(68010),f=s(49117),P=s(71985),X=s(7786);let y=(()=>{class u{constructor(M,E,C,O){this.router=M,this.storageService=E,this.authService=C,this.userService=O}canActivate(M,E){return new P.c(C=>{M.queryParamMap.has("token")?this.authService.loginToken(M.queryParamMap.get("token")).subscribe({next:O=>{null!=this.storageService.getAuthToken()?(this.userService.updateUserStatus(),C.next(!0)):(this.router.navigate(["/login"]),C.next(!1))},error:O=>C.next(!1)}):null!=this.storageService.getAuthToken()?C.next(!0):(this.router.navigate(["/login"]),C.next(!1))})}static{this.\u0275fac=function(E){return new(E||u)(r.KVO(X.Ix),r.KVO(f.n),r.KVO(p.u),r.KVO(_.D))}}static{this.\u0275prov=r.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}}return u})();const A=(u,I)=>(0,r.WQX)(y).canActivate(u,I)},34447:($,x,s)=>{s.r(x),s.d(x,{CodeEditorModule:()=>C});var r=s(60177),_=s(89417),p=s(7786),f=s(45212),P=s(79431),X=s(4129),y=s(98006),A=s(16234),u=s(45506),I=s(54438);const M=[{path:"",component:u.t,canActivate:[A.X]}];let E=(()=>{class O{static{this.\u0275fac=function(T){return new(T||O)}}static{this.\u0275mod=I.$C({type:O})}static{this.\u0275inj=I.G2t({imports:[p.iI.forChild(M),p.iI]})}}return O})(),C=(()=>{class O{static{this.\u0275fac=function(T){return new(T||O)}}static{this.\u0275mod=I.$C({type:O})}static{this.\u0275inj=I.G2t({imports:[r.MD,f.U,p.iI,_.YN,P.U,X.G,y.Vv.forRoot(),E]})}}return O})()},45506:($,x,s)=>{s.d(x,{t:()=>j_});var r=s(10467),_=s(54438),p=s(78921),f=s(55016),P=s(48520),X=s(8125),y=s(53254),A=s(64848),u=s(57086),I=s(71150),M=s(81233),E=s(45205);class C{}class O{}var k=s(81398),S=s(93207),T=s(56977),o_=(s(97514),s(75733)),w=s(829),m=s(60177),t_=s(89099),U=s(55088);const n_=["oxHistoryContextMenu"],v=()=>({"width.px":14,"height.px":14}),B=(i,a)=>({"ox-history-list__item--selected":i,"ox-history-list__item--editing":a});function i_(i,a){if(1&i&&_.eu8(0,22),2&i){_.XpG();const e=_.sdS(12);_.Y8G("ngTemplateOutlet",e)}}function s_(i,a){1&i&&(_.j41(0,"span",29),_.pXf(1,7),_.k0s())}function c_(i,a){1&i&&(_.j41(0,"span"),_.EFF(1,"-"),_.k0s())}function r_(i,a){if(1&i){const e=_.RV6();_.j41(0,"li",23),_.bIt("click",function(){const t=_.eBV(e).$implicit,n=_.XpG(2);return _.Njj(n.selectCustomCodeHistory(t))}),_.nrm(1,"svg-icon",24),_.j41(2,"div")(3,"ox-p-inplace",25),_.bIt("close",function(){_.eBV(e);const t=_.XpG(2);return _.Njj(t.closeInplace())})("focusOut",function(t){_.eBV(e);const n=_.XpG(2);return _.Njj(n.editNameFocusOut(t))}),_.k0s(),_.j41(4,"p"),_.EFF(5),_.k0s(),_.DNE(6,s_,2,0,"span",26)(7,c_,2,0,"span",27),_.j41(8,"span"),_.pXf(9,6),_.nI1(10,"date"),_.k0s()(),_.j41(11,"div",28),_.bIt("click",function(t){const n=_.eBV(e).$implicit,c=_.XpG(2);return _.Njj(c.openMenu(t,n))}),_.k0s()()}if(2&i){const e=a.$implicit,o=_.XpG(2);_.Y8G("ngClass",_.l_i(16,B,(null==e?null:e.oid)===(null==o.selectedCCH?null:o.selectedCCH.oid),((null==e?null:e.oid)===o.pendingEditOid||(null==e?null:e.oid)===(null==o.menuCCH?null:o.menuCCH.oid))&&o.isEditingName)),_.R7$(),_.Y8G("svgStyle",_.lJ4(19,v)),_.R7$(2),_.Mz_("id","ox-inplace-",e.oid,""),_.Y8G("max",50)("key",e.oid)("value",e.name)("label",e.name),_.R7$(2),_.JRh(e.name),_.R7$(),_.Y8G("ngIf",e.oid==o.currentCCH.oid),_.R7$(),_.Y8G("ngIf",e.oid==o.currentCCH.oid),_.R7$(3),_.uP7(_.brH(10,12,e.lastUpdate,"medium",o.localeId)),_.nnv(9)}}function l_(i,a){if(1&i&&_.DNE(0,r_,12,20,"li",16),2&i){const e=_.XpG();_.Y8G("ngForOf",e.namedList)("ngForTrackBy",e.trackByOid)}}function a_(i,a){1&i&&(_.j41(0,"span",29),_.pXf(1,9),_.k0s())}function O_(i,a){1&i&&(_.j41(0,"span"),_.EFF(1,"-"),_.k0s())}function d_(i,a){if(1&i){const e=_.RV6();_.j41(0,"li",23),_.bIt("click",function(){const t=_.eBV(e).$implicit,n=_.XpG();return _.Njj(n.selectCustomCodeHistory(t))}),_.j41(1,"div")(2,"ox-p-inplace",25),_.bIt("close",function(){_.eBV(e);const t=_.XpG();return _.Njj(t.closeInplace())})("focusOut",function(t){_.eBV(e);const n=_.XpG();return _.Njj(n.editNameFocusOut(t))}),_.k0s(),_.j41(3,"p"),_.EFF(4),_.k0s(),_.DNE(5,a_,2,0,"span",26)(6,O_,2,0,"span",27),_.j41(7,"span"),_.pXf(8,8),_.k0s(),_.j41(9,"div",28),_.bIt("click",function(t){const n=_.eBV(e).$implicit,c=_.XpG();return _.Njj(c.openMenu(t,n))}),_.k0s()()()}if(2&i){const e=a.$implicit,o=_.XpG();_.Y8G("ngClass",_.l_i(10,B,e.oid===(null==o.selectedCCH?null:o.selectedCCH.oid),o.isEditingName&&e.oid===(null==o.menuCCH?null:o.menuCCH.oid))),_.R7$(2),_.Mz_("id","ox-inplace-",e.oid,""),_.Y8G("max",50)("key",e.oid)("value",e.name)("label",e.name),_.R7$(2),_.JRh(e.name),_.R7$(),_.Y8G("ngIf",e.oid==o.currentCCH.oid),_.R7$(),_.Y8G("ngIf",e.oid==o.currentCCH.oid)}}function C_(i,a){1&i&&(_.j41(0,"p",30),_.PLo(1,10),_.nrm(2,"br")(3,"svg-icon",31),_.YFu(),_.k0s()),2&i&&(_.R7$(3),_.Y8G("svgStyle",_.lJ4(1,v)))}function S_(i,a){if(1&i){const e=_.RV6();_.j41(0,"li",19),_.bIt("click",function(){_.eBV(e);const t=_.XpG();return _.Njj(t.deleteHandler())}),_.nrm(1,"svg-icon",32),_.j41(2,"span"),_.pXf(3,11),_.k0s()()}2&i&&(_.R7$(),_.Y8G("svgStyle",_.lJ4(1,v)))}let g_=(()=>{class i extends p.${set cchList(e){this._cchList=e,this.processList()}
1constructor(e,o){super(),this.i18n=e,this.cdr=o,this.selectCCH=new _.bkB,this.onEdit=new _.bkB,this.onDelete=new _.bkB,this.localeId=this.i18n.localeId}ngAfterViewInit(){this.nameInputSubscription=this.nameInputs.changes.subscribe(e=>{this.pendingEditOid&&this.editNewlyCreatedVersion()})}processList(){var e=this;return(0,r.A)(function*(){null!=e._cchList&&(e.namedList=e._cchList.filter(o=>!o.isAutomatic),e.automaticList=e._cchList.filter(o=>o.isAutomatic))})()}selectCustomCodeHistory(e){this.selectedCCH=e,this.selectCCH.emit(e)}openMenu(e,o){this.menuCCH=o,this.contextMenu.open(e,!0)}setNextEdit(e){this.pendingEditOid=e,this.cdr.markForCheck()}editNewlyCreatedVersion(){this.isEditingName=!0,this.currentInplace=this.nameInputs.find(e=>e.key===this.pendingEditOid),this.currentInplace&&this.currentInplace.showInput(this.currentCCH.name)}editNameHandler(e){e.stopPropagation(),e.preventDefault(),this.contextMenu.close(),this.isEditingName=!0,this.currentInplace=this.nameInputs.find(o=>o.key===this.menuCCH.oid),this.currentInplace&&this.currentInplace.showInput(this.menuCCH.name)}closeInplace(){this.pendingEditOid=null,this.isEditingName=!1,this.menuCCH=null}editNameFocusOut(e){var o=this;return(0,r.A)(function*(){o.closeInplace();const t=o._cchList.find(n=>n.oid===e.key);t.name=e.value,o.onEdit.emit(t)})()}deleteHandler(){var e=this;return(0,r.A)(function*(){e.onDelete.emit(e.menuCCH),e.menuCCH=void 0,e.closeMenu()})()}closeMenu(){this.contextMenu.close()}ngOnDestroy(){this.nameInputSubscription.unsubscribe(),this.destroy$.next(),this.destroy$.complete()}trackByOid(e,o){return o.oid}static{this.\u0275fac=function(o){return new(o||i)(_.rXU(f.S),_.rXU(_.gRc))}}static{this.\u0275cmp=_.VBU({type:i,selectors:[["ox-history-list"]],viewQuery:function(o,t){if(1&o&&(_.GBs(n_,5),_.GBs(w.p,5)),2&o){let n;_.mGM(n=_.lsd())&&(t.contextMenu=n.first),_.mGM(n=_.lsd())&&(t.nameInputs=n)}},inputs:{project:"project",currentCCH:"currentCCH",selectedCCH:"selectedCCH",cchList:"cchList"},outputs:{selectCCH:"selectCCH",onEdit:"onEdit",onDelete:"onDelete"},features:[_.Vt3],decls:21,vars:8,consts:()=>{let e,o,t,n,c,l,h,R,N;return e="Saved versions",o="History",t="Edit name",n="From " + "\ufffd0\ufffd" + "",c="Current",l="Autosaved",h="Current",R=" No s
1aved versions yet. " + "\ufffd#2\ufffd\ufffd/#2\ufffd" + " Save " + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + " by selecting a history version.",N="Delete version",[["namedVersionsList",""],["noNamedVersions",""],["oxHistoryContextMenu",""],e,o,t,n,c,l,h,R,N,[1,"ox-history-list"],["oxAutoScroll","",1,"ox-history-list__namedlist"],[3,"ngTemplateOutlet",4,"ngIf","ngIfElse"],["oxAutoScroll",""],["class","ox-history-list__item",3,"ngClass","click",4,"ngFor","ngForOf","ngForTrackBy"],[3,"closed","styleClass"],[1,"ox-context-menu--compact"],[3,"click"],["src","assets/images/icons/edit.svg",3,"svgStyle"],[3,"click",4,"ngIf"],[3,"ngTemplateOutlet"],[1,"ox-history-list__item",3,"click","ngClass"],["src","assets/images/icons/code-editor.svg",3,"svgStyle"],[1,"ox-item__name",3,"close","focusOut","id","max","key","value","label"],["class","current",4,"ngIf"],[4,"ngIf"],[1,"ox-history-list__menu-trigger",3,"click"],[1,"current"],[1,"ox-history-list__nonamed"],["src","assets/images/icons/icon-save-version.svg",3,"svgStyle"],["src","assets/images/icons/delete.svg",3,"svgStyle"]]},template:function(o,t){if(1&o){const n=_.RV6();_.j41(0,"section",12)(1,"h1"),_.pXf(2,3),_.k0s(),_.j41(3,"ul",13),_.DNE(4,i_,1,1,"ng-container",14)(5,l_,1,2,"ng-template",null,0,_.C5r),_.k0s(),_.j41(7,"h2"),_.pXf(8,4),_.k0s(),_.j41(9,"ul",15),_.DNE(10,d_,10,13,"li",16),_.k0s()(),_.DNE(11,C_,4,2,"ng-template",null,1,_.C5r),_.j41(13,"ox-overlay-panel",17,2),_.bIt("closed",function(){return _.eBV(n),_.Njj(t.closeMenu())}),_.j41(15,"ul",18)(16,"li",19),_.bIt("click",function(l){return _.eBV(n),_.Njj(t.editNameHandler(l))}),_.nrm(17,"svg-icon",20),_.j41(18,"span"),_.pXf(19,5),_.k0s()(),_.DNE(20,S_,4,2,"li",21),_.k0s()()}if(2&o){const n=_.sdS(6);_.R7$(4),_.Y8G("ngIf",!t.namedList||t.namedList.length<1)("ngIfElse",n),_.R7$(6),_.Y8G("ngForOf",t.automaticList)("ngForTrackBy",t.trackByOid),_.R7$(3),_.Y8G("styleClass","ox-history-list__context-menu"),_.R7$(4),_.Y8G("svgStyle",_.lJ4(7,v)),_.R7$(3),_.Y8G("ngIf",(null==t.currentCCH?null:t.currentCCH.oid)!==(null==t.menuCCH?null:t.menuCCH.oid))}},dependencies:[m.YU,m.Sq,m.bT,m.T3,t_.T,o_.r,w.p,U.DM,m.vh],styles:[".ox-history-list[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;padding:12px 0;background-color:#2a2c30}.ox-history-list[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .ox-history-list[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .ox-history-list[_ngcontent-%COMP%] .ox-history-list__nonamed[_ngcontent-%COMP%]{padding:0 20px}.ox-history-list[_ngcontent-%COMP%] .ox-history-list__nonamed[_ngcontent-%COMP%]{margin-bottom:18px}.ox-history-list[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:0;padding:0;max-height:calc(50% - 125px);min-height:250px}.ox-history-list[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]:first-of-type{border-bottom:solid 1px #3b3d40}.ox-history-list[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .ox-history-list[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-bottom:12px;font-size:15px;font-weight:700;font-stretch:normal;font-style:normal;line-height:1.67;letter-spacing:normal}.ox-history-list[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:11px;font-weight:400;font-stretch:normal;font-style:italic;line-height:1.64;letter-spacing:normal;color:var(--color-gray01);margin:0}.ox-history-list[_ngcontent-%COMP%] p[_ngcontent-%COMP%] svg-icon svg{width:14px;height:14px;margin:0 6px}.ox-history-list__item[_ngcontent-%COMP%]{display:flex;align-items:center;column-gap:6px;width:calc(100% - 40px);height:32px;padding:8px 20px;cursor:pointer}.ox-history-list__item[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;width:calc(100% - 20px);height:100%}.ox-history-list__item[_ngcontent-%COMP%] ox-p-inplace{height:0;opacity:0;z-index:-1}.ox-history-list__item[_ngcontent-%COMP%] ox-p-inplace .ox-p-inplace{height:30px;padding:6px}.ox-history-list__item[_ngcontent-%COMP%]:hover{background-color:#1d1e22}.ox-history-list__item[_ngcontent-%COMP%]:hover .ox-history-list__menu-trigger[_ngcontent-%COMP%]{width:20px}.ox-history-list__item--selected[_ngcontent-%COMP%], .ox-history-list__item--editing[_ngcontent-%COMP%]{background-color:#1d1e22}.ox-history-list__item--editing[_ngcontent-%COMP%] >div>ox-p-inplace{height:100%;opacity:1;z-index:0}.ox-history-list__item--editing[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(ox-p-inplace){display:none}.ox-history-list__item[_ngcontent-%COMP%] .ox-history-list__menu-trigger[_ngcontent-%COMP%]{cursor:pointer;height:35px;width:0px;background:url(/assets/images/icons/kebab-min.svg) no-repeat center center;background-size:15px 15px;position:absolute;right:10px}.ox-history-list__item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-core-white);margin:0;padding:0;font-size:12px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.33;letter-spacing:normal;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ox-history-list__item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:10px;font-weight:400;font-stretch:normal;font-style:italic;line-height:1.4;letter-spacing:normal;color:var(--color-gray01);margin-right:3px}.ox-history-list__item[_ngcontent-%COMP%] span.current[_ngcontent-%COMP%]{font-weight:600;font-style:normal;color:var(--color-core-white)}"]})}}return i})();var b=s(89417),F=s(21841),u_=s(27521),m_=s(49798),G=s(98006);
1const p_=(i,a,e)=>({"ox-columns--collapsed-one":i,"ox-columns--collapsed-two":a,"ox-columns--disabled":e}),j=i=>({"ox-column--collapsed":i}),I_=()=>({enabled:!1}),M_=i=>({theme:"vs-dark",language:"html",automaticLayout:!0,minimap:i}),Y=i=>({code:i,language:"html"}),K=i=>({code:i,language:"css"}),V=i=>({code:i,language:"javascript"});function E_(i,a){if(1&i){const e=_.RV6();_.j41(0,"ngx-monaco-editor",30),_.mxI("ngModelChange",function(t){_.eBV(e);const n=_.XpG();return _.DH7(n.code.html,t)||(n.code.html=t),_.Njj(t)}),_.bIt("onInit",function(t){_.eBV(e);const n=_.XpG();return _.Njj(n.onEditorInit(t,n.TABS.HTML))}),_.k0s()}if(2&i){const e=_.XpG();_.Y8G("options",e.monacoConfig),_.R50("ngModel",e.code.html)}}function h_(i,a){if(1&i&&_.nrm(0,"ngx-monaco-diff-editor",35),2&i){const e=_.XpG();_.Y8G("options",e.monacoDiffConfig)("originalModel",_.eq3(3,Y,e.code.html))("modifiedModel",_.eq3(5,Y,e.modifiedCode.html))}}function T_(i,a){if(1&i){const e=_.RV6();_.j41(0,"ngx-monaco-editor",30),_.mxI("ngModelChange",function(t){_.eBV(e);const n=_.XpG();return _.DH7(n.code.css,t)||(n.code.css=t),_.Njj(t)}),_.bIt("onInit",function(t){_.eBV(e);const n=_.XpG();return _.Njj(n.onEditorInit(t,n.TABS.CSS))}),_.k0s()}if(2&i){const e=_.XpG();_.Y8G("options",e.monacoCSSConfig),_.R50("ngModel",e.code.css)}}function f_(i,a){if(1&i&&_.nrm(0,"ngx-monaco-diff-editor",35),2&i){const e=_.XpG();_.Y8G("options",e.monacoCSSDiffConfig)("originalModel",_.eq3(3,K,e.code.css))("modifiedModel",_.eq3(5,K,e.modifiedCode.css))}}function R_(i,a){if(1&i){const e=_.RV6();_.j41(0,"ngx-monaco-editor",30),_.mxI("ngModelChange",function(t){_.eBV(e);const n=_.XpG();return _.DH7(n.code.js,t)||(n.code.js=t),_.Njj(t)}),_.bIt("onInit",function(t){_.eBV(e);const n=_.XpG();return _.Njj(n.onEditorInit(t,n.TABS.JS))}),_.k0s()}if(2&i){const e=_.XpG();_.Y8G("options",e.monacoJSConfig),_.R50("ngModel",e.code.js)}}function N_(i,a){if(1&i&&_.nrm(0,"ngx-monaco-diff-editor",35),2&i){const e=_.XpG();_.Y8G("options",e.monacoJSDiffConfig)("originalModel",_.eq3(3,V,e.code.js))("modifiedModel",_.eq3(5,V,e.modifiedCode.js))}}var L=function(i){return i[i.HTML=0]="HTML",i[i.CSS=1]="CSS",i[i.JS=2]="JS",i}(L||{});let W=(()=>{class i{constructor(){this.TABS=L,this.collapsed=[!1,!1,!1],this.tabsCollapsed=0,this.monacoConfig={theme:"vs-dark",language:"html",automaticLayout:!0,minimap:{enabled:!1},readOnly:!1},this.monacoJSConfig={language:"javascript",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},readOnly:!1},this.monacoCSSConfig={language:"css",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},readOnly:!1},this.monacoDiffConfig={theme:"vs-dark",language:"html",automaticLayout:!0,minimap:{enabled:!1},enableSplitViewResizing:!1,renderSideBySide:!1,readOnly:!1},this.monacoJSDiffConfig={theme:"vs-dark",language:"javascript",automaticLayout:!0,minimap:{enabled:!1},enableSplitViewResizing:!1,renderSideBySide:!1,readOnly:!1},this.monacoCSSDiffConfig={theme:"vs-dark",language:"css",automaticLayout:!0,minimap:{enabled:!1},enableSplitViewResizing:!1,renderSideBySide:!1,readOnly:!1},this.styleClass="",this.canEdit=!0,this.onChange=new _.bkB,this.onInitialize=new _.bkB}set readonly(e){this.monacoConfig={theme:"vs-dark",language:"html",automaticLayout:!0,minimap:{enabled:!1},readOnly:e},this.monacoJSConfig={language:"javascript",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},readOnly:e},this.monacoCSSConfig={language:"css",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},readOnly:e},this.monacoDiffConfig={theme:"vs-dark",language:"html",automaticLayout:!0,minimap:{enabled:!1},enableSplitViewResizing:!1,renderSideBySide:!1,readOnly:e},this.monacoJSDiffConfig={theme:"vs-dark",language:"javascript",automaticLayout:!0,minimap:{enabled:!1},enableSplitViewResizing:!1,renderSideBySide:!1,readOnly:e},this.monacoCSSDiffConfig={theme:"vs-dark",language:"css",automaticLayout:!0,minimap:{enabled:!1},enableSplitViewResizing:!1,renderSideBySide:!1,readOnly:e}}collapseHandler(e){this.collapsed[e]=!0,this.tabsCollapsed++,this.forceEditorResize()}restoreHandler(e){this.collapsed[e]=!1,this.tabsCollapsed--,this.forceEditorResize()}maximizeHandler(e){if(2!==this.tabsCollapsed||this.collapsed[e]){for(let o=0;o<this.collapsed.length;o++)this.collapsed[o]=o!==e;this.tabsCollapsed=2}else{for(let o=0;o<this.collapsed.length;o++)this.collapsed[o]=!1;this.tabsCollapsed=0}this.forceEditorResize()}forceEditorResize(){setTimeout(()=>window.dispatchEvent(new Event("resize")),0)}onEditorInit(e,o){const t=o;e.onDidChangeModelContent(n=>{const c=n.changes[0].text;if(!this.changed&&this.project)if(this.project.customCode)switch(t){case L.HTML:this.changed=this.changed||c!==this.project.customCode.html;break;case L.CSS:this.changed=this.changed||c!==this.project.customCode.css;break;case L.JS:this.changed=this.changed||c!==this.project.customCode.js}else this.changed=!0;this.changed&&this.onChange.emit(this.code)}),this.onInitialize.emit(e)}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=_.VBU({type:i,selectors:[["ox-monaco-columns"]],inputs:{styleClass:"styleClass",project:"project",code:"code",modifiedCode:"modifiedCode",enableCompareMode:"enableCompareMode",canEdit:"canEdit",readonly:"readonly"},outputs:{onChange:"onChange",onInitialize:"onInitialize"},decls:88,vars:28,consts:()=>{let e,o,t,n,c,l,h,R,N,g,H,D,z,J,Q,Z,q,__,e_;return e="HTML",o="HTML",t=" This HTML code will be inserted in a div with ID " + "\ufffd#12\ufffd" + "'injection-root'" + "\ufffd/#12\ufffd" + " at the end of component's body. ",n=" HTML injection allows to create custom HTML elements on top of the experience. ",c="Here you can access some of our code samples:",l="Important!",h=" Make sure you " + "\ufffd#26\ufffd" + "use absolute positioning" + "\ufffd/#26\ufffd" + " or your new elements won't display correctly. ",R="CSS",N="CSS",g=" These CSS rules will apply both for the existing HTML elements when using WebAR and for the new ones created with HTML injection. ",H="Here you can access some of our code samples:",D="JS",z="JS",J=" This Javascript block will be evaluated before the experience loads. ",Q=" You may add any scripting code that interact with your HTML injected elements, analytics tracking, external service calls and other. ",Z="Here you can access some of our code samples:",q="Warning!",__=" You are responsible for the code you write. ",e_=" Any harmful of malicious code detected will be reported and cause your account to be banned indefinitely. ",[e,o,t,n,c,l,h,R,N,g,H,D,z,J,Q,Z,q,__,e_,[3,"ngClass"],[1,"ox-column",3,"ngClass"],[1,"ox-column__title",3,"dblclick"],[1,"ng-dialog-tooltip-header"],[1,"ng-dialog-tooltip-content"],["href","https://docs.onirix.com/onirix-player/online-code-editor#code-snippets","target","_blank"],[1,"ng-dialog-tooltip-messages"],[1,"ox-message","ox-message--info"],["src","assets/images/icons/icon-minimize.svg",1,"ox-collapse",3,"click"],["src","assets/images/icons/icon-open-tab.svg",1,"ox-restore",3,"click"],["src","assets/images/icons/icon-maximize.svg",3,"click"],[3,"ngModelChange","onInit","o
1ptions","ngModel"],[3,"options","ngModel","ngModelChange","onInit",4,"ngIf"],[3,"options","originalModel","modifiedModel",4,"ngIf"],["href","https://docs.onirix.com/onirix-player/online-code-editor#customizing-ui","target","_blank"],[1,"ox-message","ox-message--warning"],[3,"options","originalModel","modifiedModel"]]},template:function(o,t){1&o&&(_.j41(0,"div",19)(1,"div",20)(2,"div",21),_.bIt("dblclick",function(){return t.maximizeHandler(t.TABS.HTML)}),_.j41(3,"span"),_.pXf(4,0),_.k0s(),_.j41(5,"ox-dialog-tooltip"),_.qex(6,22),_.j41(7,"h1"),_.pXf(8,1),_.k0s(),_.bVm(),_.qex(9,23),_.j41(10,"p"),_.PLo(11,2),_.nrm(12,"b"),_.YFu(),_.k0s(),_.j41(13,"p"),_.pXf(14,3),_.k0s(),_.j41(15,"p"),_.pXf(16,4),_.k0s(),_.j41(17,"p")(18,"a",24),_.EFF(19,"https://docs.onirix.com/onirix-player/online-code-editor#code-snippets"),_.k0s()(),_.bVm(),_.qex(20,25),_.j41(21,"div",26)(22,"h2"),_.pXf(23,5),_.k0s(),_.j41(24,"p"),_.PLo(25,6),_.nrm(26,"b"),_.YFu(),_.k0s()(),_.bVm(),_.k0s(),_.j41(27,"div")(28,"svg-icon",27),_.bIt("click",function(){return t.collapseHandler(t.TABS.HTML)}),_.k0s(),_.j41(29,"svg-icon",28),_.bIt("click",function(){return t.restoreHandler(t.TABS.HTML)}),_.k0s(),_.j41(30,"svg-icon",29),_.bIt("click",function(){return t.maximizeHandler(t.TABS.HTML)}),_.k0s()()(),_.j41(31,"ngx-monaco-editor",30),_.mxI("ngModelChange",function(c){return _.DH7(t.code.html,c)||(t.code.html=c),c}),_.bIt("onInit",function(c){return t.onEditorInit(c,t.TABS.HTML)}),_.k0s(),_.DNE(32,E_,1,2,"ngx-monaco-editor",31)(33,h_,1,7,"ngx-monaco-diff-editor",32),_.k0s(),_.j41(34,"div",20)(35,"div",21),_.bIt("dblclick",function(){return t.maximizeHandler(t.TABS.CSS)}),_.j41(36,"span"),_.pXf(37,7),_.k0s(),_.j41(38,"ox-dialog-tooltip"),_.qex(39,22),_.j41(40,"h1"),_.pXf(41,8),_.k0s(),_.bVm(),_.qex(42,23),_.j41(43,"p"),_.pXf(44,9),_.k0s(),_.j41(45,"p"),_.pXf(46,10),_.k0s(),_.j41(47,"p")(48,"a",33),_.EFF(49,"https://docs.onirix.com/onirix-player/online-code-editor#customizing-ui"),_.k0s()(),_.bVm(),_.k0s(),_.j41(50,"div")(51,"svg-icon",27),_.bIt("click",function(){return t.collapseHandler(t.TABS.CSS)}),_.k0s(),_.j41(52,"svg-icon",28),_.bIt("click",function(){return t.restoreHandler(t.TABS.CSS)}),_.k0s(),_.j41(53,"svg-icon",29),_.bIt("click",function(){return t.maximizeHandler(t.TABS.CSS)}),_.k0s()()(),_.DNE(54,T_,1,2,"ngx-monaco-editor",31)(55,f_,1,7,"ngx-monaco-diff-editor",32),_.k0s(),_.j41(56,"div",20)(57,"div",21),_.bIt("dblclick",function(){return t.maximizeHandler(t.TABS.JS)}),_.j41(58,"span"),_.pXf(59,11),_.k0s(),_.j41(60,"ox-dialog-tooltip"),_.qex(61,22),_.j41(62,"h1"),_.pXf(63,12),_.k0s(),_.bVm(),_.qex(64,23),_.j41(65,"p"),_.pXf(66,13),_.k0s(),_.j41(67,"p"),_.pXf(68,14),_.k0s(),_.j41(69,"p"),_.pXf(70,15),_.k0s(),_.j41(71,"p")(72,"a",24),_.EFF(73,"https://docs.onirix.com/onirix-player/online-code-editor#code-snippets"),_.k0s()(),_.bVm(),_.qex(74,25),_.j41(75,"div",34)(76,"h2"),_.pXf(77,16),_.k0s(),_.j41(78,"p"),_.pXf(79,17),_.k0s(),_.j41(80,"p"),_.pXf(81,18),_.k0s()(),_.bVm(),_.k0s(),_.j41(82,"div")(83,"svg-icon",27),_.bIt("click",function(){return t.collapseHandler(t.TABS.JS)}),_.k0s(),_.j41(84,"svg-icon",28),_.bIt("click",function(){return t.restoreHandler(t.TABS.JS)}),_.k0s(),_.j41(85,"svg-icon",29),_.bIt("click",function(){return t.maximizeHandler(t.TABS.JS)}),_.k0s()()(),_.DNE(86,R_,1,2,"ngx-monaco-editor",31)(87,N_,1,7,"ngx-monaco-diff-editor",32),_.k0s()()),2&o&&(_.ZvI("ox-columns ",t.styleClass,""),_.Y8G("ngClass",_.sMw(15,p_,1==t.tabsCollapsed,2==t.tabsCollapsed,!t.canEdit)),_.R7$(),_.Y8G("ngClass",_.eq3(19,j,t.collapsed[t.TABS.HTML])),_.R7$(30),_.Y8G("options",_.eq3(22,M_,_.lJ4(21,I_))),_.R50("ngModel",t.code.html),_.R7$(),_.Y8G("ngIf",!t.enableCompareMode),_.R7$(),_.Y8G("ngIf",t.enableCompareMode),_.R7$(),_.Y8G("ngClass",_.eq3(24,j,t.collapsed[t.TABS.CSS])),_.R7$(20),_.Y8G("ngIf",!t.enableCompareMode),_.R7$(),_.Y8G("ngIf",t.enableCompareMode),_.R7$(),_.Y8G("ngClass",_.eq3(26,j,t.collapsed[t.TABS.JS])),_.R7$(30),_.Y8G("ngIf",!t.enableCompareMode),_.R7$(),_.Y8G("ngIf",t.enableCompareMode))},dependencies:[m.YU,m.bT,b.BC,b.vS,m_.Y,U.DM,G.xn,G.qB],styles:[".ox-columns[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.ox-columns[_ngcontent-%COMP%]{width:100%}.ox-columns--disabled[_ngcontent-%COMP%]{pointer-events:none}.ox-columns.ox-columns--collapsed-one[_ngcontent-%COMP%] .ox-column[_ngcontent-%COMP%]{width:calc((100% - 35px)/2)}.ox-columns.ox-columns--collapsed-two[_ngcontent-%COMP%] .ox-column[_ngcontent-%COMP%]{width:calc(100% - 70px)}.ox-columns.ox-columns--collapsed-two[_ngcontent-%COMP%] .ox-column[_ngcontent-%COMP%]:not(.ox-column--collapsed) .ox-column__title[_ngcontent-%COMP%] svg-icon[_ngcontent-%COMP%]{opacity:.5;pointer-events:none;cursor:default}.ox-column[_ngcontent-%COMP%]{flex-grow:1;flex-shrink:1;width:33.3333333333%;height:calc(100vh - 50px)}.ox-column[_ngcontent-%COMP%]:not(:first-child){border-left:4px solid #3b3d40}.ox-column__title[_ngcontent-%COMP%]{display:flex;align-items:center;background:#2a2c30;font-size:15px;color:var(--color-core-white);font-family:var(--font-secondary);font-weight:700;padding-left:20px;margin:0;height:35px;cursor:pointer}.ox-column__title[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin-left:auto;display:flex;align-items:center}.ox-column__title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{margin-right:10px}.ox-column__title[_ngcontent-%COMP%] .ox-restore[_ngcontent-%COMP%]{display:none}.ox-column__title[_ngcontent-%COMP%] .ox-collapse[_ngcontent-%COMP%]{display:block}.ox-column[_ngcontent-%COMP%] ngx-monaco-editor, .ox-column[_ngcontent-%COMP%] ngx-monaco-diff-editor{height:calc(100vh - 85px)}.ox-column[_ngcontent-%COMP%] ngx-monaco-editor monaco-editor, .ox-column[_ngcontent-%COMP%] ngx-monaco-editor .editor-container, .ox-column[_ngcontent-%COMP%] ngx-monaco-diff-editor monaco-editor, .ox-column[_ngcontent-%COMP%] ngx-monaco-diff-editor .editor-container{height:100%}.ox-column.ox-column--collapsed[_ngcontent-%COMP%]{width:35px!important}.ox-column.ox-column--collapsed[_ngcontent-%COMP%] .ox-column__title[_ngcontent-%COMP%]{height:calc(100% - 12px);flex-direction:column;justify-content:flex-start;gap:20px;padding:12px 0 0}.ox-column.ox-column--collapsed[_ngcontent-%COMP%] .ox-column__title[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin:0;writing-mode:vertical-rl;min-height:40px}.ox-column.ox-column--collapsed[_ngcontent-%COMP%] .ox-column__title[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{flex-direction:column}.ox-column.ox-column--collapsed[_ngcontent-%COMP%] .ox-column__title[_ngcontent-%COMP%] .ox-restore[_ngcontent-%COMP%]{display:block}.ox-column.ox-column--collapsed[_ngcontent-%COMP%] .ox-column__title[_ngcontent-%COMP%] .ox-collapse[_ngcontent-%COMP%]{display:none}.ox-column.ox-column--collapsed[_ngcontent-%COMP%] .ox-column__title[_ngcontent-%COMP%] svg-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:35px}"]})}}return i})();const D_=["OxCodeHistoryList"],x_=()=>({"width.px":20,"height.px":20}),P_=()=>({"width.px":16,"height.px":16});function X_(i,a){if(1&i){const e=_.RV6();_.j41(0,"ox-button",17),_.bIt("onClick",function(){_.eBV(e);const t=_.XpG();return _.Njj(t.restoreVersion())}),_.k0s()}}let y_=(()=>{class i extends p.${constructor(e,o,t,n,c,l,h){super(),this.projectManager=e,this.messagesManager=o,this.i18n=t,this.customCodeService=n,this.dialogManager=c,this.memberService=l,this.statusManager=h,this.code=new C,this.close=new _.bkB}loadProps(e){var o=this;return(0,r.A)(function*(){o.code=Object.assign(new C,e.customCode),o.customCodeHistory=e.customCodeHistory,o.project=e.project,o.selectedCCH=e.selectedCCH,o.currentAuthor=o.statusManager.userStatus$.value?.user.name,o.memberService.loggedMember.pipe((0,T.Q)(o.destroy$)).subscribe(t=>{const n=o.memberService.loggedMember.value;n&&(o.currentAuthor=n.name)}),yield o.getCodeHistoryList()})()}getCodeHistoryList(){var e=this;return(0,r.A)(function*(){e.cchList=yield(0,S.s)(e.customCodeService.getAllCustomCodeHistory(e.project.oid)),e.cchList.sort((o,t)=>new Date(t.timestamp).getTime()-new Date(o.timestamp).getTime())})()}restoreVersion(e=!0){var o=this;return(0,r.A)(function*(){o.dialogManager.showConfirmDialog(o.i18n.isSpanish?"\xbfQuieres restaurar esta versi\xf3n?":"Do you want to restore this version?",o.i18n.isSpanish?`Tu c\xf3digo actual ser\xe1 cambiado a la versi\xf3n ${o.selectedCCH.name}`:`Your current code will be changed to version ${o.selectedCCH.name}`,o.i18n.isSpanish?"Restaurar":"Restore",o.i18n.isSpanish?"Cancelar":"Cancel").then(t=>{t&&o.saveVersion(e)})})()}saveVersion(e=!0){var o=this;return(0,r.A)(function*(){try{if(o.selectedCCH.isAutomatic){const t=Object.assign(new O,o.selectedCCH);t.isAutomatic=!1,delete t.oid,o.code=yield(0,S.s)(o.customCodeService.createCustomCodeHistory(o.project.oid,t)),o.customCodeHistory=yield(0,S.s)(o.customCodeService.getCustomCodeHistory(o.project.oid,o.code.oid)
1)}else o.code=new C,o.code.html=o.selectedCCH.html,o.code.css=o.selectedCCH.css,o.code.js=o.selectedCCH.js,o.code.oid=o.selectedCCH.oid,o.code=yield o.projectManager.saveCustomCode(o.project,o.code),o.customCodeHistory=o.selectedCCH;e&&o.messagesManager.notify({severity:"success",summary:null,detail:o.i18n.isSpanish?"El c\xf3digo fue restaurado correctamente":"Code was restored successfully"}),o.hasChanged=!0,o.closeComponent()}catch{o.messagesManager.notify({severity:"error",summary:null,detail:o.i18n.isSpanish?"Ocurri\xf3 un error al intentar guardar el c\xf3digo":"An error occurred while saving the code"})}})()}saveAsVersion(){var e=this;return(0,r.A)(function*(){if(!e.selectedCCH||!e.selectedCCH.isAutomatic)return;e.isComparing=!1;const o=new O;o.css=e.selectedCCH.css,o.html=e.selectedCCH.html,o.js=e.selectedCCH.js,o.isAutomatic=!1,o.name="V1";try{e.code=yield(0,S.s)(e.customCodeService.createCustomCodeHistory(e.project.oid,o)),yield e.getCodeHistoryList(),e.customCodeHistory=e.cchList.find(t=>t.oid===e.code.oid),e.hasChanged=!0,e.historyList.setNextEdit(e.code.oid)}catch(t){e.messagesManager.notifyStudioError(t)}})()}editName(e){var o=this;return(0,r.A)(function*(){try{let t=o.cchList.find(n=>n.oid===e.oid);t.author=o.currentAuthor,t.name=e.name,t=yield(0,S.s)(o.customCodeService.updateCustomCodeHistory(o.project.oid,t))}catch(t){o.messagesManager.notifyStudioError(t)}})()}deleteVersion(e){var o=this;return(0,r.A)(function*(){try{yield(0,S.s)(o.customCodeService.deleteCustomCodeHistory(o.project.oid,e.oid))}catch(t){o.messagesManager.notifyStudioError(t)}finally{yield o.getCodeHistoryList()}})()}onSelectCCH(e){this.selectedCCH=e,this.isComparing||(this.code.css=e.css,this.code.html=e.html,this.code.js=e.js)}toggleComparison(){this.isComparing?(this.code.css=this.customCodeHistory.css,this.code.html=this.customCodeHistory.html,this.code.js=this.customCodeHistory.js):this.selectedCCH&&this.onSelectCCH(this.selectedCCH)}closeComponent(){this.close.emit({code:this.code,cch:this.customCodeHistory,changed:this.hasChanged})}onKeyDown(e){e.stopPropagation(),"Escape"==e.key&&this.closeComponent()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(o){return new(o||i)(_.rXU(X.f),_.rXU(P.q),_.rXU(f.S),_.rXU(u.c),_.rXU(k.K),_.rXU(I.G),_.rXU(y.ON))}}static{this.\u0275cmp=_.VBU({type:i,selectors:[["ox-code-history"]],viewQuery:function(o,t){if(1&o&&_.GBs(D_,5),2&o){let n;_.mGM(n=_.lsd())&&(t.historyList=n.first)}},hostBindings:function(o,t){1&o&&_.bIt("keydown",function(c){return t.onKeyDown(c)})},features:[_.Vt3],decls:20,vars:16,consts:()=>{let e,o,t,n;return e="Restore this version",o="Back to Code Editor",t="Compare selection with current",n="" + "\ufffd#14\ufffd" + "" + "\ufffd/#14\ufffd" + " Save as a version ",[["OxCodeHistoryList",""],o,t,n,[1,"ox-layout"],[1,"ox-top-bar"],[1,"ox-top-bar-block","ox-top-bar-block--click",3,"click"],["src","assets/images/icons/icon-back-white.svg"],["src","assets/images/icons/code-editor.svg",3,"svgStyle"],["label",e,"class","ox-button","styleClass","secondary-white--reverse",3,"onClick",4,"ngIf"],[1,"ox-top-bar-block","ox-top-bar-block--right"],[3,"ngModelChange","onChange","ngModel","disabled"],[1,"ox-close-button","ox-top-bar-block",3,"click"],["src","assets/images/icons/icon-save-version.svg",3,"svgStyle"],[1,"ox-columns-wrapper"],[3,"readonly","modifiedCode","code","project","enableCompareMode"],[3,"selectCCH","onEdit","onDelete","cchList","selectedCCH","project","currentCCH"],["label",e,"styleClass","secondary-white--reverse",1,"ox-button",3,"onClick"]]},template:function(o,t){if(1&o){const n=_.RV6();_.j41(0,"div",4)(1,"div",5)(2,"a",6),_.bIt("click",function(){return _.eBV(n),_.Njj(t.closeComponent())}),_.nrm(3,"svg-icon",7)(4,"svg-icon",8),_.j41(5,"h1"),_.pXf(6,1),_.k0s()(),_.DNE(7,X_,1,0,"ox-button",9),_.j41(8,"div",10)(9,"label"),_.pXf(10,2),_.k0s(),_.j41(11,"ox-inputSwitch",11),_.mxI("ngModelChange",function(l){return _.eBV(n),_.DH7(t.isComparing,l)||(t.isComparing=l),_.Njj(l)}),_.bIt("onChange",function(){return _.eBV(n),_.Njj(t.toggleComparison())}),_.k0s(),_.j41(12,"a",12),_.bIt("click",function(){return _.eBV(n),_.Njj(t.saveAsVersion())}),_.PLo(13,3),_.nrm(14,"svg-icon",13),_.YFu(),_.k0s()()(),_.j41(15,"div",14),_.nrm(16,"ox-monaco-columns",15),_.k0s(),_.j41(17,"aside")(18,"ox-history-list",16,0),_.bIt("selectCC
1H",function(l){return _.eBV(n),_.Njj(t.onSelectCCH(l))})("onEdit",function(l){return _.eBV(n),_.Njj(t.editName(l))})("onDelete",function(l){return _.eBV(n),_.Njj(t.deleteVersion(l))}),_.k0s()()()}2&o&&(_.R7$(4),_.Y8G("svgStyle",_.lJ4(14,x_)),_.R7$(3),_.Y8G("ngIf",t.selectedCCH&&t.selectedCCH.oid!==t.customCodeHistory.oid),_.R7$(4),_.R50("ngModel",t.isComparing),_.Y8G("disabled",!t.selectedCCH||t.selectedCCH.oid==t.customCodeHistory.oid),_.R7$(3),_.Y8G("svgStyle",_.lJ4(15,P_)),_.R7$(2),_.Y8G("readonly",!0)("modifiedCode",t.selectedCCH)("code",t.code)("project",t.project)("enableCompareMode",t.isComparing),_.R7$(2),_.Y8G("cchList",t.cchList)("selectedCCH",t.selectedCCH)("project",t.project)("currentCCH",t.customCodeHistory))},dependencies:[m.bT,b.BC,b.vS,F.f,u_.r,U.DM,g_,W],styles:[".ox-layout[_ngcontent-%COMP%]{height:100vh;width:100vw;background:#3b3d40;color:var(--color-core-white);overflow:hidden;position:absolute;z-index:7;top:0;left:0;display:grid;grid-template-columns:calc(100% - 253px) 253px;grid-template-rows:50px calc(100% - 50px)}.ox-top-bar[_ngcontent-%COMP%]{display:flex;align-items:center;background:var(--color-core-dark01);padding:10px 20px;grid-column-start:1;grid-column-end:2;grid-row-start:1;grid-row-end:2}.ox-top-bar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:14px;font-weight:700;font-stretch:normal;font-style:normal;line-height:1.14;letter-spacing:normal;margin-left:10px;color:var(--color-core-white)}.ox-top-bar[_ngcontent-%COMP%] svg-icon[_ngcontent-%COMP%]:nth-child(2){margin-left:4px}.ox-top-bar[_ngcontent-%COMP%] ox-button button{width:176px;height:32px;border-radius:8px}.ox-top-bar-block[_ngcontent-%COMP%]{display:flex;align-items:center}.ox-top-bar-block--click[_ngcontent-%COMP%]{cursor:pointer;margin-right:20px}.ox-top-bar-block--right[_ngcontent-%COMP%]{margin-left:auto}.ox-top-bar-block--right[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{margin-right:6px;font-size:13px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.38;letter-spacing:normal;color:var(--color-core-white)}.ox-top-bar-block--right[_ngcontent-%COMP%] svg-icon svg{width:16px;height:16px;margin-right:6px}.ox-top-bar-block--right[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:flex;align-items:center;color:var(--color-core-white);font-size:13px;font-weight:600;line-height:1.38}.ox-top-bar-block--right[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:last-child{margin-left:20px}aside[_ngcontent-%COMP%]{width:253px;height:100vh;grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3;border-left:#3b3d40 solid 3px}.ox-columns-wrapper[_ngcontent-%COMP%]{width:100%;grid-column-start:1;grid-column-end:2;grid-row-start:2;grid-row-end:3}"]})}}return i})();var A_=s(7786),L_=s(76457);const U_=i=>({"ox-layout--injected":i}),v_=()=>({"width.px":20,"height.px":20}),b_=(i,a)=>({"ox-top-bar-block--readonly":i,"ox-top-bar-block--newtab":a});function H_(i,a){if(1&i){const e=_.RV6();_.j41(0,"a",13),_.bIt("click",function(){_.eBV(e);const t=_.XpG();return _.Njj(t.openInNewTab())}),_.nrm(1,"svg-icon",14),_.k0s()}}let j_=(()=>{class i extends p.${constructor(e,o,t,n,c,l,h,R,N,g,H){super(),this.projectService=e,this.projectManager=o,this.messagesManager=t,this.i18n=n,this.dialogManager=c,this.analyticsService=l,this.route=h,this.memberService=R,this.statusManager=N,this.customCodeService=g,this.oxInjectionManager=H,this.code=new C,this.canEdit=!0,this.close=new _.bkB,this.route.params.pipe((0,T.Q)(this.destroy$)).subscribe(D=>{(!this.project||this.project.oid!==D.projectOid)&&this.getProject(D.projectOid)}),this.route.queryParams.pipe((0,T.Q)(this.destroy$)).subscribe(D=>{this.isNewTab=D.newTab})}ngOnInit(){this.statusManager.updateStatus(this.statusManager.userStatus$.value),this.memberService.loggedMember.pipe((0,T.Q)(this.destroy$)).subscribe(e=>{const o=this.memberService.loggedMember.value;this.canEdit=!o||o.permissions.sceneUpdate})}loadProps(e){this.isNewTab=!1,this.getProject(e.project.oid)}getProject(e){var o=this;return(0,r.A)(function*(){if(null!=e)try{yield o.getProjectAndCodes(e)}catch(t){o.messagesManager.notify({severity:"error",summary:t.error.messages[0]})}finally{o.analyticsService.sendEvent(E.c.PROJECT_CODE_EDITOR_OPEN,{oid:e,name:o.project?o.project.name:""}),o.changed=!1}})()}getProjectAndCodes(e){var o=this;return(0,r.A)(function*(){o.project=yield(0,S.s)(o.projectService.getProject(e,{withCode:!0}));const t=yield(0,S.s)(o.customCodeService.getCustomCode(e));null!=t&&(o.project.customCode=t,o.code=Object.assign(new C,t),o.customCodeHistory=yield(0,S.s)(o.customCodeService.getCustomCodeHistory(e,t.oid)),o.startAutomaticSaveInterval())})()}saveCustomCode(e=!0){var o=this;return(0,r.A)(function*(){try{if(o.stopAutomaticSaveInterval(),o.project.customCode)o.code=yield o.projectManager.saveCustomCode(o.project,o.code);else{const t=new O;t.css=o.code.css,t.html=o.code.html,t.js=o.code.js,t.isAutomatic=!1,t.name="V1";const n=yield(0,S.s)(o.customCodeService.createCustomCodeHistory(o.project.oid,t));o.code=Object.assign(new C,n),o.project.customCode=Object.assign(new C,o.code)}o.customCodeHistory=yield(0,S.s)(o.customCodeService.getCustomCodeHistory(o.project.oid,o.code.oid)
1),o.changed=!1,e&&o.messagesManager.notify({severity:"success",summary:null,detail:o.i18n.isSpanish?"El c\xf3digo fue guardado correctamente":"Code was saved successfully"})}catch{o.messagesManager.notify({severity:"error",summary:null,detail:o.i18n.isSpanish?"Ocurri\xf3 un error al intentar guardar el c\xf3digo":"An error occurred while saving the code"})}finally{o.startAutomaticSaveInterval()}})()}startAutomaticSaveInterval(){var e=this;this.stopAutomaticSaveInterval(),this.automaticSaveInterval=setInterval((0,r.A)(function*(){e.changed&&(yield e.createAutomaticCopy())}),3e5)}stopAutomaticSaveInterval(){this.automaticSaveInterval&&(clearInterval(this.automaticSaveInterval),this.automaticSaveInterval=null)}createAutomaticCopy(){var e=this;return(0,r.A)(function*(){try{let o=new O;return o.css=e.code.css,o.html=e.code.html,o.js=e.code.js,o.isAutomatic=!0,o=yield(0,S.s)(e.customCodeService.createCustomCodeHistory(e.project.oid,o)),(!e.customCodeHistory||e.customCodeHistory.isAutomatic)&&(e.customCodeHistory=o,e.code.oid=e.customCodeHistory.oid),o}catch(o){console.error(`Error generating automatic copy of Custom Code: ${o}`)}})()}closeComponent(){var e=this;return(0,r.A)(function*(){return!(e.changed&&!(yield e.dialogManager.showConfirmDialog(e.i18n.isSpanish?"Cambios no guardados":"Unsaved changes",e.i18n.isSpanish?"Existen cambios sin guardar. \xbfQuieres continuar de todos modos?":"There are unsaved changes. Do you want to continue?",e.i18n.isSpanish?"Continuar":"Continue",e.i18n.isSpanish?"Cancelar":"Cancel"))||(e.analyticsService.sendEvent(E.c.PROJECT_CODE_EDITOR_CLOSE,{oid:e.project.oid,name:e.project.name}),e.isNewTab?window.close():e.close.emit(e.project),0))})()}onDocumentKeyDown(e){"Escape"==e.key&&this.closeComponent(),(e.ctrlKey||e.metaKey)&&("s"===e.key||83===e.keyCode)&&(e.preventDefault(),this.changed&&this.saveCustomCode()),e.stopPropagation()}onKeyDown(e){e.stopPropagation(),"Escape"==e.key&&this.closeComponent()}onEditorInit(e){e.addCommand(window.monaco.KeyMod.CtrlCmd|window.monaco.KeyCode.KeyS,()=>{this.changed&&this.saveCustomCode()})}onCodeChange(){this.changed=!0}openCCHistory(){var e=this;return(0,r.A)(function*(){e.stopAutomaticSaveInterval(),console.log(e.code);const o=yield e.oxInjectionManager.injectComponent(y_,{project:e.project,customCode:e.code,customCodeHistory:e.customCodeHistory,selectedCCH:e.changed?yield e.createAutomaticCopy():void 0});!0===o.changed&&(e.code=o.code,e.customCodeHistory=o.cch,e.changed=!1),console.log(e.code),e.startAutomaticSaveInterval()})()}openInNewTab(){var e=this;return(0,r.A)(function*(){(yield e.closeComponent())&&window.open(document.location.origin+`/projects/${e.project.oid}/codeeditor?newTab=true`,"_blank")})()}ngOnDestroy(){this.stopAutomaticSaveInterval(),this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(o){return new(o||i)(_.rXU(M.T),_.rXU(X.f),_.rXU(P.q),_.rXU(f.S),_.rXU(k.K),_.rXU(A.c),_.rXU(A_.nX),_.rXU(I.G),_.rXU(y.ON),_.rXU(u.c),_.rXU(L_.K))}}static{this.\u0275cmp=_.VBU({type:i,selectors:[["ox-code-editor"]],hostBindings:function(o,t){1&o&&_.bIt("keydown",function(c){return t.onDocumentKeyDown(c)},!1,_.EBC)("keydown",function(c){return t.onKeyDown(c)})},features:[_.Vt3],decls:15,vars:14,consts:()=>{let e,o,t,n,c;return e="Open in new tab",o="Save",t="Custom Code History",n="Close",c="Code Editor",[c,[1,"ox-layout",3,"ngClass"],[1,"ox-top-bar"],[1,"ox-top-bar-block"],["src","assets/images/icons/code-editor.svg",3,"svgStyle"],[1,"ox-top-bar-block","ox-top-bar-block--right",3,"ngClass"],["title",e,3,"click",4,"ngIf"],["label",o,"styleClass","secondary-white--reverse",1,"ox-button",3,"onClick","disabled"],["title",t,1,"custom-code-list-button",3,"click"],["src","assets/images/icons/icons-general-versions.svg"],["title",n,1,"ox-close-button","ox-top-bar-block",3,"click"],["src","assets/images/icons/close-white.svg"],[3,"onChange","onInitialize","canEdit","code","project"],["title",e,3,"click"],["src","assets/images/icons/icons-new-tab.svg"]]},template:function(o,t){1&o&&(_.j41(0,"div",1)(1,"div",2)(2,"div",3),_.nrm(3,"svg-icon",4),_.j41(4,"h1"),_.pXf(5,0),_.k0s()(),_.j41(6,"div",5),_.DNE(7,H_,2,0,"a",6),_.j41(8,"ox-button",7),_.bIt("onClick",function(){return t.saveCustomCode()}),_.k0s(),_.j41(9,"a",8),_.bIt("click",function(){return t.openCCHistory()}),_.nrm(10,"svg-icon",9),_.k0s(),_.j41(11,"a",10),_.bIt("click",function(){return t.closeComponent()}),_.nrm(12,"svg-icon",11),_.k0s()()(),_.j41(13,"div")(14,"ox-monaco-columns",12),_.bIt("onChange",function(){return t.onCodeChange()})("onInitialize",function(c){return t.onEditorInit(c)}),_.k0s()()()),2&o&&(_.Y8G("ngClass",_.eq3(8,U_,!t.isNewTab)),_.R7$(3),_.Y8G("svgStyle",_.lJ4(10,v_)),_.R7$(3),_.Y8G("ngClass",_.l_i(11,b_,!t.canEdit,t.isNewTab)),_.R7$(),_.Y8G("ngIf",!t.isNewTab),_.R7$(),_.Y8G("disabled",!t.changed),_.R7$(6),_.Y8G("canEdit",t.canEdit)("code",t.code)("project",t.project))},dependencies:[m.YU,m.bT,F.f,U.DM,W],styles:[".ox-layout[_ngcontent-%COMP%]{height:100vh;width:100vw;background:#3b3d40;color:var(--color-core-white);overflow:hidden}.ox-layout.ox-layout--injected[_ngcontent-%COMP%]{position:absolute;z-index:6;top:0;left:0}
1.ox-top-bar[_ngcontent-%COMP%], .ox-top-bar-block[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.ox-top-bar-block[_ngcontent-%COMP%]{align-items:center}.ox-top-bar-block--right[_ngcontent-%COMP%] ox-button button{width:72px;height:30px;padding:6px 18.5px}.ox-top-bar-block--right[_ngcontent-%COMP%] svg-icon svg{width:20px;height:20px}.ox-top-bar-block--right[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{height:24px;display:flex;align-items:center}.ox-top-bar-block--right[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:first-child{padding-right:20px;margin-right:20px;border-right:1px solid rgba(242,241,243,.1490196078)}.ox-top-bar-block--right[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:last-child{padding-left:20px;margin-left:20px;border-left:1px solid rgba(242,241,243,.1490196078)}.ox-top-bar-block--readonly[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:first-child{padding-right:0;margin-right:0}.ox-top-bar-block--readonly[_ngcontent-%COMP%] ox-button{display:none}.ox-top-bar-block--newtab.ox-top-bar-block--readonly[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding-left:0;margin-left:0}.ox-top-bar[_ngcontent-%COMP%]{background:var(--color-core-dark02);padding:10px 20px}.ox-top-bar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:14px;font-weight:700;line-height:16px;margin:0 0 0 10px}
1.ox-top-bar[_ngcontent-%COMP%] svg-icon svg path{fill:var(--color-core-white)}.custom-code-list-button[_ngcontent-%COMP%]{width:24px;height:24px;margin-left:14px;margin-right:-6px}.custom-code-list-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:24px;height:24px}"]})}}return i})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.