{"version":3,"file":"c8y-ngx-components-translation-editor.mjs","sources":["../../translation-editor/translation-editor-naviagtor-factory.service.ts","../../translation-editor/translation-editor.constants.ts","../../translation-editor/translation-editor-tab-factory.service.ts","../../translation-editor/index.ts","../../translation-editor/c8y-ngx-components-translation-editor.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ExtensionFactory, NavigatorNode, Permissions } from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class TranslationEditorNaviagtorFactoryService implements ExtensionFactory<NavigatorNode> {\n  private node = new NavigatorNode({\n    icon: 'language1',\n    label: gettext('Localization'),\n    parent: 'Settings',\n    path: 'localization'\n  });\n\n  constructor(private permissions: Permissions) {}\n\n  get(): NavigatorNode | NavigatorNode[] {\n    if (!this.permissions.hasRole('ROLE_APPLICATION_MANAGEMENT_ADMIN')) {\n      return [];\n    }\n    return this.node;\n  }\n}\n","export const translationEditorBasePath = 'localization';\nexport const translationEditorBasicPath = 'basic';\nexport const translationEditorAdvancedPath = 'advanced';\n","import { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { ExtensionFactory, Tab } from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n  translationEditorAdvancedPath,\n  translationEditorBasePath,\n  translationEditorBasicPath\n} from './translation-editor.constants';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class TranslationEditorTabFactoryService implements ExtensionFactory<Tab> {\n  protected tabs = [\n    {\n      label: gettext('Basic'),\n      path: `/${translationEditorBasePath}/${translationEditorBasicPath}`,\n      priority: 200,\n      icon: 'language1'\n    },\n    {\n      label: gettext('Advanced'),\n      path: `/${translationEditorBasePath}/${translationEditorAdvancedPath}`,\n      priority: 100,\n      icon: 'c8y-css'\n    }\n  ] as const satisfies Tab[];\n\n  constructor(private router: Router) {}\n\n  get(): Tab[] {\n    if (this.router.url.startsWith(`/${translationEditorBasePath}/`)) {\n      return this.tabs;\n    }\n    return [];\n  }\n}\n","import { hookNavigator, hookRoute, hookTab } from '@c8y/ngx-components';\nimport { TranslationEditorNaviagtorFactoryService } from './translation-editor-naviagtor-factory.service';\nimport {\n  translationEditorAdvancedPath,\n  translationEditorBasePath,\n  translationEditorBasicPath\n} from './translation-editor.constants';\nimport { TranslationEditorTabFactoryService } from './translation-editor-tab-factory.service';\n\nexport const tranlationEditorProviders = [\n  hookRoute({\n    path: translationEditorBasePath,\n    children: [\n      {\n        path: '',\n        pathMatch: 'full',\n        redirectTo: translationEditorBasicPath\n      },\n      {\n        path: translationEditorBasicPath,\n        loadComponent: () =>\n          import('@c8y/ngx-components/translation-editor/lazy').then(\n            m => m.TranslationEditorComponent\n          )\n      },\n      {\n        path: translationEditorAdvancedPath,\n        loadComponent: () =>\n          import('@c8y/ngx-components/translation-editor/lazy').then(\n            m => m.AdvancedTranslationEditorComponent\n          )\n      }\n    ]\n  }),\n  hookNavigator(TranslationEditorNaviagtorFactoryService),\n  hookTab(TranslationEditorTabFactoryService)\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;MAOa,wCAAwC,CAAA;AAQnD,IAAA,WAAA,CAAoB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;QAPvB,IAAA,CAAA,IAAI,GAAG,IAAI,aAAa,CAAC;AAC/B,YAAA,IAAI,EAAE,WAAW;AACjB,YAAA,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC;AAC9B,YAAA,MAAM,EAAE,UAAU;AAClB,YAAA,IAAI,EAAE;AACP,SAAA,CAAC;IAE6C;IAE/C,GAAG,GAAA;QACD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,mCAAmC,CAAC,EAAE;AAClE,YAAA,OAAO,EAAE;QACX;QACA,OAAO,IAAI,CAAC,IAAI;IAClB;+GAfW,wCAAwC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,E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