iobroker.mywebui 1.76.0 → 1.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/default-controls/controls/gauges/setpoint-gauge.control +1 -0
- package/dist/backend/3d-editor-integration.js +1 -1
- package/dist/backend/ImportmapCreator.js +1 -1
- package/dist/backend/UploadHelper.js +1 -1
- package/dist/backend/main.js +1 -1
- package/io-package.json +1 -1
- package/package.json +1 -1
- package/www/3d-editor/js/Animation.js +1 -1
- package/www/3d-editor/js/AnimationResizer.js +1 -1
- package/www/3d-editor/js/Command.js +1 -1
- package/www/3d-editor/js/Config.js +1 -1
- package/www/3d-editor/js/Editor.js +1 -1
- package/www/3d-editor/js/EditorControls.js +1 -1
- package/www/3d-editor/js/GLTFImportDialog.js +1 -1
- package/www/3d-editor/js/History.js +1 -1
- package/www/3d-editor/js/Loader.js +1 -1
- package/www/3d-editor/js/LoaderUtils.js +1 -1
- package/www/3d-editor/js/Menubar.Add.js +1 -1
- package/www/3d-editor/js/Menubar.Edit.js +1 -1
- package/www/3d-editor/js/Menubar.File.js +1 -1
- package/www/3d-editor/js/Menubar.Help.js +1 -1
- package/www/3d-editor/js/Menubar.Render.js +1 -1
- package/www/3d-editor/js/Menubar.Status.js +1 -1
- package/www/3d-editor/js/Menubar.View.js +1 -1
- package/www/3d-editor/js/Menubar.js +1 -1
- package/www/3d-editor/js/Player.js +1 -1
- package/www/3d-editor/js/Resizer.js +1 -1
- package/www/3d-editor/js/Script.js +1 -1
- package/www/3d-editor/js/Selector.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.BoxGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.BufferGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.CapsuleGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.CircleGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.CylinderGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.DodecahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.ExtrudeGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.IcosahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.LatheGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.Modifiers.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.OctahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.PlaneGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.RingGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.ShapeGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.SphereGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TetrahedronGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TextGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TorusGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TorusKnotGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.TubeGeometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Geometry.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.BooleanProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.ColorProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.ConstantProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.MapProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.NumberProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.Program.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.RangeValueProperty.js +1 -1
- package/www/3d-editor/js/Sidebar.Material.js +1 -1
- package/www/3d-editor/js/Sidebar.Object.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.App.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.Materials.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.Renderer.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.Resources.js +1 -1
- package/www/3d-editor/js/Sidebar.Project.js +1 -1
- package/www/3d-editor/js/Sidebar.Properties.js +1 -1
- package/www/3d-editor/js/Sidebar.Scene.js +1 -1
- package/www/3d-editor/js/Sidebar.Script.js +1 -1
- package/www/3d-editor/js/Sidebar.Settings.History.js +1 -1
- package/www/3d-editor/js/Sidebar.Settings.Shortcuts.js +1 -1
- package/www/3d-editor/js/Sidebar.Settings.js +1 -1
- package/www/3d-editor/js/Sidebar.js +1 -1
- package/www/3d-editor/js/Storage.js +1 -1
- package/www/3d-editor/js/Strings.js +1 -1
- package/www/3d-editor/js/TextureParametersDialog.js +1 -1
- package/www/3d-editor/js/Toolbar.js +1 -1
- package/www/3d-editor/js/Viewport.Controls.js +1 -1
- package/www/3d-editor/js/Viewport.Info.js +1 -1
- package/www/3d-editor/js/Viewport.Pathtracer.js +1 -1
- package/www/3d-editor/js/Viewport.ViewHelper.js +1 -1
- package/www/3d-editor/js/Viewport.XR.js +1 -1
- package/www/3d-editor/js/Viewport.js +1 -1
- package/www/3d-editor/js/commands/AddObjectCommand.js +1 -1
- package/www/3d-editor/js/commands/AddScriptCommand.js +1 -1
- package/www/3d-editor/js/commands/Commands.js +1 -1
- package/www/3d-editor/js/commands/MoveObjectCommand.js +1 -1
- package/www/3d-editor/js/commands/MultiCmdsCommand.js +1 -1
- package/www/3d-editor/js/commands/RemoveObjectCommand.js +1 -1
- package/www/3d-editor/js/commands/RemoveScriptCommand.js +1 -1
- package/www/3d-editor/js/commands/SetColorCommand.js +1 -1
- package/www/3d-editor/js/commands/SetGeometryCommand.js +1 -1
- package/www/3d-editor/js/commands/SetGeometryValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialColorCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialMapCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialRangeCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetMaterialVectorCommand.js +1 -1
- package/www/3d-editor/js/commands/SetPositionCommand.js +1 -1
- package/www/3d-editor/js/commands/SetRotationCommand.js +1 -1
- package/www/3d-editor/js/commands/SetScaleCommand.js +1 -1
- package/www/3d-editor/js/commands/SetSceneCommand.js +1 -1
- package/www/3d-editor/js/commands/SetScriptValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetShadowValueCommand.js +1 -1
- package/www/3d-editor/js/commands/SetTextureParametersCommand.js +1 -1
- package/www/3d-editor/js/commands/SetUuidCommand.js +1 -1
- package/www/3d-editor/js/commands/SetValueCommand.js +1 -1
- package/www/dist/frontend/bundle/chunk-3C6XC7RW.js +1 -1
- package/www/dist/frontend/bundle/chunk-3WGNLIWJ.js +3 -3
- package/www/dist/frontend/bundle/chunk-3YK3Y2SJ.js +1 -1
- package/www/dist/frontend/bundle/chunk-43HEBO5G.js +2 -2
- package/www/dist/frontend/bundle/chunk-5MUGMRXU.js +1 -1
- package/www/dist/frontend/bundle/chunk-5UBRCTRX.js +3 -3
- package/www/dist/frontend/bundle/chunk-65A3PNMG.js +1 -1
- package/www/dist/frontend/bundle/chunk-7CWDQGAG.js +3 -3
- package/www/dist/frontend/bundle/chunk-7PT7IGUJ.js +3 -3
- package/www/dist/frontend/bundle/chunk-AI5PDLDE.js +2 -2
- package/www/dist/frontend/bundle/chunk-AWKVUUKN.js +3 -3
- package/www/dist/frontend/bundle/chunk-B6NXWGSB.js +1 -1
- package/www/dist/frontend/bundle/chunk-BHSHNRXW.js +1 -1
- package/www/dist/frontend/bundle/chunk-BVONDEOL.js +3 -3
- package/www/dist/frontend/bundle/chunk-CHDKROX5.js +3 -3
- package/www/dist/frontend/bundle/chunk-DNCD2F6X.js +3 -3
- package/www/dist/frontend/bundle/chunk-FHF6DL5U.js +1 -1
- package/www/dist/frontend/bundle/chunk-FO56TEZH.js +3 -3
- package/www/dist/frontend/bundle/chunk-FSRRPQMX.js +3 -3
- package/www/dist/frontend/bundle/chunk-GLQNGCFL.js +1 -1
- package/www/dist/frontend/bundle/chunk-JBDSDK2C.js +3 -3
- package/www/dist/frontend/bundle/chunk-JSC66ZLQ.js +1 -1
- package/www/dist/frontend/bundle/chunk-K6IV7LKW.js +1 -1
- package/www/dist/frontend/bundle/chunk-KY73TL6O.js +2 -2
- package/www/dist/frontend/bundle/chunk-M6VVTDVX.js +3 -3
- package/www/dist/frontend/bundle/chunk-MECWXZRN.js +1 -1
- package/www/dist/frontend/bundle/chunk-N2YIZTB2.js +1 -1
- package/www/dist/frontend/bundle/chunk-NQ7L7KNT.js +3 -3
- package/www/dist/frontend/bundle/chunk-P7EOR36H.js +1 -1
- package/www/dist/frontend/bundle/chunk-PJYK24KZ.js +1 -1
- package/www/dist/frontend/bundle/chunk-PYLAW6UA.js +3 -3
- package/www/dist/frontend/bundle/chunk-QJJGP23I.js +1 -1
- package/www/dist/frontend/bundle/chunk-QV4IBWXA.js +1 -1
- package/www/dist/frontend/bundle/chunk-R6IQDPAP.js +3 -3
- package/www/dist/frontend/bundle/chunk-RTTBZOQU.js +3 -3
- package/www/dist/frontend/bundle/chunk-S4TLNW5D.js +1 -1
- package/www/dist/frontend/bundle/chunk-SE6N4ZEN.js +1 -1
- package/www/dist/frontend/bundle/chunk-SQHXO2IT.js +3 -3
- package/www/dist/frontend/bundle/chunk-T4AIQBBH.js +3 -3
- package/www/dist/frontend/bundle/chunk-U5Q332OH.js +1 -1
- package/www/dist/frontend/bundle/chunk-UIP324PP.js +1 -1
- package/www/dist/frontend/bundle/chunk-V27IRYSL.js +1 -1
- package/www/dist/frontend/bundle/chunk-V4C5FGJL.js +2 -2
- package/www/dist/frontend/bundle/chunk-WED7CGWA.js +2 -2
- package/www/dist/frontend/bundle/chunk-WQ5H5LTG.js +3 -3
- package/www/dist/frontend/bundle/chunk-WU54NCEU.js +1 -1
- package/www/dist/frontend/bundle/chunk-XFO5FUCN.js +1 -1
- package/www/dist/frontend/bundle/chunk-XWAQ2BWM.js +3 -3
- package/www/dist/frontend/bundle/chunk-YTQCHNRQ.js +3 -3
- package/www/dist/frontend/bundle/chunk-YUSK4FN3.js +3 -3
- package/www/dist/frontend/bundle/chunk-Z34BSG5O.js +3 -3
- package/www/dist/frontend/bundle/common/IobrokerHandler.js +1 -1
- package/www/dist/frontend/bundle/runtime/CustomControls.js +1 -1
- package/www/dist/frontend/bundle/runtime/ScreenViewer.js +1 -1
- package/www/dist/frontend/bundle/runtime/controls.js +4 -4
- package/www/dist/frontend/bundle/runtime/init.js +2 -2
- package/www/dist/frontend/common/Common.globals.js +1 -1
- package/www/dist/frontend/common/IobrokerHandler.js +1 -1
- package/www/dist/frontend/common/Runtime.js +1 -1
- package/www/dist/frontend/config/CommandHandling.js +1 -1
- package/www/dist/frontend/config/ConfigureWebcomponentDesigner.js +1 -1
- package/www/dist/frontend/config/DockHelper.js +1 -1
- package/www/dist/frontend/config/IobrokerWebui3DDriveEngine.js +1 -1
- package/www/dist/frontend/config/IobrokerWebui3DScreenEditor.js +3 -3
- package/www/dist/frontend/config/IobrokerWebui3DScreenPropertiesPanel.js +3 -3
- package/www/dist/frontend/config/IobrokerWebui3DScreenViewer.js +2 -2
- package/www/dist/frontend/config/IobrokerWebuiAppShell.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiBindingsEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiConfirmationWrapper.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiControlPropertiesEditor.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiDynamicPropsEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiEventAssignment.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiIconsView.js +2 -2
- package/www/dist/frontend/config/IobrokerWebuiMonacoEditor.js +2 -2
- package/www/dist/frontend/config/IobrokerWebuiPropertyGrid.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiScreenEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiScreensView.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiSignalPropertyEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiSolutionExplorer.js +3 -3
- package/www/dist/frontend/config/IobrokerWebuiTranslationEditor.js +1 -1
- package/www/dist/frontend/config/IobrokerWebuiWidgetGallery.js +3 -3
- package/www/dist/frontend/helper/DialogHelper.js +2 -2
- package/www/dist/frontend/helper/EsprimaHelper.js +1 -1
- package/www/dist/frontend/helper/Helper.js +1 -1
- package/www/dist/frontend/helper/LayoutHelper.js +1 -1
- package/www/dist/frontend/helper/XmlHelper.js +1 -1
- package/www/dist/frontend/helper/ZipHelper.js +1 -1
- package/www/dist/frontend/runtime/AnimationService.js +1 -1
- package/www/dist/frontend/runtime/CustomControls.js +1 -1
- package/www/dist/frontend/runtime/DynamicElementProperties.js +1 -1
- package/www/dist/frontend/runtime/HabPanelLikeMenu.js +3 -3
- package/www/dist/frontend/runtime/NavigationShell.js +1 -1
- package/www/dist/frontend/runtime/ScreenViewer.js +3 -3
- package/www/dist/frontend/runtime/TranslateableText.js +2 -2
- package/www/dist/frontend/runtime/VisibilityService.js +1 -1
- package/www/dist/frontend/runtime/controls.js +1 -1
- package/www/dist/frontend/runtime/init.js +1 -1
- package/www/dist/frontend/scripting/IobrokerWebuiScriptSystem.js +1 -1
- package/www/dist/frontend/scripting/blockly/OpenScreen.js +1 -1
- package/www/dist/frontend/scripting/blockly/webuiBlocklyToolbox.js +1 -1
- package/www/dist/frontend/services/DynamicPropertiesHelper.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableLocalObjectsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectDragDropService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectsForPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiConfigButtonProvider.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiCopyPasteService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiCustomControlEventsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiCustomElementContextMenu.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiDemoProviderService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiDynamicPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiEventsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiExternalDragDropService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiLitPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiPropertyGroupsService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiRefactorService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiScreenContextMenu.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiSpecialPropertiesService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiSpectrumEditorService.js +1 -1
- package/www/dist/frontend/services/IobrokerWebuiVisibilityPropertiesService.js +1 -1
- package/www/dist/frontend/services/LayoutComponentsPropertiesService.js +1 -1
- package/www/dist/frontend/widgets/OrthoFlowLineTool.js +1 -1
- package/www/dist/frontend/widgets/customElementsObserver.js +1 -1
- package/www/dist/frontend/widgets/importWidgetFiles.js +1 -1
- package/www/dist/frontend/widgets/importWidgetFilesRuntime.js +1 -1
- package/www/dist/frontend/widgets/layout-components.js +1 -1
- package/www/dist/frontend/widgets/layout-placement-services.js +1 -1
- package/www/dist/frontend/widgets/testElement.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const p=b;(function(c,d){const o=b,e=c();while(!![]){try{const f=-parseInt(o(0x18c))/0x1*(parseInt(o(0x1ad))/0x2)+parseInt(o(0x1ca))/0x3*(-parseInt(o(0x191))/0x4)+parseInt(o(0x1c0))/0x5+-parseInt(o(0x1ac))/0x6*(parseInt(o(0x1b5))/0x7)+parseInt(o(0x1b9))/0x8*(-parseInt(o(0x1aa))/0x9)+parseInt(o(0x199))/0xa+-parseInt(o(0x1c7))/0xb*(-parseInt(o(0x19a))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x3a72e));import{iobrokerHandler}from'../common/IobrokerHandler.js';const MM_TO_M=0.001,DEG_TO_RAD=Math['PI']/0xb4;export const DriveDirection={'LinearX':p(0x1a9),'LinearY':p(0x1da),'LinearZ':'LinearZ','RotationX':p(0x1bc),'RotationY':'RotationY','RotationZ':'RotationZ'};function isRotation(c){const q=p;return c===DriveDirection[q(0x1bc)]||c===DriveDirection[q(0x184)]||c===DriveDirection['RotationZ'];}export class SignalBus{constructor(){const r=p;this['_values']=new Map(),this['_listeners']=new Map(),this[r(0x19c)]=new Map();}['subscribe'](c,d){const s=p;if(!c)return()=>{};!this['_listeners'][s(0x1c8)](c)&&this[s(0x187)]['set'](c,new Set());this['_listeners']['get'](c)[s(0x186)](d);if(!this[s(0x19c)][s(0x1c8)](c)){const e=iobrokerHandler[s(0x1cd)](c,(f,g)=>{const t=s,h=g?.[t(0x1c9)]??![];this[t(0x1cb)][t(0x1d1)](c,h);const i=this[t(0x187)][t(0x193)](c);if(i){for(const j of i)j(h);}});this[s(0x19c)]['set'](c,e);}return this[s(0x1cb)]['has'](c)&&d(this[s(0x1cb)]['get'](c)),()=>{const u=s,f=this['_listeners'][u(0x193)](c);if(f){f['delete'](d);if(f[u(0x1a1)]===0x0){this[u(0x187)]['delete'](c);const g=this[u(0x19c)][u(0x193)](c);if(g)g();this['_unsubs']['delete'](c);}}};}['get'](c){const v=p;return this[v(0x1cb)]['get'](c);}['set'](c,d){if(!c)return;iobrokerHandler['setState'](c,d);}['dispose'](){const w=p;for(const c of this[w(0x19c)]['values']()){try{c();}catch(d){}}this['_values']['clear'](),this['_listeners'][w(0x1b7)](),this[w(0x19c)]['clear']();}}export class Drive{constructor(c,d={}){const x=p;this[x(0x183)]=c,this[x(0x1d2)]=c['name']||x(0x1a5),this['direction']=d[x(0x19e)]??DriveDirection[x(0x1a9)],this[x(0x1d4)]=d['reverseDir']??![],this[x(0x1bd)]=d['offset']??0x0,this['startPosition']=d[x(0x1bf)]??0x0,this['targetSpeed']=d[x(0x19b)]??0x64,this['acceleration']=d['acceleration']??0x0,this[x(0x1a2)]=d[x(0x1a2)]??![],this['lowerLimit']=d['lowerLimit']??-0xb4,this['upperLimit']=d['upperLimit']??0xb4,this['currentPosition']=this[x(0x1bf)],this['targetPosition']=this[x(0x1bf)],this[x(0x192)]=0x0,this['isRunning']=![],this[x(0x185)]=![],this[x(0x182)]=![],this[x(0x1b0)]=c[x(0x18d)][x(0x1d9)](),this['_baseQuat']=c['quaternion'][x(0x1d9)](),this['_isRotation']=isRotation(this['direction']),this[x(0x19f)]=null,this[x(0x1d5)]();}get['isAtTarget'](){const y=p;return Math[y(0x1bb)](this['currentPosition']-this['targetPosition'])<0.01;}[p(0x1cc)](c,d){const z=p;this['targetPosition']=c;if(d!==undefined)this['targetSpeed']=d;this[z(0x198)]=!![];}['stop'](){const A=p;this[A(0x198)]=![],this['currentSpeed']=0x0;}['update'](c){const B=p;if(this[B(0x185)]||this['jogBackward']){this[B(0x192)]=this['targetSpeed'];const h=this[B(0x185)]?0x1:-0x1;let i=this[B(0x194)]+h*this['currentSpeed']*c;this[B(0x1a2)]&&(i=Math[B(0x1af)](this[B(0x1b8)],Math[B(0x1c2)](this[B(0x188)],i)));this['currentPosition']=i,this['_applyToNode'](),this['onAfterUpdate']?.(this);return;}if(!this[B(0x198)])return;const d=this[B(0x196)]-this['currentPosition'];if(Math[B(0x1bb)](d)<0.01){this[B(0x194)]=this['targetPosition'],this['isRunning']=![],this['currentSpeed']=0x0,this[B(0x1d5)](),this[B(0x19f)]?.(this);return;}const e=Math['sign'](d),f=this[B(0x19b)];if(this[B(0x1c5)]>0x0){const j=this[B(0x192)]*this[B(0x192)]/(0x2*this[B(0x1c5)]);if(j>=Math[B(0x1bb)](d))this['currentSpeed']=Math[B(0x1af)](0x0,this[B(0x192)]-this['acceleration']*c);else this['currentSpeed']<f&&(this[B(0x192)]=Math[B(0x1c2)](f,this[B(0x192)]+this[B(0x1c5)]*c));}else this['currentSpeed']=f;let g=this[B(0x194)]+e*this[B(0x192)]*c;if(e>0x0&&g>this['targetPosition'])g=this['targetPosition'];if(e<0x0&&g<this['targetPosition'])g=this[B(0x196)];this['useLimits']&&(g=Math[B(0x1af)](this[B(0x1b8)],Math['min'](this[B(0x188)],g))),this[B(0x194)]=g,this['_applyToNode'](),this[B(0x19f)]?.(this);}[p(0x1d5)](){const C=p,c=this['currentPosition']+this[C(0x1bd)],d=this['reverseDir']?-0x1:0x1;switch(this['direction']){case DriveDirection['LinearX']:this['node']['position']['x']=this[C(0x1b0)]['x']+d*c*MM_TO_M;break;case DriveDirection[C(0x1da)]:this['node']['position']['y']=this['_basePos']['y']+d*c*MM_TO_M;break;case DriveDirection[C(0x18a)]:this[C(0x183)]['position']['z']=this[C(0x1b0)]['z']+d*c*MM_TO_M;break;case DriveDirection['RotationX']:{const e=d*c*DEG_TO_RAD;this['node']['quaternion'][C(0x1d6)](this[C(0x18b)]),this['node']['rotateX'](e);break;}case DriveDirection[C(0x184)]:{const f=d*c*DEG_TO_RAD;this[C(0x183)][C(0x1a4)][C(0x1d6)](this['_baseQuat']),this['node']['rotateY'](f);break;}case DriveDirection['RotationZ']:{const g=d*c*DEG_TO_RAD;this[C(0x183)]['quaternion']['copy'](this[C(0x18b)]),this[C(0x183)]['rotateZ'](g);break;}}}[p(0x1ce)](){const D=p;return{'direction':this[D(0x19e)],'reverseDir':this[D(0x1d4)],'offset':this[D(0x1bd)],'startPosition':this['startPosition'],'targetSpeed':this[D(0x19b)],'acceleration':this[D(0x1c5)],'useLimits':this['useLimits'],'lowerLimit':this[D(0x1b8)],'upperLimit':this[D(0x188)]};}}export class DriveCylinder{constructor(c,d,e={}){const E=p;this[E(0x1a7)]=c,this[E(0x1d7)]=d,this['name']=c[E(0x1d2)],this[E(0x1c6)]=e['minPos']??0x0,this['maxPos']=e['maxPos']??0x64,this['timeOut']=e['timeOut']??0x1,this['timeIn']=e[E(0x1d0)]??0x1,this['oneBit']=e['oneBit']??![],this[E(0x1ba)]=e[E(0x1ba)]??![],this[E(0x1ae)]=e[E(0x1ae)]??null,this[E(0x1c1)]=e[E(0x1c1)]??null,this['signalIsOut']=e[E(0x19d)]??null,this[E(0x1cf)]=e[E(0x1cf)]??null,this['signalMovingOut']=e['signalMovingOut']??null,this['signalMovingIn']=e[E(0x189)]??null,this[E(0x19c)]=[],this[E(0x1b2)]();}['_init'](){const F=p,{drive:c,bus:d}=this,e=Math[F(0x1bb)](this[F(0x1a8)]-this[F(0x1c6)]);c['currentPosition']=this[F(0x1c6)],c[F(0x1d5)]();if(this[F(0x1ae)]){const f=d[F(0x1cd)](this[F(0x1ae)],g=>{const G=F;let h=Boolean(g);if(this['invertLogic'])h=!h;if(this['oneBit'])c['targetSpeed']=e/(h?this[G(0x1a3)]:this[G(0x1d0)]),c['moveTo'](h?this[G(0x1a8)]:this['minPos']);else h&&(c['targetSpeed']=e/this['timeOut'],c['moveTo'](this[G(0x1a8)]));});this[F(0x19c)]['push'](f);}if(this['signalIn']&&!this['oneBit']){const g=d[F(0x1cd)](this[F(0x1c1)],h=>{const H=F;let i=Boolean(h);if(this[H(0x1ba)])i=!i;i&&(c['targetSpeed']=e/this[H(0x1d0)],c[H(0x1cc)](this['minPos']));});this['_unsubs']['push'](g);}if(this['signalIsOut']||this['signalIsIn']||this['signalMovingOut']||this['signalMovingIn']){let h=![],i=!![];c['onAfterUpdate']=j=>{const I=F,k=Math['abs'](j['currentPosition']-this[I(0x1a8)])<0.01,l=Math['abs'](j['currentPosition']-this[I(0x1c6)])<0.01,m=j[I(0x198)]&&j['targetPosition']===this['maxPos'],n=j[I(0x198)]&&j[I(0x196)]===this['minPos'];if(k!==h){if(this['signalIsOut'])d[I(0x1d1)](this['signalIsOut'],k);if(this['signalIsOut'])d['set'](this['signalIsOut']+'_max',k);h=k;}if(l!==i){if(this['signalIsIn'])d[I(0x1d1)](this['signalIsIn'],l);i=l;}if(this[I(0x190)])d['set'](this['signalMovingOut'],m);if(this[I(0x189)])d[I(0x1d1)](this['signalMovingIn'],n);};}}['dispose'](){for(const c of this['_unsubs'])c();this['_unsubs']=[];}[p(0x1ce)](){const J=p;return{'type':'cylinder','minPos':this[J(0x1c6)],'maxPos':this['maxPos'],'timeOut':this[J(0x1a3)],'timeIn':this[J(0x1d0)],'oneBit':this[J(0x1b1)],'invertLogic':this['invertLogic'],'signalOut':this[J(0x1ae)],'signalIn':this['signalIn'],'signalIsOut':this[J(0x19d)],'signalIsIn':this['signalIsIn'],'signalMovingOut':this[J(0x190)],'signalMovingIn':this['signalMovingIn']};}}function b(c,d){c=c-0x182;const e=a();let f=e[c];return f;}export class DriveSimple{constructor(c,d,e={}){const K=p;this[K(0x1a7)]=c,this[K(0x1d7)]=d,this['signalForward']=e[K(0x1d8)]??null,this[K(0x1c4)]=e[K(0x1c4)]??null,this['_unsubs']=[],this['_init']();}['_init'](){const L=p,{drive:c,bus:d}=this;if(this['signalForward']){const e=d['subscribe'](this[L(0x1d8)],f=>{const M=L;c['jogForward']=Boolean(f);if(c['jogForward'])c[M(0x182)]=![];});this['_unsubs']['push'](e);}if(this['signalBackward']){const f=d[L(0x1cd)](this[L(0x1c4)],g=>{c['jogBackward']=Boolean(g);if(c['jogBackward'])c['jogForward']=![];});this['_unsubs']['push'](f);}}[p(0x1b6)](){for(const c of this['_unsubs'])c();this['_unsubs']=[];}['toConfig'](){const N=p;return{'type':N(0x1a0),'signalForward':this['signalForward'],'signalBackward':this['signalBackward']};}}export class DriveEngine{constructor(){const O=p;this[O(0x1d7)]=new SignalBus(),this[O(0x18e)]=[],this['controllers']=[],this['_lastTime']=null;}[p(0x1a6)](c,d){const P=p;this['dispose']();for(const e of c){if(!e[P(0x18e)]||e[P(0x18e)]['length']===0x0)continue;const f=d[P(0x195)](g=>g[P(0x197)][P(0x1c3)]?.['id']===e['id']);if(!f)continue;for(const g of e['drives']){const h=new Drive(f,g);this['drives'][P(0x1be)](h);if(g[P(0x1ab)]==='cylinder'){const i=new DriveCylinder(h,this[P(0x1d7)],g);this['controllers'][P(0x1be)](i);}else{if(g['type']==='simple'){const j=new DriveSimple(h,this[P(0x1d7)],g);this[P(0x1b3)]['push'](j);}}}}}['tick'](c){for(const d of this['drives']){d['update'](c);}}['tickFromRAF'](c){const Q=p;if(this['_lastTime']===null){this['_lastTime']=c;return;}const d=Math[Q(0x1c2)]((c-this['_lastTime'])/0x3e8,0.1);this['_lastTime']=c,this[Q(0x1b4)](d);}['dispose'](){const R=p;for(const c of this['controllers'])c[R(0x1b6)]();this[R(0x1b3)]=[],this[R(0x18e)]=[];}[p(0x1d3)](){const S=p;this[S(0x1b6)](),this['bus']['dispose']();}[p(0x18f)](c,d=0x0){const T=p;let e=0x0;for(const f of this[T(0x18e)]){if(f[T(0x183)][T(0x197)][T(0x1c3)]?.['id']===c){if(e===d)return f;e++;}}return null;}}function a(){const U=['signalBackward','acceleration','minPos','831721IIUUTc','has','val','26151xMUBAf','_values','moveTo','subscribe','toConfig','signalIsIn','timeIn','set','name','destroy','reverseDir','_applyToNode','copy','bus','signalForward','clone','LinearY','jogBackward','node','RotationY','jogForward','add','_listeners','upperLimit','signalMovingIn','LinearZ','_baseQuat','1481HYBDEY','position','drives','getDrive','signalMovingOut','12ZOtuvg','currentSpeed','get','currentPosition','find','targetPosition','userData','isRunning','4020470mHsESi','48qMhAXp','targetSpeed','_unsubs','signalIsOut','direction','onAfterUpdate','simple','size','useLimits','timeOut','quaternion','Drive','createFromAssets','drive','maxPos','LinearX','553671UWzoMR','type','1360344jtYkle','158EhiLQg','signalOut','max','_basePos','oneBit','_init','controllers','tick','14tTmOOX','dispose','clear','lowerLimit','16nvkcfL','invertLogic','abs','RotationX','offset','push','startPosition','1272755JEUcAY','signalIn','min','assetData'];a=function(){return U;};return a();}
|
|
1
|
+
const p=b;(function(c,d){const o=b,e=c();while(!![]){try{const f=parseInt(o(0xec))/0x1*(-parseInt(o(0xb1))/0x2)+-parseInt(o(0xcc))/0x3+-parseInt(o(0xbc))/0x4*(-parseInt(o(0xdf))/0x5)+-parseInt(o(0xd9))/0x6*(-parseInt(o(0x98))/0x7)+-parseInt(o(0xd4))/0x8+parseInt(o(0xad))/0x9*(-parseInt(o(0xe4))/0xa)+parseInt(o(0xe1))/0xb;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x3c67d));function a(){const U=['toConfig','quaternion','upperLimit','_basePos','629310axeNhr','position','lowerLimit','subscribe','LinearX','currentPosition','signalIsIn','_unsubs','2540656bmHjQH','getDrive','drives','stop','moveTo','42BMkabV','update','_init','push','sign','LinearY','100UpDOnk','find','10845252vzworZ','targetSpeed','clear','16040bxxAzZ','offset','signalOut','jogForward','oneBit','isRunning','_baseQuat','RotationX','1gbLSFy','_listeners','rotateY','startPosition','has','name','dispose','drive','jogBackward','122486bxLWtL','add','minPos','signalIsOut','length','userData','targetPosition','currentSpeed','delete','min','useLimits','_max','reverseDir','node','max','type','invertLogic','abs','tickFromRAF','assetData','_values','747HqYTWL','RotationY','destroy','_lastTime','886426RqFFbW','signalBackward','val','onAfterUpdate','maxPos','simple','signalIn','set','copy','get','controllers','48540PLnUCJ','acceleration','clone','rotateX','timeIn','signalMovingOut','_applyToNode','timeOut','signalForward','isAtTarget','Drive','signalMovingIn'];a=function(){return U;};return a();}import{iobrokerHandler}from'../common/IobrokerHandler.js';const MM_TO_M=0.001,DEG_TO_RAD=Math['PI']/0xb4;export const DriveDirection={'LinearX':'LinearX','LinearY':'LinearY','LinearZ':'LinearZ','RotationX':p(0xeb),'RotationY':p(0xae),'RotationZ':'RotationZ'};function isRotation(c){const q=p;return c===DriveDirection['RotationX']||c===DriveDirection[q(0xae)]||c===DriveDirection['RotationZ'];}function b(c,d){c=c-0x92;const e=a();let f=e[c];return f;}export class SignalBus{constructor(){const r=p;this[r(0xac)]=new Map(),this[r(0xed)]=new Map(),this[r(0xd3)]=new Map();}[p(0xcf)](c,d){const s=p;if(!c)return()=>{};!this[s(0xed)][s(0x93)](c)&&this[s(0xed)][s(0xb8)](c,new Set());this[s(0xed)]['get'](c)[s(0x99)](d);if(!this[s(0xd3)][s(0x93)](c)){const e=iobrokerHandler['subscribe'](c,(f,g)=>{const t=s,h=g?.[t(0xb3)]??![];this['_values'][t(0xb8)](c,h);const i=this['_listeners'][t(0xba)](c);if(i){for(const j of i)j(h);}});this[s(0xd3)]['set'](c,e);}return this[s(0xac)][s(0x93)](c)&&d(this['_values'][s(0xba)](c)),()=>{const u=s,f=this['_listeners']['get'](c);if(f){f['delete'](d);if(f['size']===0x0){this[u(0xed)][u(0xa0)](c);const g=this['_unsubs']['get'](c);if(g)g();this[u(0xd3)][u(0xa0)](c);}}};}[p(0xba)](c){const v=p;return this[v(0xac)][v(0xba)](c);}[p(0xb8)](c,d){if(!c)return;iobrokerHandler['setState'](c,d);}[p(0x95)](){const w=p;for(const c of this['_unsubs']['values']()){try{c();}catch(d){}}this[w(0xac)][w(0xe3)](),this[w(0xed)]['clear'](),this['_unsubs'][w(0xe3)]();}}export class Drive{constructor(c,d={}){const x=p;this[x(0xa5)]=c,this[x(0x94)]=c['name']||x(0xc6),this['direction']=d['direction']??DriveDirection['LinearX'],this[x(0xa4)]=d['reverseDir']??![],this['offset']=d['offset']??0x0,this[x(0x92)]=d['startPosition']??0x0,this['targetSpeed']=d[x(0xe2)]??0x64,this[x(0xbd)]=d['acceleration']??0x0,this['useLimits']=d[x(0xa2)]??![],this['lowerLimit']=d['lowerLimit']??-0xb4,this['upperLimit']=d[x(0xca)]??0xb4,this[x(0xd1)]=this['startPosition'],this['targetPosition']=this['startPosition'],this[x(0x9f)]=0x0,this['isRunning']=![],this[x(0xe7)]=![],this[x(0x97)]=![],this['_basePos']=c[x(0xcd)]['clone'](),this['_baseQuat']=c['quaternion'][x(0xbe)](),this['_isRotation']=isRotation(this['direction']),this['onAfterUpdate']=null,this['_applyToNode']();}get[p(0xc5)](){const y=p;return Math[y(0xa9)](this['currentPosition']-this['targetPosition'])<0.01;}['moveTo'](c,d){const z=p;this['targetPosition']=c;if(d!==undefined)this[z(0xe2)]=d;this[z(0xe9)]=!![];}[p(0xd7)](){this['isRunning']=![],this['currentSpeed']=0x0;}[p(0xda)](c){const A=p;if(this[A(0xe7)]||this['jogBackward']){this['currentSpeed']=this['targetSpeed'];const h=this[A(0xe7)]?0x1:-0x1;let i=this[A(0xd1)]+h*this['currentSpeed']*c;this['useLimits']&&(i=Math['max'](this['lowerLimit'],Math['min'](this[A(0xca)],i)));this['currentPosition']=i,this[A(0xc2)](),this[A(0xb4)]?.(this);return;}if(!this['isRunning'])return;const d=this[A(0x9e)]-this['currentPosition'];if(Math[A(0xa9)](d)<0.01){this['currentPosition']=this[A(0x9e)],this['isRunning']=![],this['currentSpeed']=0x0,this['_applyToNode'](),this[A(0xb4)]?.(this);return;}const e=Math[A(0xdd)](d),f=this['targetSpeed'];if(this['acceleration']>0x0){const j=this['currentSpeed']*this[A(0x9f)]/(0x2*this[A(0xbd)]);if(j>=Math['abs'](d))this['currentSpeed']=Math['max'](0x0,this[A(0x9f)]-this['acceleration']*c);else this['currentSpeed']<f&&(this[A(0x9f)]=Math[A(0xa1)](f,this['currentSpeed']+this[A(0xbd)]*c));}else this[A(0x9f)]=f;let g=this[A(0xd1)]+e*this['currentSpeed']*c;if(e>0x0&&g>this[A(0x9e)])g=this[A(0x9e)];if(e<0x0&&g<this['targetPosition'])g=this['targetPosition'];this[A(0xa2)]&&(g=Math[A(0xa6)](this[A(0xce)],Math[A(0xa1)](this[A(0xca)],g))),this[A(0xd1)]=g,this['_applyToNode'](),this['onAfterUpdate']?.(this);}['_applyToNode'](){const B=p,c=this['currentPosition']+this[B(0xe5)],d=this[B(0xa4)]?-0x1:0x1;switch(this['direction']){case DriveDirection[B(0xd0)]:this[B(0xa5)]['position']['x']=this['_basePos']['x']+d*c*MM_TO_M;break;case DriveDirection[B(0xde)]:this[B(0xa5)]['position']['y']=this[B(0xcb)]['y']+d*c*MM_TO_M;break;case DriveDirection['LinearZ']:this[B(0xa5)][B(0xcd)]['z']=this[B(0xcb)]['z']+d*c*MM_TO_M;break;case DriveDirection[B(0xeb)]:{const e=d*c*DEG_TO_RAD;this[B(0xa5)][B(0xc9)]['copy'](this['_baseQuat']),this[B(0xa5)][B(0xbf)](e);break;}case DriveDirection[B(0xae)]:{const f=d*c*DEG_TO_RAD;this['node']['quaternion']['copy'](this['_baseQuat']),this['node'][B(0xee)](f);break;}case DriveDirection['RotationZ']:{const g=d*c*DEG_TO_RAD;this[B(0xa5)]['quaternion'][B(0xb9)](this[B(0xea)]),this['node']['rotateZ'](g);break;}}}[p(0xc8)](){const C=p;return{'direction':this['direction'],'reverseDir':this[C(0xa4)],'offset':this[C(0xe5)],'startPosition':this[C(0x92)],'targetSpeed':this[C(0xe2)],'acceleration':this[C(0xbd)],'useLimits':this['useLimits'],'lowerLimit':this['lowerLimit'],'upperLimit':this[C(0xca)]};}}export class DriveCylinder{constructor(c,d,e={}){const D=p;this['drive']=c,this['bus']=d,this['name']=c['name'],this[D(0x9a)]=e[D(0x9a)]??0x0,this['maxPos']=e['maxPos']??0x64,this[D(0xc3)]=e['timeOut']??0x1,this['timeIn']=e[D(0xc0)]??0x1,this['oneBit']=e['oneBit']??![],this[D(0xa8)]=e['invertLogic']??![],this[D(0xe6)]=e['signalOut']??null,this['signalIn']=e['signalIn']??null,this['signalIsOut']=e[D(0x9b)]??null,this['signalIsIn']=e['signalIsIn']??null,this['signalMovingOut']=e[D(0xc1)]??null,this[D(0xc7)]=e[D(0xc7)]??null,this['_unsubs']=[],this['_init']();}[p(0xdb)](){const E=p,{drive:c,bus:d}=this,e=Math[E(0xa9)](this[E(0xb5)]-this['minPos']);c['currentPosition']=this['minPos'],c[E(0xc2)]();if(this['signalOut']){const f=d[E(0xcf)](this['signalOut'],g=>{const F=E;let h=Boolean(g);if(this['invertLogic'])h=!h;if(this[F(0xe8)])c['targetSpeed']=e/(h?this[F(0xc3)]:this[F(0xc0)]),c[F(0xd8)](h?this[F(0xb5)]:this['minPos']);else h&&(c['targetSpeed']=e/this[F(0xc3)],c['moveTo'](this[F(0xb5)]));});this[E(0xd3)][E(0xdc)](f);}if(this[E(0xb7)]&&!this[E(0xe8)]){const g=d[E(0xcf)](this[E(0xb7)],h=>{const G=E;let i=Boolean(h);if(this[G(0xa8)])i=!i;i&&(c['targetSpeed']=e/this['timeIn'],c['moveTo'](this['minPos']));});this['_unsubs']['push'](g);}if(this[E(0x9b)]||this['signalIsIn']||this['signalMovingOut']||this['signalMovingIn']){let h=![],i=!![];c[E(0xb4)]=j=>{const H=E,k=Math[H(0xa9)](j[H(0xd1)]-this['maxPos'])<0.01,l=Math[H(0xa9)](j[H(0xd1)]-this[H(0x9a)])<0.01,m=j['isRunning']&&j[H(0x9e)]===this['maxPos'],n=j[H(0xe9)]&&j['targetPosition']===this[H(0x9a)];if(k!==h){if(this['signalIsOut'])d['set'](this['signalIsOut'],k);if(this['signalIsOut'])d[H(0xb8)](this[H(0x9b)]+H(0xa3),k);h=k;}if(l!==i){if(this['signalIsIn'])d['set'](this[H(0xd2)],l);i=l;}if(this[H(0xc1)])d['set'](this['signalMovingOut'],m);if(this[H(0xc7)])d['set'](this['signalMovingIn'],n);};}}[p(0x95)](){for(const c of this['_unsubs'])c();this['_unsubs']=[];}[p(0xc8)](){const I=p;return{'type':'cylinder','minPos':this[I(0x9a)],'maxPos':this[I(0xb5)],'timeOut':this['timeOut'],'timeIn':this[I(0xc0)],'oneBit':this['oneBit'],'invertLogic':this['invertLogic'],'signalOut':this[I(0xe6)],'signalIn':this[I(0xb7)],'signalIsOut':this['signalIsOut'],'signalIsIn':this[I(0xd2)],'signalMovingOut':this[I(0xc1)],'signalMovingIn':this['signalMovingIn']};}}export class DriveSimple{constructor(c,d,e={}){const J=p;this[J(0x96)]=c,this['bus']=d,this[J(0xc4)]=e[J(0xc4)]??null,this[J(0xb2)]=e['signalBackward']??null,this['_unsubs']=[],this[J(0xdb)]();}['_init'](){const K=p,{drive:c,bus:d}=this;if(this[K(0xc4)]){const e=d['subscribe'](this[K(0xc4)],f=>{const L=K;c['jogForward']=Boolean(f);if(c[L(0xe7)])c[L(0x97)]=![];});this[K(0xd3)]['push'](e);}if(this[K(0xb2)]){const f=d['subscribe'](this[K(0xb2)],g=>{const M=K;c[M(0x97)]=Boolean(g);if(c['jogBackward'])c['jogForward']=![];});this[K(0xd3)][K(0xdc)](f);}}['dispose'](){for(const c of this['_unsubs'])c();this['_unsubs']=[];}[p(0xc8)](){const N=p;return{'type':'simple','signalForward':this['signalForward'],'signalBackward':this[N(0xb2)]};}}export class DriveEngine{constructor(){const O=p;this['bus']=new SignalBus(),this['drives']=[],this[O(0xbb)]=[],this['_lastTime']=null;}['createFromAssets'](c,d){const P=p;this[P(0x95)]();for(const e of c){if(!e[P(0xd6)]||e['drives'][P(0x9c)]===0x0)continue;const f=d[P(0xe0)](g=>g[P(0x9d)][P(0xab)]?.['id']===e['id']);if(!f)continue;for(const g of e[P(0xd6)]){const h=new Drive(f,g);this['drives']['push'](h);if(g[P(0xa7)]==='cylinder'){const i=new DriveCylinder(h,this['bus'],g);this['controllers']['push'](i);}else{if(g[P(0xa7)]===P(0xb6)){const j=new DriveSimple(h,this['bus'],g);this['controllers']['push'](j);}}}}}['tick'](c){const Q=p;for(const d of this['drives']){d[Q(0xda)](c);}}[p(0xaa)](c){const R=p;if(this['_lastTime']===null){this[R(0xb0)]=c;return;}const d=Math['min']((c-this[R(0xb0)])/0x3e8,0.1);this['_lastTime']=c,this['tick'](d);}[p(0x95)](){for(const c of this['controllers'])c['dispose']();this['controllers']=[],this['drives']=[];}[p(0xaf)](){const S=p;this['dispose'](),this['bus'][S(0x95)]();}[p(0xd5)](c,d=0x0){const T=p;let e=0x0;for(const f of this['drives']){if(f['node']['userData'][T(0xab)]?.['id']===c){if(e===d)return f;e++;}}return null;}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const a1=b;(function(c,d){const a0=b,e=c();while(!![]){try{const f
|
|
1
|
+
const a1=b;(function(c,d){const a0=b,e=c();while(!![]){try{const f=parseInt(a0(0x1c0))/0x1*(parseInt(a0(0x1b4))/0x2)+parseInt(a0(0x1cf))/0x3*(parseInt(a0(0x20e))/0x4)+parseInt(a0(0x26c))/0x5*(-parseInt(a0(0x1d0))/0x6)+parseInt(a0(0x1d5))/0x7*(parseInt(a0(0x250))/0x8)+parseInt(a0(0x1f8))/0x9+-parseInt(a0(0x294))/0xa*(-parseInt(a0(0x25b))/0xb)+parseInt(a0(0x202))/0xc*(-parseInt(a0(0x270))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x92afc));import{BaseCustomWebComponentConstructorAppend,css,html}from'@gokturk413/base-custom-webcomponent';import{iobrokerHandler}from'../common/IobrokerHandler.js';import{getCustomControlName,generateCustomControl}from'../runtime/CustomControls.js';function b(c,d){c=c-0x1b3;const e=a();let f=e[c];return f;}import'./IobrokerWebui3DScreenPropertiesPanel.js';function a(){const aK=['boxSizing','userData','uuid','_loadScene','sceneBackgroundChanged','color','Save\x20failed','ObjectLoader','find','Saved\x20✓','scriptName','control','stylesheet','forEach','addEventListener','camera','files','appShell','saveScene','editorContainer','sceneGraphChanged','_embedWebComponent','error','some','cssObject','scene','border','Vector3','visible','three/addons/geometries/TextGeometry.js','windowResize','250px','prototype','settings','_resizeObserver','js/commands/SetScriptValueCommand.js','toJSON','padding:2px\x2012px;font-size:11px;color:#556;','click','#three-editor-css','pop','Embed\x20error:','onmouseenter','getObjectByProperty','scriptPanel','_applyElProp','setSize','8jLNnAz','CSS3D\x20not\x20available','getWebuiObject','none','dispatch','Embed\x202D\x20control\x20error:','embeddedControl','_embedDom','set','savingFinished','items','8261Mlrgtj','addControlBtn','three-editor-css-global','\x20added\x20✓','_sizeCss3d','disconnect','toLowerCase','getBindings','warn','disconnectedCallback','has','Loading\x20','#3a6ea8','src','text/json/elementdefintion','objectChanged','execute','5481815pInahY','domElement','_dashCase','label','3523yqWKof','getElements','scene-type','position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:5;overflow:hidden;','length','_setStatus','objectRemoved','getWorldDirection','_editor','value','ctrlPickerList','3dcontrol','2D\x20control\x20added\x20✓','fromJSON','_toggleControlPicker','multiplyScalar','background','_CSS3DObject','alignItems','bottom','Error\x20embedding\x20','show','justifyContent','_css3dScene','defaultAttributes','_editObjectScript','substring','threeScene','sceneTitleLabel','offsetWidth','loader','_css3dRenderer','cssText','js/Resizer.js','11px\x20sans-serif','props','4330poiYmk','getAllNames','122nvazfH','quaternion','cssHeight','removeEventListener','dragover','init','_embedControl','PlaneGeometry','script','contains','dataTransfer','all','10487EiltvI','THREE','registerGeometry','createElement','appendChild','css/main.css','add','js/Script.js','geometry','link','getElementById','innerHTML','anchorUuid','types','Group','6mvrlOX','6DLaQSs','splice','height','embeddedType','ctrlPicker','3477145HpUguq','_reconcileCss3d','defaultHeight','replace','<div\x20style=\x22padding:8px;color:#888;font-size:11px;\x22>Loading…</div>','_css3dItems','signals','action','_makeWidgetEl','rel','objectByUuid','font','../../../3d-editor/','saveObject','div','style','_embed2DControl','setAttribute','animationPanelChanged','objectName','boolean','textContent','3dscreen','DoubleSide','_getNpmWidgets','statusLabel','js/Menubar.js','3D\x20Ctrl:\x20','clientY','define','sceneData','copy','preventDefault','3D\x20Custom\x20Controls','loadFiles','3830157czmYus','offsetHeight','js/Viewport.js','head','traverse','Error\x20embedding\x202D\x20control','parse','_objectScriptMode','application/x-iobroker-2dcontrol','_parsePx','32580OeDwPb','_defaultScript','cssWidth','getKey','overflow','_loadScript','scriptMonaco','isMesh','get','_getDomElement','children','3D\x20screen','1091516XmpdoN','bindings','control\x20not\x20found','objectAdded','//\x203D\x20Scene\x20Script\x0a//\x20Context:\x20THREE,\x20scene,\x20camera,\x20renderer,\x20controls\x0a//\x20assets\x20(Map<name,\x20Object3D>)\x20\x20mixers\x20\x20driveEngine\x0a//\x20setState(signal,\x20val)\x20\x20getState(signal)\x0a//\x20subscribe(signal,\x20cb)\x20→\x20returns\x20unsubscribe\x20fn\x0a//\x20onFrame(fn)\x20\x20onSelect(fn)\x20\x20log(...)\x0a\x0aonFrame((dt,\x20ts)\x20=>\x20{\x0a\x20\x20\x20\x20//\x20Runs\x20every\x20animation\x20frame.\x20dt\x20=\x20delta\x20seconds.\x0a});\x0a','name','matrixWorld','dom','Quaternion','scripts','width','_hideControlPicker','script[src=\x22','onerror','min','display','tag','_SetScriptValueCommand','_sendScriptToEditor'];a=function(){return aK;};return a();}import'./IobrokerWebuiMonacoEditor.js';const CSS3D_SCALE=0.01,EDITOR_BASE=new URL(a1(0x1e1),import.meta.url)['href'];export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstructorAppend{static ['template']=html`
|
|
2
2
|
<div id="root" style="width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-family:Helvetica,Arial,sans-serif;font-size:14px;position:relative;">
|
|
3
3
|
|
|
4
4
|
<!-- iobroker toolbar (above the three.js editor) -->
|
|
@@ -34,10 +34,10 @@ const a1=b;(function(c,d){const a0=b,e=c();while(!![]){try{const f=-parseInt(a0(
|
|
|
34
34
|
</div>
|
|
35
35
|
<div id="scriptHandle" style="height:5px;background:#3c3c3c;cursor:ns-resize;flex-shrink:0;display:none;"></div>
|
|
36
36
|
</div>
|
|
37
|
-
`;static [
|
|
37
|
+
`;static ['style']=css`
|
|
38
38
|
:host { display:block;width:100%;height:100%; }
|
|
39
39
|
.tb-btn { padding:3px 10px;background:#3c3c3c;color:#ccc;border:1px solid #555;border-radius:3px;cursor:pointer;font-size:11px;white-space:nowrap; }
|
|
40
40
|
.tb-btn:hover { background:#505050;color:#fff; }
|
|
41
41
|
.tb-btn.primary { background:#0e639c;border-color:#1177bb;color:#fff; }
|
|
42
42
|
.tb-btn.primary:hover { background:#1177bb; }
|
|
43
|
-
`;[a1(0x199)]=null;[a1(0x19d)]=null;['_objectScriptMode']=null;[a1(0x177)]=null;async['connectedCallback'](){const a2=a1,c=this['getAttribute']('scene-name')||a2(0x1e8),d=this['getAttribute']('scene-type')||a2(0x1f2);this['_getDomElement']('sceneTitleLabel')['textContent']=(d===a2(0x169)?'3D\x20Ctrl:\x20':'3D:\x20')+c,this['_setupButtons'](),this['_setupScriptPanel'](),await this['_loadScene'](c,d),await this[a2(0x185)](c,d);}[a1(0x139)](){const a3=a1;if(this[a3(0x1f1)])this[a3(0x1f1)][a3(0x1ad)]();}async['_loadScene'](c,d){const a4=a1;try{this[a4(0x199)]=d===a4(0x169)?await iobrokerHandler[a4(0x1ce)](a4(0x169),c):await iobrokerHandler[a4(0x1dc)](c);if(!this[a4(0x199)])this[a4(0x199)]={'name':c,'threeScene':null,'script':this['_defaultScript'](),'style':''};if(!this[a4(0x199)]['script'])this['sceneData'][a4(0x176)]=this[a4(0x156)]();if(!this[a4(0x199)]['style'])this[a4(0x199)]['style']='';const e=this[a4(0x19c)](a4(0x12c));if(e)e[a4(0x1c3)]=this['sceneData']['script'];}catch(f){console['error'](a4(0x19a),f);}}async[a1(0x165)](){const a5=a1;if(!this[a5(0x199)])return;this['_setStatus']('Saving...');const c=this[a5(0x19c)](a5(0x12c)),d=c?.['value'];if(d!=null)this[a5(0x199)]['script']=d;if(this[a5(0x19d)])this['sceneData'][a5(0x17b)]=this[a5(0x19d)][a5(0x1c0)]();const e=this['_getDomElement'](a5(0x19e));e?.[a5(0x155)]&&(this[a5(0x199)][a5(0x132)]=e['getBindings']());try{const f=this[a5(0x186)](a5(0x1b1))||a5(0x1f2),g=await iobrokerHandler['saveObject'](f,this['sceneData']['name'],this['sceneData']);this[a5(0x180)](g?'Saved\x20✓':'Save\x20failed'),setTimeout(()=>this['_setStatus'](''),0x7d0);}catch(h){console['error'](a5(0x1fe),h),this['_setStatus']('Error\x20saving');}}async['_initThreeEditor'](c,d){const a6=a1,f=this['shadowRoot'];if(f&&!f['querySelector'](a6(0x127))){const L=document[a6(0x1ea)](a6(0x1da));L['id']='three-editor-css',L[a6(0x12b)]='stylesheet',L['href']=EDITOR_BASE+a6(0x1bd),f['appendChild'](L);}await this[a6(0x1c6)](EDITOR_BASE+'js/libs/signals.min.js',!![]),await this['_loadScript'](EDITOR_BASE+a6(0x1ba));if(!document['getElementById'](a6(0x13c))){const M=document[a6(0x1ea)]('link');M['id']='three-editor-css-global',M['rel']=a6(0x190),M['href']=EDITOR_BASE+a6(0x1bd),document[a6(0x1f4)][a6(0x164)](M);}const [g,{TextGeometry:h},{Editor:i},{Viewport:j},{Toolbar:k},{Script:l},{Player:m},{Sidebar:n},{Menubar:o},{Resizer:r},{Animation:t},{AnimationResizer:u},{SetScriptValueCommand:v},{GLTFImportDialog:w},{AddObjectCommand:x}]=await Promise[a6(0x179)]([import('three'),import('three/addons/geometries/TextGeometry.js'),import(EDITOR_BASE+'js/Editor.js'),import(EDITOR_BASE+a6(0x16b)),import(EDITOR_BASE+'js/Toolbar.js'),import(EDITOR_BASE+'js/Script.js'),import(EDITOR_BASE+a6(0x1d1)),import(EDITOR_BASE+'js/Sidebar.js'),import(EDITOR_BASE+'js/Menubar.js'),import(EDITOR_BASE+'js/Resizer.js'),import(EDITOR_BASE+'js/Animation.js'),import(EDITOR_BASE+'js/AnimationResizer.js'),import(EDITOR_BASE+'js/commands/SetScriptValueCommand.js'),import(EDITOR_BASE+a6(0x16c)),import(EDITOR_BASE+a6(0x12a))]);let y,z;try{({CSS3DRenderer:y,CSS3DObject:z}=await import('three/addons/renderers/CSS3DRenderer.js'),this[a6(0x15e)]=z);}catch(N){console['warn'](a6(0x1c7),N);}w[a6(0x16e)]['show']=()=>Promise['resolve']({'asScene':![]}),window[a6(0x1b0)]=g;try{g['ObjectLoader'][a6(0x1cd)](a6(0x14b),h);}catch(O){}const A=new i();this[a6(0x19d)]=A,this['_SetScriptValueCommand']=v,this['_AddObjectCommand']=x;const B=this[a6(0x19c)](a6(0x1b7)),C=new j(A),D=new k(A),E=new l(A),F=new m(A),G=new n(A),H=new o(A),I=new r(A),J=new t(A),K=new u(A);[C,D,E,F,G,H,I,J,K][a6(0x154)](P=>B['appendChild'](P['dom'])),A['signals'][a6(0x1dd)]['add'](P=>{const a7=a6,Q=P!==![];Q?(C[a7(0x1f7)]['style'][a7(0x1ec)]=P+'px',D[a7(0x1f7)][a7(0x14f)]['bottom']=P+0x14+'px'):(C[a7(0x1f7)]['style'][a7(0x1ec)]='',D[a7(0x1f7)]['style'][a7(0x1ec)]=''),A[a7(0x174)]['windowResize']['dispatch']();}),this['_css3dItems']=[];if(y){const P=new g['Scene'](),Q=new y();Q[a6(0x1d2)]['style'][a6(0x17f)]=a6(0x1ac),B[a6(0x164)](Q['domElement']),this['_css3dScene']=P,this['_css3dRenderer']=Q;const R=()=>Q['setSize'](B[a6(0x126)],B['offsetHeight']);R(),this[a6(0x14a)]=R,A['signals']['sceneRendered']['add'](()=>this[a6(0x1a8)]());let S;const T=()=>{clearTimeout(S),S=setTimeout(()=>this['_reconcileCss3d'](),0x32);};A[a6(0x174)][a6(0x18d)][a6(0x181)](T),A[a6(0x174)]['objectAdded']['add'](T),A[a6(0x174)][a6(0x125)][a6(0x181)](T);}if(this[a6(0x199)]?.[a6(0x17b)])try{A[a6(0x182)](this[a6(0x199)]['threeScene']);}catch(U){}this['_reconcileCss3d'](),A['storage'][a6(0x1e3)](()=>{const ab=a6;let V;const W=()=>{const a8=b;if(A['config']['getKey'](a8(0x14d))===![])return;clearTimeout(V),V=setTimeout(()=>{const a9=a8;A['signals']['savingStarted'][a9(0x200)](),setTimeout(()=>{const aa=a9;if(this[aa(0x199)])this[aa(0x199)][aa(0x17b)]=A[aa(0x1c0)]();A[aa(0x174)]['savingFinished']['dispatch']();},0x64);},0x5dc);},X=A['signals'];[X['geometryChanged'],X['objectAdded'],X['objectChanged'],X['objectRemoved'],X[ab(0x1f0)],X['sceneBackgroundChanged'],X[ab(0x173)],X[ab(0x144)],X['sceneGraphChanged'],X['scriptChanged']][ab(0x154)](Y=>Y[ab(0x181)](W));}),document[a6(0x1ae)](a6(0x123),V=>{const ac=a6;(V[ac(0x1c9)]||V[ac(0x134)])&&V['key']==='s'&&B[ac(0x16a)](document['activeElement'])&&(V[ac(0x1a5)](),this[ac(0x165)]());}),A[a6(0x174)][a6(0x151)]['add']((V,W)=>{const ad=a6;this[ad(0x1b2)]({'objectUuid':V['uuid'],'objectName':V['name'],'scriptName':W['name'],'source':W[ad(0x1db)]});}),B[a6(0x1ae)]('dragover',V=>{const ae=a6;V[ae(0x1a5)](),V[ae(0x193)]['dropEffect']='copy';}),B[a6(0x1ae)](a6(0x1a6),V=>{const af=a6;V[af(0x1a5)]();const W=V[af(0x193)]['getData']('application/x-iobroker-3dcontrol');if(W){this['_embedControl'](W,af(0x169));return;}const X=V['dataTransfer'][af(0x1b5)](af(0x16d));if(X){this[af(0x1ff)](X);return;}const Y=V[af(0x193)]['getData']('text/json/elementdefintion');if(Y){try{this[af(0x1fb)](JSON[af(0x194)](Y));}catch(Z){console[af(0x1b3)](Z);}return;}if(V['dataTransfer']['types'][0x0]==='text/plain')return;if(V[af(0x193)]['items'])A[af(0x152)][af(0x1bf)](V[af(0x193)]['items']);else A[af(0x152)]['loadFiles'](V[af(0x193)][af(0x1aa)]);}),this[a6(0x1f1)]=new ResizeObserver(()=>{const ag=a6;A[ag(0x174)]['windowResize']['dispatch'](),this[ag(0x14a)]?.();}),this['_resizeObserver'][a6(0x13e)](B),requestAnimationFrame(()=>{A['signals']['windowResize']['dispatch'](),requestAnimationFrame(()=>{const ah=b;A['signals'][ah(0x131)]['dispatch'](),A['signals']['sceneGraphChanged']['dispatch']();});});}['_editObjectScript'](c){const ai=a1,e=this[ai(0x19c)](ai(0x1ca));if(e?.[ai(0x1a2)]<0x14)e['style']['height']=ai(0x1d4);const f=this['_getDomElement']('scriptMonaco');f&&(this['_objectScriptMode']={'objectUuid':c[ai(0x15f)],'scriptName':c['scriptName']},f[ai(0x1c3)]=c[ai(0x1db)]||''),this['_getDomElement'](ai(0x1fc))[ai(0x12e)]=(c['objectName']||ai(0x140))+'\x20›\x20'+(c['scriptName']||ai(0x176));}['_sendScriptToEditor'](){const aj=a1,c=this[aj(0x19c)]('scriptMonaco'),d=c?.['value']??'';if(this[aj(0x1d7)]&&this[aj(0x19d)]&&this[aj(0x177)]){const e=this[aj(0x19d)]['objectByUuid'](this['_objectScriptMode'][aj(0x15f)]);if(e){const f=this[aj(0x19d)]['scripts'][e['uuid']]||[],g=f[aj(0x1a7)](h=>h[aj(0x18f)]===this['_objectScriptMode']['scriptName']);g&&this[aj(0x19d)][aj(0x1a9)](new this['_SetScriptValueCommand'](this['_editor'],e,g,aj(0x1db),d));}}else this['sceneData']&&(this[aj(0x199)][aj(0x176)]=d);}[a1(0x147)](){const ak=a1,c=this['_getDomElement']('scriptPanel'),d=this['_getDomElement']('scriptHandle'),e=this[ak(0x19c)](ak(0x13b));e?.[ak(0x1ae)]('click',()=>{const al=ak;if(!c)return;c[al(0x14f)][al(0x16f)]=c[al(0x1a2)]<0x14?'250px':'0';}),this[ak(0x19c)](ak(0x1c5))?.['addEventListener']('click',()=>this['_sendScriptToEditor']());let f=null,g=0x0;d?.['addEventListener'](ak(0x1c1),j=>{const am=ak;f=j[am(0x1d9)],g=c?.['offsetHeight']||0x0,document[am(0x1ae)](am(0x14e),h),document['addEventListener']('mouseup',i);});const h=j=>{const an=ak;if(f===null)return;if(c)c['style']['height']=Math[an(0x12d)](0x0,Math['min'](g+(f-j['clientY']),0x258))+'px';},i=()=>{const ao=ak;f=null,document['removeEventListener'](ao(0x14e),h),document[ao(0x1ee)]('mouseup',i);};}['_setupButtons'](){const ap=a1;this[ap(0x19c)](ap(0x1af))?.[ap(0x1ae)](ap(0x128),()=>this[ap(0x165)]()),this['_getDomElement']('addControlBtn')?.['addEventListener'](ap(0x128),()=>this['_toggleControlPicker']()),this[ap(0x19c)]('ctrlPickerClose')?.['addEventListener'](ap(0x128),()=>this['_hideControlPicker']());}async['_toggleControlPicker'](){const aq=a1,c=this[aq(0x19c)](aq(0x1ab));if(!c)return;if(c['style'][aq(0x1a3)]!==aq(0x17e)){this['_hideControlPicker']();return;}const d=this['_getDomElement']('ctrlPickerList');d['innerHTML']=aq(0x17c),c[aq(0x14f)]['display']=aq(0x17d);let f=[],g=[],h=[],i=[];try{f=await iobrokerHandler['getAllNames']('3dcontrol');}catch(k){}try{g=await iobrokerHandler[aq(0x158)](aq(0x1f2));}catch(l){}try{h=await iobrokerHandler[aq(0x158)]('control');}catch(m){}try{i=await this['_getNpmWidgets']();}catch(n){}d[aq(0x13a)]='';const j=(o,r)=>{const ar=aq,t=document['createElement']('div');t['textContent']=o,t[ar(0x14f)]['cssText']='padding:5px\x208px\x203px;font-size:10px;font-weight:bold;color:#7ab4d8;text-transform:uppercase;letter-spacing:.4px;',d['appendChild'](t);if(!r||!r[ar(0x1cb)]){const u=document[ar(0x1ea)]('div');u['textContent']='none',u['style'][ar(0x17f)]='padding:2px\x2012px;font-size:11px;color:#556;',d[ar(0x164)](u);return;}for(const v of r){const w=document['createElement'](ar(0x189));w['textContent']=v['label'],w[ar(0x1f9)]=v['label'],w['style'][ar(0x17f)]=ar(0x1f6),w['onmouseenter']=()=>w['style'][ar(0x187)]='#3a6ea8',w[ar(0x1e2)]=()=>w[ar(0x14f)]['background']='',w[ar(0x149)]=()=>{const as=ar;this[as(0x1c2)](),v[as(0x1c4)]();},d['appendChild'](w);}};j('3D\x20Custom\x20Controls',f['map'](o=>({'label':o,'action':()=>this['_embedControl'](o,'3dcontrol')}))),j('3D\x20Screens',g['map'](o=>({'label':o,'action':()=>this[aq(0x1a4)](o,'3dscreen')}))),j(aq(0x1be),h[aq(0x157)](o=>({'label':o,'action':()=>this[aq(0x1ff)](o)}))),j('Designer\x20Components',i['map'](o=>({'label':o['name']??o[aq(0x1ed)],'action':()=>this['_embedWebComponent'](o)})));}async['_getNpmWidgets'](){const at=a1,c=window['appShell']?.[at(0x1fd)];if(!c?.[at(0x184)])return[];const d=[],f=new Set();for(const g of c['elementsServices']){let h=[];try{h=await g['getElements']();}catch(i){}for(const j of h){if(!j?.[at(0x1ed)]||f[at(0x1f8)](j['tag']))continue;if(j['tag']['startsWith'](at(0x172)))continue;f[at(0x181)](j['tag']),d['push']({'tag':j['tag'],'name':j['name']??j[at(0x1ed)],'defaultWidth':j['defaultWidth'],'defaultHeight':j['defaultHeight'],'defaultAttributes':j[at(0x1df)]});}}return d;}[a1(0x1c2)](){const au=a1,c=this['_getDomElement'](au(0x1ab));if(c)c['style']['display']=au(0x17e);}async[a1(0x1a4)](c,d='3dcontrol'){const av=a1;if(!this[av(0x19d)]||!this[av(0x145)])return;const e=window[av(0x1b0)],f=d==='3dscreen'?av(0x1e7):'control';try{this[av(0x180)]('Loading\x20'+f+'…');let g=c;if(g[0x0]==='/')g=g[av(0x1a1)](0x1);const h=await iobrokerHandler[av(0x1ce)](d,g);if(!h||!h['threeScene']||!h['threeScene'][av(0x1e4)]){this[av(0x180)](f+av(0x1eb)),setTimeout(()=>this['_setStatus'](''),0x7d0);return;}const i=new e[(av(0x168))](),j=await i[av(0x13d)](h['threeScene']['scene']),k=new e['Group']();k['name']=g['split']('/')[av(0x191)](),k['userData'][av(0x1bb)]=g,k['userData']['embeddedType']=d,k[av(0x183)]['props']={};for(const l of[...j['children']]){if(l['isCamera'])continue;k[av(0x181)](l);}this['_editor']['execute'](new this[(av(0x145))](this[av(0x19d)],k)),this['_setStatus'](f+'\x20added\x20✓'),setTimeout(()=>this['_setStatus'](''),0x7d0);}catch(m){console[av(0x178)]('Embed\x20error:',m),this['_setStatus']('Error\x20embedding\x20'+f),setTimeout(()=>this['_setStatus'](''),0x9c4);}}[a1(0x197)](c,d){if(c==null)return d;const e=parseFloat(String(c));return Number['isFinite'](e)?e:d;}async[a1(0x1ff)](c){const aw=a1;if(!this[aw(0x15e)]){this[aw(0x180)](aw(0x1d6));return;}try{let d=c;if(d[0x0]==='/')d=d['substring'](0x1);this['_setStatus'](aw(0x135));const f=await iobrokerHandler['getWebuiObject']('control',d);if(!f){this['_setStatus'](aw(0x1d3)),setTimeout(()=>this['_setStatus'](''),0x7d0);return;}try{generateCustomControl(d,f);}catch(k){}const g=getCustomControlName(d),i=this['_parsePx'](f[aw(0x1a0)]?.[aw(0x18a)],0x12c),j=this['_parsePx'](f['settings']?.['height'],0xc8);this['_embedDom'](g,aw(0x122),d,i,j,null),this[aw(0x180)](aw(0x136)),setTimeout(()=>this['_setStatus'](''),0x7d0);}catch(l){console[aw(0x178)]('Embed\x202D\x20control\x20error:',l),this[aw(0x180)]('Error\x20embedding\x202D\x20control'),setTimeout(()=>this[aw(0x180)](''),0x9c4);}}[a1(0x1fb)](c){const ax=a1;if(!this[ax(0x15e)]){this['_setStatus'](ax(0x1d6));return;}if(!c?.[ax(0x1ed)])return;const d=this[ax(0x197)](c[ax(0x170)],0x12c),e=this['_parsePx'](c['defaultHeight'],0xc8);this[ax(0x14c)](c['tag'],ax(0x15b),c[ax(0x1ed)],d,e,c['defaultAttributes']||null),this['_setStatus'](ax(0x18c)),setTimeout(()=>this['_setStatus'](''),0x7d0);}[a1(0x14c)](c,d,f,g,i,j){const ay=a1,k=window['THREE'],l=this[ay(0x138)](c,g,i,j),m=new this[(ay(0x15e))](l),n=new k[(ay(0x146))](g*CSS3D_SCALE,i*CSS3D_SCALE),o=new k['MeshBasicMaterial']({'color':0x3a6ea8,'transparent':!![],'opacity':0.12,'side':k[ay(0x18e)]}),r=new k['Mesh'](n,o);r['name']=f['split']('/')[ay(0x191)](),r[ay(0x183)][ay(0x1bb)]=f,r[ay(0x183)][ay(0x15c)]=d,r[ay(0x183)][ay(0x192)]=c,r['userData'][ay(0x18b)]=g,r[ay(0x183)][ay(0x1b6)]=i;if(j)r[ay(0x183)][ay(0x19b)]=j;r['userData']['props']={'width':g,'height':i};try{const t=this['_editor'][ay(0x188)],u=new k[(ay(0x1e9))]();t[ay(0x195)](u),r['position'][ay(0x159)](t['position'])[ay(0x181)](u[ay(0x19f)](0x8));}catch(v){}this['_css3dScene']['add'](m),this['_css3dItems'][ay(0x1bc)]({'anchorUuid':r[ay(0x196)],'cssObject':m,'el':l}),this[ay(0x19d)][ay(0x1a9)](new this[(ay(0x145))](this[ay(0x19d)],r));}[a1(0x150)](c){const az=a1;return this['_css3dItems']?.[az(0x1a7)](d=>d['anchorUuid']===c)?.['el']||null;}[a1(0x175)](c,d,e){const aA=a1,f=this[aA(0x1c8)]['find'](h=>h[aA(0x166)]===c);if(!f)return;const g=this['_editor']?.['scene']?.['getObjectByProperty']('uuid',c);g&&(g['userData']['props']=g[aA(0x183)]['props']||{},g['userData']['props'][d]=e),this['_applyElProp'](f['el'],d,e,g);}[a1(0x130)](c){const aB=a1;return c['replace'](/[A-Z]/g,d=>'-'+d[aB(0x137)]());}['_applyElProp'](c,d,f,g){const aC=a1;if(!c)return;if(d===aC(0x18a)||d==='height'){const j=parseFloat(f)||0x0;c[aC(0x14f)][d]=j+'px';if(g){const k=parseFloat(c[aC(0x14f)]['width'])||g['userData']['cssWidth']||0x12c,l=parseFloat(c[aC(0x14f)][aC(0x16f)])||g[aC(0x183)]['cssHeight']||0xc8;g[aC(0x183)][aC(0x18b)]=k,g['userData']['cssHeight']=l;try{const m=window['THREE'];g['geometry']?.['dispose']?.(),g[aC(0x1f5)]=new m[(aC(0x146))](k*CSS3D_SCALE,l*CSS3D_SCALE);}catch(n){}}return;}if(d===aC(0x12e)){c[aC(0x12e)]=f??'';return;}if(d==='innerHTML'){c['innerHTML']=f??'';return;}const i=this['_dashCase'](d);if(typeof f===aC(0x13f)){try{c[d]=f;}catch(o){}try{if(f)c[aC(0x1de)](i,'');else c['removeAttribute'](i);}catch(r){}return;}try{c[d]=f;}catch(t){}try{if(f!==null&&f!==undefined&&typeof f!==aC(0x1d5))c['setAttribute'](i,f);}catch(u){}}[a1(0x138)](c,d,f,g){const aD=a1;let i;try{i=document[aD(0x1ea)](c);}catch(j){i=document['createElement'](aD(0x189)),i['textContent']=c;}i['style'][aD(0x18a)]=d+'px',i[aD(0x14f)]['height']=f+'px',i['style'][aD(0x160)]='border-box',i[aD(0x14f)]['overflow']=aD(0x161);if(g)for(const l in g){try{i[aD(0x1de)](l,g[l]);}catch(m){}}if(!customElements['get'](c)&&c[aD(0x1e5)]('-')){i['style']['background']=aD(0x1cf),i[aD(0x14f)][aD(0x171)]='1px\x20dashed\x20#3a6ea8',i[aD(0x14f)]['color']='#9cc',i[aD(0x14f)][aD(0x1d0)]='11px\x20sans-serif',i['style'][aD(0x1a3)]=aD(0x17d),i[aD(0x14f)]['alignItems']='center',i['style'][aD(0x1b8)]='center';if(!i['textContent'])i['textContent']=c;}return i;}async[a1(0x1b9)](){const aE=a1;if(!this[aE(0x148)]||!this['_editor'])return;const c=this['_editor']['scene'],d=new Set(),f=[];c['traverse'](g=>{const aF=aE,j=g[aF(0x183)]?.[aF(0x15c)];if(g['isMesh']&&(j===aF(0x122)||j===aF(0x15b)))f['push'](g);});for(const g of f){d[aE(0x181)](g[aE(0x196)]);if(this['_css3dItems'][aE(0x142)](o=>o['anchorUuid']===g[aE(0x196)]))continue;const j=g[aE(0x183)]['embeddedTag'],k=g[aE(0x183)][aE(0x18b)]||0x12c,l=g[aE(0x183)]['cssHeight']||0xc8;if(g['userData'][aE(0x15c)]==='control')try{const o=await iobrokerHandler[aE(0x1ce)](aE(0x122),g['userData']['embeddedControl']);if(o)generateCustomControl(g[aE(0x183)][aE(0x1bb)],o);}catch(r){}const m=this[aE(0x138)](j,k,l,g[aE(0x183)]['embeddedAttrs']),n=new this['_CSS3DObject'](m);this[aE(0x148)][aE(0x181)](n),this[aE(0x1c8)][aE(0x1bc)]({'anchorUuid':g['uuid'],'cssObject':n,'el':m});}for(let t=this[aE(0x1c8)][aE(0x1cb)]-0x1;t>=0x0;t--){!d[aE(0x1f8)](this['_css3dItems'][t][aE(0x166)])&&(this['_css3dScene'][aE(0x124)](this['_css3dItems'][t][aE(0x1e1)]),this['_css3dItems']['splice'](t,0x1));}}[a1(0x1a8)](){const aG=a1;if(!this['_css3dRenderer']||!this[aG(0x148)]||!this[aG(0x19d)])return;const c=window['THREE'];if(!this[aG(0x1b4)])this[aG(0x1b4)]={'p':new c[(aG(0x1e9))](),'q':new c['Quaternion'](),'s':new c[(aG(0x1e9))]()};const {p:d,q:e,s:f}=this['_css3dTmp'],g=this[aG(0x19d)][aG(0x1e4)],h=this['_editor'][aG(0x133)];for(const i of this[aG(0x1c8)]){const j=g['getObjectByProperty']('uuid',i[aG(0x166)]);if(!j){i['cssObject'][aG(0x15a)]=![];continue;}j[aG(0x1ef)](!![],![]),j['matrixWorld']['decompose'](d,e,f),i['cssObject'][aG(0x201)]['copy'](d),i['cssObject']['quaternion'][aG(0x159)](h['quaternion']),i[aG(0x1e1)][aG(0x153)]['set'](f['x']*CSS3D_SCALE,f['y']*CSS3D_SCALE,f['z']*CSS3D_SCALE),i['cssObject'][aG(0x15a)]=j[aG(0x15a)];}this['_css3dRenderer']['render'](this[aG(0x148)],h);}[a1(0x180)](c){const aH=a1,d=this['_getDomElement'](aH(0x1e6));if(d)d['textContent']=c;}[a1(0x1c6)](c,d=![]){return new Promise(e=>{const aI=b;if(document['querySelector'](aI(0x1f3)+c+'\x22]')){e();return;}const f=document[aI(0x1ea)](aI(0x176));f[aI(0x1cc)]=c;const g=d?window['define']:undefined;if(d)window['define']=undefined;f[aI(0x143)]=()=>{const aJ=aI;if(d)window[aJ(0x15d)]=g;e();},f['onerror']=()=>{if(d)window['define']=g;e();},document['head'][aI(0x164)](f);});}[a1(0x156)](){return'//\x203D\x20Scene\x20Script\x0a//\x20Context:\x20THREE,\x20scene,\x20camera,\x20renderer,\x20controls\x0a//\x20assets\x20(Map<name,\x20Object3D>)\x20\x20mixers\x20\x20driveEngine\x0a//\x20setState(signal,\x20val)\x20\x20getState(signal)\x0a//\x20subscribe(signal,\x20cb)\x20→\x20returns\x20unsubscribe\x20fn\x0a//\x20onFrame(fn)\x20\x20onSelect(fn)\x20\x20log(...)\x0a\x0aonFrame((dt,\x20ts)\x20=>\x20{\x0a\x20\x20\x20\x20//\x20Runs\x20every\x20animation\x20frame.\x20dt\x20=\x20delta\x20seconds.\x0a});\x0a';}}customElements[a1(0x15d)]('iobroker-webui-3dscreen-editor',IobrokerWebui3DScreenEditor);
|
|
43
|
+
`;[a1(0x1f3)]=null;['_editor']=null;['_objectScriptMode']=null;['_SetScriptValueCommand']=null;async['connectedCallback'](){const a2=a1,c=this['getAttribute']('scene-name')||'new-scene',d=this['getAttribute'](a2(0x272))||a2(0x1eb);this[a2(0x20b)](a2(0x28c))['textContent']=(d===a2(0x27b)?a2(0x1f0):'3D:\x20')+c,this['_setupButtons'](),this['_setupScriptPanel'](),await this[a2(0x224)](c,d),await this['_initThreeEditor'](c,d);}[a1(0x264)](){const a3=a1;if(this['_resizeObserver'])this[a3(0x243)][a3(0x260)]();}async['_loadScene'](c,d){const a4=a1;try{this['sceneData']=d===a4(0x27b)?await iobrokerHandler['getWebuiObject']('3dcontrol',c):await iobrokerHandler['get3DScreen'](c);if(!this['sceneData'])this[a4(0x1f3)]={'name':c,'threeScene':null,'script':this['_defaultScript'](),'style':''};if(!this['sceneData'][a4(0x1bc)])this['sceneData'][a4(0x1bc)]=this[a4(0x203)]();if(!this[a4(0x1f3)]['style'])this[a4(0x1f3)]['style']='';const e=this['_getDomElement'](a4(0x208));if(e)e['value']=this[a4(0x1f3)][a4(0x1bc)];}catch(f){console['error']('3D\x20Editor\x20load\x20error:',f);}}async['saveScene'](){const a5=a1;if(!this[a5(0x1f3)])return;this[a5(0x275)]('Saving...');const c=this[a5(0x20b)](a5(0x208)),d=c?.[a5(0x279)];if(d!=null)this[a5(0x1f3)]['script']=d;if(this['_editor'])this['sceneData'][a5(0x28b)]=this[a5(0x278)][a5(0x245)]();const e=this['_getDomElement']('iobPropPanel');e?.[a5(0x262)]&&(this['sceneData'][a5(0x20f)]=e['getBindings']());try{const f=this['getAttribute']('scene-type')||'3dscreen',g=await iobrokerHandler[a5(0x1e2)](f,this[a5(0x1f3)][a5(0x213)],this[a5(0x1f3)]);this[a5(0x275)](g?a5(0x22a):a5(0x227)),setTimeout(()=>this['_setStatus'](''),0x7d0);}catch(h){console[a5(0x237)]('Save\x20error:',h),this[a5(0x275)]('Error\x20saving');}}async['_initThreeEditor'](c,d){const a6=a1,f=this['shadowRoot'];if(f&&!f['querySelector'](a6(0x248))){const L=document[a6(0x1c3)](a6(0x1c9));L['id']='three-editor-css',L[a6(0x1de)]=a6(0x22d),L['href']=EDITOR_BASE+a6(0x1c5),f[a6(0x1c4)](L);}await this[a6(0x207)](EDITOR_BASE+'js/libs/signals.min.js',!![]),await this['_loadScript'](EDITOR_BASE+'js/libs/jsonlint.js');if(!document[a6(0x1ca)](a6(0x25d))){const M=document['createElement'](a6(0x1c9));M['id']='three-editor-css-global',M[a6(0x1de)]=a6(0x22d),M['href']=EDITOR_BASE+a6(0x1c5),document['head']['appendChild'](M);}const [g,{TextGeometry:h},{Editor:i},{Viewport:j},{Toolbar:k},{Script:l},{Player:m},{Sidebar:n},{Menubar:o},{Resizer:r},{Animation:t},{AnimationResizer:u},{SetScriptValueCommand:v},{GLTFImportDialog:w},{AddObjectCommand:x}]=await Promise[a6(0x1bf)]([import('three'),import(a6(0x23e)),import(EDITOR_BASE+'js/Editor.js'),import(EDITOR_BASE+a6(0x1fa)),import(EDITOR_BASE+'js/Toolbar.js'),import(EDITOR_BASE+a6(0x1c7)),import(EDITOR_BASE+'js/Player.js'),import(EDITOR_BASE+'js/Sidebar.js'),import(EDITOR_BASE+a6(0x1ef)),import(EDITOR_BASE+a6(0x291)),import(EDITOR_BASE+'js/Animation.js'),import(EDITOR_BASE+'js/AnimationResizer.js'),import(EDITOR_BASE+a6(0x244)),import(EDITOR_BASE+'js/GLTFImportDialog.js'),import(EDITOR_BASE+'js/commands/AddObjectCommand.js')]);let y,z;try{({CSS3DRenderer:y,CSS3DObject:z}=await import('three/addons/renderers/CSS3DRenderer.js'),this[a6(0x281)]=z);}catch(N){console[a6(0x263)]('CSS3DRenderer\x20not\x20available:',N);}w[a6(0x241)][a6(0x285)]=()=>Promise['resolve']({'asScene':![]}),window['THREE']=g;try{g[a6(0x228)][a6(0x1c2)]('TextGeometry',h);}catch(O){}const A=new i();this['_editor']=A,this['_SetScriptValueCommand']=v,this['_AddObjectCommand']=x;const B=this[a6(0x20b)](a6(0x234)),C=new j(A),D=new k(A),E=new l(A),F=new m(A),G=new n(A),H=new o(A),I=new r(A),J=new t(A),K=new u(A);[C,D,E,F,G,H,I,J,K][a6(0x22e)](P=>B[a6(0x1c4)](P['dom'])),A[a6(0x1db)][a6(0x1e7)]['add'](P=>{const a7=a6,Q=P!==![];Q?(C[a7(0x215)]['style']['bottom']=P+'px',D[a7(0x215)]['style']['bottom']=P+0x14+'px'):(C[a7(0x215)][a7(0x1e4)]['bottom']='',D['dom']['style'][a7(0x283)]=''),A[a7(0x1db)]['windowResize']['dispatch']();}),this[a6(0x1da)]=[];if(y){const P=new g['Scene'](),Q=new y();Q[a6(0x26d)][a6(0x1e4)][a6(0x290)]=a6(0x273),B[a6(0x1c4)](Q[a6(0x26d)]),this['_css3dScene']=P,this['_css3dRenderer']=Q;const R=()=>Q[a6(0x24f)](B[a6(0x28d)],B['offsetHeight']);R(),this['_sizeCss3d']=R,A['signals']['sceneRendered']['add'](()=>this['_renderCss3d']());let S;const T=()=>{clearTimeout(S),S=setTimeout(()=>this['_reconcileCss3d'](),0x32);};A[a6(0x1db)]['sceneGraphChanged']['add'](T),A[a6(0x1db)][a6(0x211)]['add'](T),A['signals']['objectRemoved']['add'](T);}if(this[a6(0x1f3)]?.[a6(0x28b)])try{A[a6(0x27d)](this[a6(0x1f3)][a6(0x28b)]);}catch(U){}this[a6(0x1d6)](),A['storage'][a6(0x1b9)](()=>{const aa=a6;let V;const W=()=>{const a8=b;if(A['config'][a8(0x205)]('autosave')===![])return;clearTimeout(V),V=setTimeout(()=>{A['signals']['savingStarted']['dispatch'](),setTimeout(()=>{const a9=b;if(this[a9(0x1f3)])this['sceneData'][a9(0x28b)]=A[a9(0x245)]();A[a9(0x1db)][a9(0x259)][a9(0x254)]();},0x64);},0x5dc);},X=A[aa(0x1db)];[X['geometryChanged'],X['objectAdded'],X[aa(0x26a)],X[aa(0x276)],X['materialChanged'],X[aa(0x225)],X['sceneEnvironmentChanged'],X['sceneFogChanged'],X[aa(0x235)],X['scriptChanged']][aa(0x22e)](Y=>Y[aa(0x1c6)](W));}),document['addEventListener']('keydown',V=>{const ab=a6;(V['ctrlKey']||V['metaKey'])&&V['key']==='s'&&B[ab(0x1bd)](document['activeElement'])&&(V['preventDefault'](),this[ab(0x233)]());}),A[a6(0x1db)]['editScript']['add']((V,W)=>{const ac=a6;this['_editObjectScript']({'objectUuid':V['uuid'],'objectName':V['name'],'scriptName':W[ac(0x213)],'source':W['source']});}),B['addEventListener'](a6(0x1b8),V=>{const ad=a6;V['preventDefault'](),V['dataTransfer']['dropEffect']=ad(0x1f4);}),B[a6(0x22f)]('drop',V=>{const ae=a6;V[ae(0x1f5)]();const W=V['dataTransfer']['getData']('application/x-iobroker-3dcontrol');if(W){this['_embedControl'](W,ae(0x27b));return;}const X=V[ae(0x1be)]['getData'](ae(0x200));if(X){this[ae(0x1e5)](X);return;}const Y=V['dataTransfer']['getData'](ae(0x269));if(Y){try{this[ae(0x236)](JSON[ae(0x1fe)](Y));}catch(Z){console[ae(0x263)](Z);}return;}if(V[ae(0x1be)][ae(0x1cd)][0x0]==='text/plain')return;if(V[ae(0x1be)][ae(0x25a)])A[ae(0x28e)]['loadItemList'](V['dataTransfer']['items']);else A['loader'][ae(0x1f7)](V['dataTransfer'][ae(0x231)]);}),this[a6(0x243)]=new ResizeObserver(()=>{const af=a6;A[af(0x1db)][af(0x23f)][af(0x254)](),this[af(0x25f)]?.();}),this[a6(0x243)]['observe'](B),requestAnimationFrame(()=>{const ag=a6;A['signals'][ag(0x23f)][ag(0x254)](),requestAnimationFrame(()=>{const ah=ag;A['signals'][ah(0x23f)][ah(0x254)](),A[ah(0x1db)]['sceneGraphChanged']['dispatch']();});});}[a1(0x289)](c){const ai=a1,e=this[ai(0x20b)](ai(0x24d));if(e?.[ai(0x1f9)]<0x14)e['style'][ai(0x1d2)]=ai(0x240);const f=this[ai(0x20b)](ai(0x208));f&&(this[ai(0x1ff)]={'objectUuid':c['objectUuid'],'scriptName':c['scriptName']},f[ai(0x279)]=c['source']||''),this[ai(0x20b)]('sceneTitleLabel')[ai(0x1ea)]=(c[ai(0x1e8)]||'Object')+'\x20›\x20'+(c['scriptName']||ai(0x1bc));}[a1(0x220)](){const aj=a1,c=this['_getDomElement'](aj(0x208)),d=c?.[aj(0x279)]??'';if(this['_objectScriptMode']&&this['_editor']&&this[aj(0x21f)]){const e=this['_editor'][aj(0x1df)](this['_objectScriptMode']['objectUuid']);if(e){const f=this[aj(0x278)][aj(0x217)][e['uuid']]||[],g=f['find'](h=>h[aj(0x213)]===this[aj(0x1ff)][aj(0x22b)]);g&&this[aj(0x278)][aj(0x26b)](new this[(aj(0x21f))](this[aj(0x278)],e,g,'source',d));}}else this[aj(0x1f3)]&&(this[aj(0x1f3)]['script']=d);}['_setupScriptPanel'](){const ak=a1,c=this['_getDomElement'](ak(0x24d)),d=this['_getDomElement']('scriptHandle'),e=this['_getDomElement']('scriptToggleBtn');e?.['addEventListener'](ak(0x247),()=>{const al=ak;if(!c)return;c[al(0x1e4)]['height']=c[al(0x1f9)]<0x14?'250px':'0';}),this['_getDomElement']('runScriptBtn')?.[ak(0x22f)](ak(0x247),()=>this[ak(0x220)]());let f=null,g=0x0;d?.[ak(0x22f)]('mousedown',j=>{const am=ak;f=j['clientY'],g=c?.[am(0x1f9)]||0x0,document[am(0x22f)]('mousemove',h),document['addEventListener']('mouseup',i);});const h=j=>{const an=ak;if(f===null)return;if(c)c[an(0x1e4)]['height']=Math['max'](0x0,Math[an(0x21c)](g+(f-j[an(0x1f1)]),0x258))+'px';},i=()=>{const ao=ak;f=null,document[ao(0x1b7)]('mousemove',h),document['removeEventListener']('mouseup',i);};}['_setupButtons'](){const ap=a1;this['_getDomElement']('saveBtn')?.['addEventListener']('click',()=>this[ap(0x233)]()),this[ap(0x20b)](ap(0x25c))?.['addEventListener']('click',()=>this[ap(0x27e)]()),this['_getDomElement']('ctrlPickerClose')?.['addEventListener'](ap(0x247),()=>this[ap(0x219)]());}async[a1(0x27e)](){const aq=a1,c=this['_getDomElement'](aq(0x1d4));if(!c)return;if(c['style'][aq(0x21d)]!=='none'){this[aq(0x219)]();return;}const d=this[aq(0x20b)](aq(0x27a));d['innerHTML']=aq(0x1d9),c['style']['display']='flex';let f=[],g=[],h=[],i=[];try{f=await iobrokerHandler[aq(0x1b3)]('3dcontrol');}catch(k){}try{g=await iobrokerHandler[aq(0x1b3)](aq(0x1eb));}catch(l){}try{h=await iobrokerHandler[aq(0x1b3)]('control');}catch(m){}try{i=await this['_getNpmWidgets']();}catch(n){}d['innerHTML']='';const j=(o,r)=>{const ar=aq,t=document['createElement'](ar(0x1e3));t['textContent']=o,t[ar(0x1e4)][ar(0x290)]='padding:5px\x208px\x203px;font-size:10px;font-weight:bold;color:#7ab4d8;text-transform:uppercase;letter-spacing:.4px;',d['appendChild'](t);if(!r||!r[ar(0x274)]){const u=document['createElement']('div');u['textContent']=ar(0x253),u[ar(0x1e4)][ar(0x290)]=ar(0x246),d[ar(0x1c4)](u);return;}for(const v of r){const w=document[ar(0x1c3)](ar(0x1e3));w[ar(0x1ea)]=v[ar(0x26f)],w['title']=v[ar(0x26f)],w[ar(0x1e4)][ar(0x290)]='padding:6px\x2012px;font-size:12px;color:#c8cdd5;cursor:pointer;border-radius:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;',w[ar(0x24b)]=()=>w[ar(0x1e4)][ar(0x280)]=ar(0x267),w['onmouseleave']=()=>w['style']['background']='',w['onclick']=()=>{const as=ar;this['_hideControlPicker'](),v[as(0x1dc)]();},d['appendChild'](w);}};j(aq(0x1f6),f['map'](o=>({'label':o,'action':()=>this['_embedControl'](o,aq(0x27b))}))),j('3D\x20Screens',g['map'](o=>({'label':o,'action':()=>this[aq(0x1ba)](o,aq(0x1eb))}))),j('2D\x20Custom\x20Controls',h['map'](o=>({'label':o,'action':()=>this['_embed2DControl'](o)}))),j('Designer\x20Components',i['map'](o=>({'label':o[aq(0x213)]??o[aq(0x21e)],'action':()=>this['_embedWebComponent'](o)})));}async[a1(0x1ed)](){const at=a1,c=window[at(0x232)]?.['serviceContainer'];if(!c?.['elementsServices'])return[];const d=[],f=new Set();for(const g of c['elementsServices']){let h=[];try{h=await g[at(0x271)]();}catch(i){}for(const j of h){if(!j?.['tag']||f[at(0x265)](j['tag']))continue;if(j['tag']['startsWith']('webui-'))continue;f[at(0x1c6)](j[at(0x21e)]),d['push']({'tag':j['tag'],'name':j['name']??j['tag'],'defaultWidth':j['defaultWidth'],'defaultHeight':j[at(0x1d7)],'defaultAttributes':j['defaultAttributes']});}}return d;}[a1(0x219)](){const au=a1,c=this['_getDomElement']('ctrlPicker');if(c)c['style'][au(0x21d)]=au(0x253);}async[a1(0x1ba)](c,d='3dcontrol'){const av=a1;if(!this['_editor']||!this['_AddObjectCommand'])return;const e=window['THREE'],f=d==='3dscreen'?av(0x20d):av(0x22c);try{this['_setStatus'](av(0x266)+f+'…');let g=c;if(g[0x0]==='/')g=g[av(0x28a)](0x1);const h=await iobrokerHandler[av(0x252)](d,g);if(!h||!h['threeScene']||!h['threeScene']['scene']){this['_setStatus'](f+'\x20has\x20no\x203D\x20scene'),setTimeout(()=>this[av(0x275)](''),0x7d0);return;}const i=new e['ObjectLoader'](),j=await i['parseAsync'](h[av(0x28b)]['scene']),k=new e[(av(0x1ce))]();k[av(0x213)]=g['split']('/')[av(0x249)](),k['userData'][av(0x256)]=g,k[av(0x222)][av(0x1d3)]=d,k[av(0x222)]['props']={};for(const l of[...j[av(0x20c)]]){if(l['isCamera'])continue;k['add'](l);}this['_editor'][av(0x26b)](new this['_AddObjectCommand'](this[av(0x278)],k)),this['_setStatus'](f+av(0x25e)),setTimeout(()=>this['_setStatus'](''),0x7d0);}catch(m){console['error'](av(0x24a),m),this[av(0x275)](av(0x284)+f),setTimeout(()=>this['_setStatus'](''),0x9c4);}}['_parsePx'](c,d){if(c==null)return d;const e=parseFloat(String(c));return Number['isFinite'](e)?e:d;}async['_embed2DControl'](c){const aw=a1;if(!this['_CSS3DObject']){this[aw(0x275)]('CSS3D\x20not\x20available');return;}try{let d=c;if(d[0x0]==='/')d=d[aw(0x28a)](0x1);this['_setStatus']('Loading\x202D\x20control…');const f=await iobrokerHandler['getWebuiObject']('control',d);if(!f){this[aw(0x275)](aw(0x210)),setTimeout(()=>this['_setStatus'](''),0x7d0);return;}try{generateCustomControl(d,f);}catch(k){}const g=getCustomControlName(d),i=this['_parsePx'](f[aw(0x242)]?.[aw(0x218)],0x12c),j=this[aw(0x201)](f['settings']?.['height'],0xc8);this[aw(0x257)](g,'control',d,i,j,null),this['_setStatus'](aw(0x27c)),setTimeout(()=>this[aw(0x275)](''),0x7d0);}catch(l){console['error'](aw(0x255),l),this[aw(0x275)](aw(0x1fd)),setTimeout(()=>this[aw(0x275)](''),0x9c4);}}[a1(0x236)](c){const ax=a1;if(!this['_CSS3DObject']){this[ax(0x275)](ax(0x251));return;}if(!c?.[ax(0x21e)])return;const d=this[ax(0x201)](c['defaultWidth'],0x12c),e=this['_parsePx'](c['defaultHeight'],0xc8);this['_embedDom'](c[ax(0x21e)],'npm',c[ax(0x21e)],d,e,c[ax(0x288)]||null),this['_setStatus']('widget\x20added\x20✓'),setTimeout(()=>this['_setStatus'](''),0x7d0);}['_embedDom'](c,d,f,g,i,j){const ay=a1,k=window['THREE'],l=this['_makeWidgetEl'](c,g,i,j),m=new this['_CSS3DObject'](l),n=new k['PlaneGeometry'](g*CSS3D_SCALE,i*CSS3D_SCALE),o=new k['MeshBasicMaterial']({'color':0x3a6ea8,'transparent':!![],'opacity':0.12,'side':k[ay(0x1ec)]}),r=new k['Mesh'](n,o);r[ay(0x213)]=f['split']('/')[ay(0x249)](),r[ay(0x222)]['embeddedControl']=f,r[ay(0x222)]['embeddedType']=d,r['userData']['embeddedTag']=c,r['userData'][ay(0x204)]=g,r['userData'][ay(0x1b6)]=i;if(j)r['userData']['embeddedAttrs']=j;r[ay(0x222)]['props']={'width':g,'height':i};try{const t=this[ay(0x278)][ay(0x230)],u=new k[(ay(0x23c))]();t[ay(0x277)](u),r['position']['copy'](t['position'])['add'](u[ay(0x27f)](0x8));}catch(v){}this[ay(0x287)]['add'](m),this['_css3dItems']['push']({'anchorUuid':r[ay(0x223)],'cssObject':m,'el':l}),this[ay(0x278)]['execute'](new this['_AddObjectCommand'](this['_editor'],r));}['getEmbeddedElement'](c){const az=a1;return this[az(0x1da)]?.['find'](d=>d['anchorUuid']===c)?.['el']||null;}['applyEmbeddedProp'](c,d,e){const aA=a1,f=this[aA(0x1da)][aA(0x229)](h=>h[aA(0x1cc)]===c);if(!f)return;const g=this[aA(0x278)]?.['scene']?.['getObjectByProperty']('uuid',c);g&&(g[aA(0x222)][aA(0x293)]=g['userData']['props']||{},g['userData'][aA(0x293)][d]=e),this['_applyElProp'](f['el'],d,e,g);}[a1(0x26e)](c){const aB=a1;return c[aB(0x1d8)](/[A-Z]/g,d=>'-'+d[aB(0x261)]());}[a1(0x24e)](c,d,f,g){const aC=a1;if(!c)return;if(d===aC(0x218)||d==='height'){const j=parseFloat(f)||0x0;c[aC(0x1e4)][d]=j+'px';if(g){const k=parseFloat(c['style'][aC(0x218)])||g['userData'][aC(0x204)]||0x12c,l=parseFloat(c['style'][aC(0x1d2)])||g['userData'][aC(0x1b6)]||0xc8;g[aC(0x222)]['cssWidth']=k,g[aC(0x222)]['cssHeight']=l;try{const m=window[aC(0x1c1)];g[aC(0x1c8)]?.['dispose']?.(),g['geometry']=new m[(aC(0x1bb))](k*CSS3D_SCALE,l*CSS3D_SCALE);}catch(n){}}return;}if(d===aC(0x1ea)){c[aC(0x1ea)]=f??'';return;}if(d===aC(0x1cb)){c[aC(0x1cb)]=f??'';return;}const i=this[aC(0x26e)](d);if(typeof f===aC(0x1e9)){try{c[d]=f;}catch(o){}try{if(f)c['setAttribute'](i,'');else c['removeAttribute'](i);}catch(r){}return;}try{c[d]=f;}catch(t){}try{if(f!==null&&f!==undefined&&typeof f!=='object')c['setAttribute'](i,f);}catch(u){}}[a1(0x1dd)](c,d,f,g){const aD=a1;let i;try{i=document[aD(0x1c3)](c);}catch(j){i=document['createElement']('div'),i[aD(0x1ea)]=c;}i['style']['width']=d+'px',i['style'][aD(0x1d2)]=f+'px',i[aD(0x1e4)][aD(0x221)]='border-box',i['style'][aD(0x206)]='hidden';if(g)for(const l in g){try{i[aD(0x1e6)](l,g[l]);}catch(m){}}if(!customElements[aD(0x20a)](c)&&c['includes']('-')){i[aD(0x1e4)][aD(0x280)]='rgba(58,110,168,0.15)',i[aD(0x1e4)][aD(0x23b)]='1px\x20dashed\x20#3a6ea8',i['style'][aD(0x226)]='#9cc',i['style'][aD(0x1e0)]=aD(0x292),i[aD(0x1e4)][aD(0x21d)]='flex',i[aD(0x1e4)][aD(0x282)]='center',i['style'][aD(0x286)]='center';if(!i[aD(0x1ea)])i[aD(0x1ea)]=c;}return i;}async[a1(0x1d6)](){const aE=a1;if(!this[aE(0x287)]||!this[aE(0x278)])return;const c=this[aE(0x278)]['scene'],d=new Set(),f=[];c[aE(0x1fc)](g=>{const aF=aE,j=g[aF(0x222)]?.['embeddedType'];if(g[aF(0x209)]&&(j==='control'||j==='npm'))f['push'](g);});for(const g of f){d[aE(0x1c6)](g['uuid']);if(this['_css3dItems'][aE(0x238)](o=>o['anchorUuid']===g[aE(0x223)]))continue;const j=g['userData']['embeddedTag'],k=g[aE(0x222)][aE(0x204)]||0x12c,l=g[aE(0x222)][aE(0x1b6)]||0xc8;if(g['userData']['embeddedType']==='control')try{const o=await iobrokerHandler['getWebuiObject']('control',g[aE(0x222)]['embeddedControl']);if(o)generateCustomControl(g[aE(0x222)]['embeddedControl'],o);}catch(r){}const m=this['_makeWidgetEl'](j,k,l,g[aE(0x222)]['embeddedAttrs']),n=new this['_CSS3DObject'](m);this[aE(0x287)][aE(0x1c6)](n),this[aE(0x1da)]['push']({'anchorUuid':g['uuid'],'cssObject':n,'el':m});}for(let t=this[aE(0x1da)][aE(0x274)]-0x1;t>=0x0;t--){!d['has'](this['_css3dItems'][t]['anchorUuid'])&&(this['_css3dScene']['remove'](this['_css3dItems'][t]['cssObject']),this[aE(0x1da)][aE(0x1d1)](t,0x1));}}['_renderCss3d'](){const aG=a1;if(!this[aG(0x28f)]||!this[aG(0x287)]||!this[aG(0x278)])return;const c=window['THREE'];if(!this['_css3dTmp'])this['_css3dTmp']={'p':new c['Vector3'](),'q':new c[(aG(0x216))](),'s':new c[(aG(0x23c))]()};const {p:d,q:e,s:f}=this['_css3dTmp'],g=this[aG(0x278)][aG(0x23a)],h=this['_editor']['viewportCamera'];for(const i of this['_css3dItems']){const j=g[aG(0x24c)](aG(0x223),i['anchorUuid']);if(!j){i[aG(0x239)]['visible']=![];continue;}j['updateWorldMatrix'](!![],![]),j[aG(0x214)]['decompose'](d,e,f),i['cssObject']['position']['copy'](d),i[aG(0x239)][aG(0x1b5)]['copy'](h[aG(0x1b5)]),i[aG(0x239)]['scale'][aG(0x258)](f['x']*CSS3D_SCALE,f['y']*CSS3D_SCALE,f['z']*CSS3D_SCALE),i['cssObject']['visible']=j[aG(0x23d)];}this[aG(0x28f)]['render'](this[aG(0x287)],h);}[a1(0x275)](c){const aH=a1,d=this['_getDomElement'](aH(0x1ee));if(d)d[aH(0x1ea)]=c;}[a1(0x207)](c,d=![]){return new Promise(e=>{const aI=b;if(document['querySelector'](aI(0x21a)+c+'\x22]')){e();return;}const f=document[aI(0x1c3)]('script');f[aI(0x268)]=c;const g=d?window[aI(0x1f2)]:undefined;if(d)window[aI(0x1f2)]=undefined;f['onload']=()=>{if(d)window['define']=g;e();},f[aI(0x21b)]=()=>{if(d)window['define']=g;e();},document[aI(0x1fb)][aI(0x1c4)](f);});}['_defaultScript'](){const aJ=a1;return aJ(0x212);}}customElements[a1(0x1f2)]('iobroker-webui-3dscreen-editor',IobrokerWebui3DScreenEditor);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const F=b;
|
|
1
|
+
const F=b;function b(c,d){c=c-0x196;const e=a();let f=e[c];return f;}function a(){const av=['_refreshGrid','value','trim','toLowerCase','propertyType','position','3D\x20bind\x20import\x20error:','set','Css','active','remove','_buildProxy','position.z','embeddedControl','3D\x20bind\x20dialog:\x20missing\x20uuid/key/appShell','onchange','3dcontrol','_propsValueTypeInfo','title','uuid','getHexString','rotationY','style','querySelector','length','category','div','positionY','_safeSetSelected','10386uXHMQi','toFixed','applyEmbeddedProp','getEmbeddedElement','positionZ','_loadElementDefs','5262955ImWkBK','dataset','cssHeight','_proxy','Scale','innerHTML','./IobrokerWebuiBindingsEditor.js','ctxMenu','propsPane','textContent','define','open','opacity','dynamicDefs','includes','_editorHost','_injectDark','cursor:pointer;z-index:5;','getElementById','iobroker-webui-3dscreen-properties','instance','[\x22a\x22,\x22b\x22]','pgHost','prompt','display','_tree','newValue','select','className','Visible','enum','_activateTab','keys','body','_readElValue','_clearBind','binding','6023118JzDTSq','scaleX','bindings','objName','shadowRoot','replaceAll','position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:100000;display:flex;align-items:center;justify-content:center;','width','_cellEditor','props','position.y','userData','1606629EGGVuP','#e08020','type','dispatch','4UmCaDS','_setupTabs','visualizationShell','__propvals','checked','.tab','1511791Jikvvg','_propsCellEditor','_propsPg','sceneData','_selectedObj','name','_injectSquaresInto','push','flex:1;height:20px;','ContentAndId','28410yTXLFK','_onProxyChanged','boolean','Rotation\x20(°)','selected','placeholder','replaceSync','createElement','propsHost','tabbar','string','scale.y','_getDomElement','none','toggle','_selectedInstance','_ctxTarget','_closeMenu','oninput','checkbox','tab','No\x20object\x20selected','_bindings','selectedObject','_ctrlDefsCache','parent','reverse','#ffffff','_appShell','find','signal','740943pMNyke','color','property','key','2sVRbDb','ctxBack','_currentDefs','needsUpdate','scaleZ','scale.x','rotationZ','_pt','error','invert','_injectAllSquares','onclick','disconnectedCallback','_loadControlPropDefs','values','Position','stopPropagation','_flattenProps','map','path','width:11px;height:11px;border:1px\x20solid\x20#4a5f72;box-sizing:border-box;','closest','cancelClicked','3DObject','substring','display:grid;grid-template-columns:1fr\x2090px\x201fr\x201fr\x2028px;gap:3px;','material','scaleY','expanded','.bsq3d','target','.cmItem','flex:1;width:100%;color:#e08020;font-family:Consolas,monospace;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;','rotation.z','_applying','positionX','_mo','label','getTypeInfo','_findInstance','add...','addEventListener','historic','_pg','number','visible','_moProps','dynBar','transparent','_PROPS','hidden','_editor','_createGrid','No\x20control\x20properties\x20defined\x20yet.<br>Define\x20them\x20in\x20the\x20<b>\x22control\x20prop.\x22</b>\x20dock\x20at\x20the\x20bottom.','propertyAndAttribute','edittext','_createPropsValueGrid','refresh','.wb-title','classList','properties','objectChanged','connect','input','!\x22§$%&/()=?`´-:.,;<>|\x5c\x27#+*°^','Edit\x20Binding\x20—\x20','table','scale','clearbind','querySelectorAll','flex:1;width:100%;box-sizing:border-box;','formula','_refreshPropsValues','left','date','onkeyup','rotation','propertyValues','click','step','serviceContainer','setPropertyValue','_scheduleInject','Element','contextmenu','valueAsNumber','button','default','span','showHead','addDynBtn','add','cssText','appendChild','_typeInfo','4850816INxbjT'];a=function(){return av;};return a();}(function(c,d){const E=b,e=c();while(!![]){try{const f=-parseInt(E(0x273))/0x1*(parseInt(E(0x1b5))/0x2)+-parseInt(E(0x269))/0x3*(parseInt(E(0x26d))/0x4)+parseInt(E(0x238))/0x5+-parseInt(E(0x25d))/0x6+parseInt(E(0x1b1))/0x7+-parseInt(E(0x214))/0x8+parseInt(E(0x232))/0x9*(parseInt(E(0x27d))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xbe497));import{BaseCustomWebComponentConstructorAppend,css,html}from'@gokturk413/base-custom-webcomponent';import{VisualizationPropertyGrid}from'@gokturk413/web-component-designer-visualization-addons';import{iobrokerHandler}from'../common/IobrokerHandler.js';const DEG=0xb4/Math['PI'],RAD=Math['PI']/0xb4;export class IobrokerWebui3DScreenPropertiesPanel extends BaseCustomWebComponentConstructorAppend{static ['template']=html`
|
|
2
2
|
<div id="root">
|
|
3
3
|
<div id="tabbar">
|
|
4
4
|
<div class="tab active" data-tab="props">Properties</div>
|
|
@@ -30,7 +30,7 @@ const F=b;(function(c,d){const E=b,e=c();while(!![]){try{const f=parseInt(E(0x14
|
|
|
30
30
|
<div class="cmSep"></div>
|
|
31
31
|
<div class="cmItem" data-action="clearbind">Clear Binding</div>
|
|
32
32
|
</div>
|
|
33
|
-
</div>`;static [F(
|
|
33
|
+
</div>`;static [F(0x22b)]=css`
|
|
34
34
|
:host { display:block;width:100%;height:100%;overflow:hidden; }
|
|
35
35
|
#root {
|
|
36
36
|
width:100%;height:100%;
|
|
@@ -94,4 +94,4 @@ const F=b;(function(c,d){const E=b,e=c();while(!![]){try{const f=parseInt(E(0x14
|
|
|
94
94
|
.cmItem { padding:5px 14px;cursor:pointer;font-size:11px;color:#c8cdd5;white-space:nowrap; }
|
|
95
95
|
.cmItem:hover { background:#3a6ea8;color:#fff; }
|
|
96
96
|
.cmSep { height:1px;background:#3a4a5a;margin:2px 0; }
|
|
97
|
-
`;static [F(0x15a)]='\x0a\x20\x20\x20\x20\x20\x20\x20\x20:host\x20{\x20background:#252d3a\x20!important;\x20color:#c8cdd5\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#tableDiv\x20{\x20background:#252d3a\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#head,\x20thead\x20th\x20{\x20background:#1e2533\x20!important;\x20color:#7ab4d8\x20!important;\x20border-bottom-color:#1a2030\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#description\x20{\x20display:none\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20div.wunderbaum\x20span.wb-node\x20{\x20color:#c8cdd5\x20!important;\x20padding-left:18px\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20div.wunderbaum\x20div.wb-row.wb-active\x20span.wb-node,\x0a\x20\x20\x20\x20\x20\x20\x20\x20div.wunderbaum\x20div.wb-row:hover\x20{\x20background:#2c3748\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20input,\x20select,\x20textarea\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:#1a2030\x20!important;\x20color:#c8cdd5\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:1px\x20solid\x20#3a4a5a\x20!important;\x20border-radius:2px\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20input[type=color]\x20{\x20padding:0\x20!important;\x20}\x0a\x20\x20\x20\x20';['_editor']=null;[F(0x18a)]=null;[F(0x112)]=null;[F(0x125)]={};[F(0xe0)]=null;['_ctxTarget']=null;['_pg']=null;['_proxy']=null;['_applying']=![];['_PROPS']=[{'path':'positionX','key':'position.x','type':F(0x195),'category':F(0xbb),'label':'X'},{'path':'positionY','key':F(0xe3),'type':F(0x195),'category':F(0xbb),'label':'Y'},{'path':'positionZ','key':F(0x1a1),'type':F(0x195),'category':'Position','label':'Z'},{'path':F(0x167),'key':'rotation.x','type':'number','category':F(0x17e),'label':'X'},{'path':F(0x179),'key':'rotation.y','type':F(0x195),'category':'Rotation\x20(°)','label':'Y'},{'path':'rotationZ','key':'rotation.z','type':F(0x195),'category':F(0x17e),'label':'Z'},{'path':F(0x10c),'key':F(0x12e),'type':'number','category':F(0x11f),'label':'X'},{'path':F(0x146),'key':F(0xce),'type':'number','category':'Scale','label':'Y'},{'path':'scaleZ','key':'scale.z','type':F(0x195),'category':'Scale','label':'Z'},{'path':'visible','key':F(0x127),'type':F(0x144),'label':'Visible'},{'path':'opacity','key':'material.opacity','type':F(0x195),'label':F(0x154)},{'path':'color','key':F(0x15f),'type':F(0xba),'label':'Color'}];async[F(0xdf)](c,d,e){const G=F;this[G(0x10d)]=c,this['_editorHost']=d,this[G(0x112)]=e,this['_bindings']=d?.['sceneData']?.['bindings']??{},this[G(0x106)](),this['_createPropsValueGrid'](),this[G(0x19a)](),this[G(0x135)](),this[G(0x10f)]('addDynBtn')?.[G(0x198)]('click',()=>this[G(0xc2)]()),this[G(0x133)](),c[G(0xc6)]['objectSelected']['add'](f=>{const H=G;this[H(0xe0)]=f,this[H(0x109)]=this['_findInstance'](f),this['_updateHeader'](),this[H(0xb9)](),this[H(0x133)]();if(this[H(0x109)])this['_activateTab']('props');}),c['signals']['objectChanged']['add'](f=>{const I=G;if(this[I(0x15d)])return;if(f&&f===this['_selectedObj'])this[I(0xb9)]();}),this[G(0xd3)](),this[G(0xb9)]();}[F(0x106)](){const J=F,c=this[J(0x10f)]('tabbar');if(!c)return;c['addEventListener'](J(0xed),d=>{const K=J,f=d['target']['closest'](K(0xbf));if(!f)return;this['_activateTab'](f['dataset']['tab']);});}[F(0x142)](c){const L=F;for(const d of this['shadowRoot'][L(0xbe)](L(0xbf)))d['classList']['toggle'](L(0xf1),d[L(0xd2)][L(0x11b)]===c);this[L(0x10f)]('propsPane')?.[L(0x181)]['toggle']('active',c===L(0x121)),this['_getDomElement'](L(0x186))?.['classList'][L(0x18b)](L(0xf1),c===L(0x137)),c==='bind'&&(this[L(0xb9)](),this[L(0x13c)]()),c===L(0x121)&&this['_refreshPropsValues']();}['_createPropsValueGrid'](){const M=F,c=new VisualizationPropertyGrid();c[M(0xe6)]=this['_appShell']?.[M(0xe6)],c['visualizationShell']=this['_appShell'],c['expanded']=!![],c['showHead']=![],c['getTypeInfo']=(d,e)=>e&&e!==M(0xf8)?null:this[M(0x16e)](),c[M(0xe9)]=M(0xf8),c['getSpecialEditorForType']=(d,e,f)=>this['_propsCellEditor'](d,e,f),c['propertyChanged']['on'](d=>{const N=M;if(this['_selectedInstance']&&this[N(0x18a)]?.['applyEmbeddedProp'])this[N(0x18a)][N(0x13b)](this[N(0x109)][N(0x17d)],d[N(0x13a)],d[N(0xd0)]);}),this['_propsPg']=c,this[M(0x10f)](M(0xc3))[M(0x171)](c),this[M(0x189)](c,()=>{const O=M,d=c[O(0xb4)]['getElementById'](O(0x115))??c[O(0xb4)];this['_moProps']=new MutationObserver(()=>this['_scheduleInject']()),this[O(0xb8)][O(0x190)](d,{'childList':!![],'subtree':!![]});});}['_propsCellEditor'](c,d,e){const P=F,f=this[P(0x109)]?.[P(0x17d)],g=f?this['_bindings'][f]?.[e]:null;if(g?.['signal']){const h=document[P(0x175)](P(0x166));return h[P(0xd9)]=g[P(0x101)],h['title']=g['signal'],h['style'][P(0xd4)]=P(0xf6),h;}return null;}['_propsValueTypeInfo'](){const Q=F,c=this[Q(0x140)]??{},d=Object[Q(0x129)](c)[Q(0xcd)](e=>{const R=Q,f=c[e]||{},g={'name':e,'defaultValue':f[R(0x13f)],'description':f[R(0x14c)],'category':f['category']};if(f[R(0x14c)]===R(0x11e))g['type']=R(0x11e),g['values']=f['values']||[];else{if(f[R(0x14c)]===R(0x195)||f[R(0x14c)]===R(0x144)||f[R(0x14c)]==='color')g[R(0x14c)]=f['type'];else g['type']=R(0x1a7);}return g;});return{'name':'Properties','properties':d};}[F(0x1a5)](){const S=F,c=this[S(0x18a)]?.['sceneData'];if(c&&!c['propertyValues'])c['propertyValues']={};return c?.['propertyValues']??{};}['_findInstance'](c){const T=F;let d=c;while(d){if(d['userData']?.['embeddedControl'])return d;d=d[T(0xfb)];}return null;}async['_loadControlPropDefs'](c,d=F(0xec)){const U=F;this[U(0xc9)]??={};const f=d+':'+c;if(this[U(0xc9)][f])return this['_ctrlDefsCache'][f];let g={};try{const h=await iobrokerHandler[U(0x185)](d,c);g=h?.[U(0x164)]??{};}catch(i){}return this['_ctrlDefsCache'][f]=g,g;}async['_loadElementDefs'](c){const V=F,d=this[V(0x112)]?.[V(0xe6)];if(!d?.['propertiesServices']||!c)return{};const f={'element':c},g=[V(0x102),'Common','Css',V(0x199),'Unkown',V(0x191)],h=[...d['propertiesServices']][V(0x156)]();for(const i of h){const j=i?.['constructor']?.['name']||'';if(g[V(0x17a)](m=>j['includes'](m)))continue;let k=![];try{k=i[V(0x17c)](f);}catch(m){}if(!k)continue;let l=null;try{l=await i[V(0x159)](f);}catch(n){}if(l&&l[V(0xc5)])return this[V(0xd8)](l);}return{};}[F(0xd8)](c){const d={},e=f=>{const W=b;for(const g of f){if(!g)continue;if(Array['isArray'](g[W(0x164)])){e(g[W(0x164)]);continue;}if(!g[W(0x118)])continue;let h='string';if(g['type']==='number')h='number';else{if(g[W(0x14c)]==='boolean')h='boolean';else{if(g[W(0x14c)]==='color')h='color';else{if(g[W(0x14c)]===W(0x10a)){d[g['name']]={'type':W(0x11e),'values':g['values']||[],'default':g[W(0x104)],'_pt':g['propertyType']};continue;}}}}d[g['name']]={'type':h,'default':g[W(0x104)],'_pt':g['propertyType']};}};return e(c),d;}[F(0x17f)](c,d,f){const X=F;let g;if(f==null||f===X(0x13a)||f===X(0x148))try{g=c[d];}catch(h){}if(g==null||g===''){const i=d[X(0x16c)](/[A-Z]/g,j=>'-'+j['toLowerCase']());if(c['hasAttribute']?.(i))g=c[X(0x183)](i);}return g;}[F(0xc2)](){const Y=F,c=this['_selectedInstance'];if(!c)return;const e=[Y(0x1a7),'number',Y(0x144),Y(0xba),Y(0xd1),'signal',Y(0xee),Y(0x11e)],f=(c['userData'][Y(0x103)]||[])['map'](r=>({...r})),g=document['createElement'](Y(0xb3));g[Y(0xeb)]['cssText']=Y(0x150);const h=document['createElement'](Y(0xb3));h['style']['cssText']=Y(0x187);const i=document['createElement']('div');i[Y(0xd9)]='Dynamic\x20Properties\x20—\x20'+(c['name']||'instance'),i['style']['cssText']='padding:6px\x2010px;font-weight:bold;border-bottom:1px\x20solid\x20#3e6db4;color:#7c9cbf;',h[Y(0x171)](i);const j=document[Y(0x175)](Y(0xb3));j['style']['cssText']='display:grid;grid-template-columns:1fr\x2090px\x201fr\x201fr\x2028px;gap:3px;padding:4px\x2010px\x200\x2010px;color:#7c9cbf;';for(const r of['name','type',Y(0x13f),Y(0x169),'']){const s=document['createElement'](Y(0xb3));s[Y(0xd9)]=r,j[Y(0x171)](s);}h[Y(0x171)](j);const k=document[Y(0x175)]('div');k[Y(0xeb)]['cssText']=Y(0x131),h[Y(0x171)](k);const l=()=>{const Z=Y;k[Z(0x13d)]='',f['forEach']((u,v)=>{const a0=Z,w=document['createElement'](a0(0xb3));w['style'][a0(0xd4)]='display:grid;grid-template-columns:1fr\x2090px\x201fr\x201fr\x2028px;gap:3px;';const x=document['createElement']('input');x[a0(0x16f)]=u['name']??'',x[a0(0xef)]=a0(0x12b),x[a0(0x12c)]=()=>u['name']=x[a0(0x16f)],w['appendChild'](x);const y=document['createElement'](a0(0xb1));for(const C of e){const D=document['createElement']('option');D['value']=C,D[a0(0xd9)]=C;if(u['type']===C)D['selected']=!![];y['appendChild'](D);}y['onchange']=()=>{const a1=a0;u['type']=y[a1(0x16f)],A['style']['visibility']=u[a1(0x14c)]==='enum'?'visible':'hidden';},w['appendChild'](y);const z=document['createElement'](a0(0xb6));z['value']=u[a0(0x13f)]??'',z['placeholder']='default',z[a0(0x12c)]=()=>u['default']=z[a0(0x16f)],w['appendChild'](z);const A=document['createElement'](a0(0xb6));A[a0(0x16f)]=u['values']?JSON[a0(0xf4)](u[a0(0x15c)]):'',A['placeholder']=a0(0x174),A[a0(0xeb)]['visibility']=u['type']==='enum'?a0(0x127):a0(0x126),A['oninput']=()=>{const a2=a0;try{u[a2(0x15c)]=JSON[a2(0x16d)](A[a2(0x16f)]);}catch{}},w['appendChild'](A);const B=document[a0(0x175)](a0(0x163));B[a0(0xd9)]='✕',B['title']=a0(0x19d),B[a0(0x19f)]=()=>{const a3=a0;f[a3(0x161)](v,0x1),l();},w[a0(0x171)](B),k[a0(0x171)](w);});};l();const m=document[Y(0x175)](Y(0xb3));m[Y(0xeb)][Y(0xd4)]=Y(0x128);const n=document['createElement'](Y(0x163));n['textContent']=Y(0x105),n['onclick']=()=>{const a4=Y;f[a4(0xfa)]({'name':'','type':a4(0x1a7)}),l();};const o=document['createElement']('div');o['style'][Y(0x143)]='1';const p=document[Y(0x175)]('button');p[Y(0xd9)]='ok',p['style'][Y(0x177)]='60px',p['onclick']=()=>{const a5=Y,u=[],v=new Set(),w='!\x22§$%&/()=?`´-:.,;<>|\x5c\x27#+*°^';for(const x of f){let y=x[a5(0x118)]??'';for(const A of w)y=y['replaceAll'](A,'');y=y['replaceAll']('\x20','');if(!y)continue;y=y[0x0][a5(0xe8)]()+y['substring'](0x1);if(v['has'](y))continue;v[a5(0xff)](y);const z={'name':y,'type':x[a5(0x14c)]??'string'};if(x['default']!=null&&x[a5(0x13f)]!=='')z[a5(0x13f)]=x[a5(0x13f)];if(x['type']==='enum'&&x['values'])z['values']=x['values'];u[a5(0xfa)](z);}c[a5(0xc0)]['dynamicDefs']=u,this[a5(0xc9)]={},g['remove'](),this['_refreshPropsValues']();};const q=document[Y(0x175)](Y(0x163));q[Y(0xd9)]=Y(0x17b),q['style'][Y(0x177)]=Y(0x194),q['onclick']=()=>g['remove'](),m['appendChild'](n),m[Y(0x171)](o),m['appendChild'](p),m['appendChild'](q),h[Y(0x171)](m),g['appendChild'](h),g['onclick']=u=>{const a6=Y;if(u[a6(0xd6)]===g)g[a6(0x19d)]();},document['body']['appendChild'](g);}async[F(0x133)](){const a7=F;if(!this['_propsPg'])return;const c=this['_getDomElement']('propsHint'),e=this[a7(0x10f)]('propsHost'),f=this['_getDomElement'](a7(0x120));let g,h,i;if(this[a7(0x109)]){const j=this[a7(0x109)][a7(0xc0)]['embeddedControl'],l=this['_selectedInstance']['userData'][a7(0x15e)]||a7(0xec),m=this[a7(0x109)]['userData']['dynamicDefs']||[],n=l==='control'||l===a7(0x172),o=n?this['_editorHost']?.['getEmbeddedElement']?.(this['_selectedInstance']['uuid']):null,p=o?await this[a7(0x111)](o):{},q=!n?await this[a7(0x1a6)](j,l):{},r=n?{'width':{'type':a7(0x195),'category':a7(0xb2)},'height':{'type':'number','category':a7(0xb2)},'textContent':{'type':a7(0x1a7),'category':a7(0xb2)},'innerHTML':{'type':a7(0x1a7),'category':'Element'}}:{};g={...r,...p,...q};for(const s of m)if(s?.[a7(0x118)])g[s[a7(0x118)]]={'type':s[a7(0x14c)],'default':s[a7(0x13f)],'values':s['values']};if(!this['_selectedInstance'][a7(0xc0)]['props'])this[a7(0x109)]['userData']['props']={};h=this[a7(0x109)]['userData'][a7(0x121)];if(h['width']==null&&this[a7(0x109)]['userData'][a7(0x188)]!=null)h[a7(0x119)]=this[a7(0x109)]['userData'][a7(0x188)];if(h[a7(0x12f)]==null&&this[a7(0x109)][a7(0xc0)]['cssHeight']!=null)h['height']=this[a7(0x109)][a7(0xc0)][a7(0x197)];if(o)for(const t of Object[a7(0x129)](p)){if(h[t]==null){const u=this['_readElValue'](o,t,p[t]['_pt']);if(u!=null&&u!=='')h[t]=u;}}i=j;if(f)f[a7(0xeb)]['display']='block';}else{g=this[a7(0x18a)]?.['sceneData']?.['properties']??{},h=this[a7(0x1a5)](),i=null;if(f)f['style'][a7(0x180)]='none';}this['_currentDefs']=g;if(!g||!Object['keys'](g)[a7(0xc5)]){this['_safeSetSelected'](this['_propsPg'],null);if(e)e['style'][a7(0x180)]='none';c&&(c['style'][a7(0x180)]=a7(0x11d),c[a7(0x13d)]=this[a7(0x109)]?'\x22<b>'+i+'</b>\x22\x20has\x20no\x20properties.<br>Use\x20<b>+\x20Dynamic\x20Property</b>\x20above\x20to\x20add\x20per-instance\x20properties.':a7(0x182));return;}if(c)c['style']['display']=a7(0x138);if(e)e[a7(0xeb)]['display']='block';this['_safeSetSelected'](this[a7(0xda)],h),this['_scheduleInject']();}['_createGrid'](){const a8=F,c=new VisualizationPropertyGrid();c[a8(0xe6)]=this['_appShell']?.['serviceContainer'],c['visualizationShell']=this[a8(0x112)],c[a8(0x14b)]=!![],c[a8(0x162)]=![],c['getTypeInfo']=(d,e)=>e&&e!==a8(0x160)?null:this['_typeInfo'](),c[a8(0xe9)]='3DObject',c['getSpecialEditorForType']=(d,e,f)=>this['_cellEditor'](d,e,f),c[a8(0x136)]['on'](d=>this['_onProxyChanged'](d)),this['_pg']=c,this['_getDomElement']('pgHost')['appendChild'](c),this['_injectDark'](c,()=>{const a9=a8,d=c[a9(0xb4)][a9(0xcb)]('table')??c['shadowRoot'];this[a9(0x168)]=new MutationObserver(()=>this['_scheduleInject']()),this[a9(0x168)]['observe'](d,{'childList':!![],'subtree':!![]}),this[a9(0x13c)]();});}[F(0x189)](c,d){const e=()=>{const aa=b;if(!c['shadowRoot']){setTimeout(e,0x32);return;}try{const f=new CSSStyleSheet();f[aa(0xf5)](IobrokerWebui3DScreenPropertiesPanel['_PG_DARK']),c['shadowRoot'][aa(0xfd)]=[...c[aa(0xb4)]['adoptedStyleSheets']??[],f];}catch(g){}d?.();};e();}[F(0x176)](){const ab=F;return{'name':this[ab(0xe0)]?.['name']||'3D\x20Object','properties':this[ab(0x152)][ab(0xcd)](c=>({'name':c['path'],'type':c['type'],'category':c[ab(0xb5)],'description':c['label']}))};}['_buildProxy'](c){const ac=F,d=c['material'];return{'positionX':+c[ac(0x117)]['x']['toFixed'](0x4),'positionY':+c[ac(0x117)]['y'][ac(0xe4)](0x4),'positionZ':+c['position']['z']['toFixed'](0x4),'rotationX':+(c['rotation']['x']*DEG)[ac(0xe4)](0x3),'rotationY':+(c[ac(0x153)]['y']*DEG)[ac(0xe4)](0x3),'rotationZ':+(c['rotation']['z']*DEG)['toFixed'](0x3),'scaleX':+c['scale']['x'][ac(0xe4)](0x4),'scaleY':+c['scale']['y'][ac(0xe4)](0x4),'scaleZ':+c[ac(0x19e)]['z'][ac(0xe4)](0x4),'visible':!!c[ac(0x127)],'opacity':d?+(d[ac(0x145)]??0x1)['toFixed'](0x3):0x1,'color':d?.[ac(0xba)]?'#'+d[ac(0xba)]['getHexString']():'#ffffff'};}[F(0x12a)](c,d){const ad=F;if(!c)return;if(!c[ad(0x193)]){setTimeout(()=>this[ad(0x12a)](c,d),0x1e);return;}c['selectedObject']=d;}['_refreshGrid'](){const ae=F;if(!this['_pg'])return;if(!this[ae(0xe0)]){this['_safeSetSelected'](this['_pg'],null);return;}this[ae(0x196)]=this[ae(0xd7)](this['_selectedObj']),this[ae(0x12a)](this['_pg'],this[ae(0x196)]),this['_scheduleInject']();}[F(0x13c)](){const af=F;clearTimeout(this['_injTmr']),this['_injTmr']=setTimeout(()=>this[af(0x1a2)](),0x3c);}['_injectAllSquares'](){const ag=F;this[ag(0x16a)](this['_pg'],this['_selectedObj']?.[ag(0x17d)],c=>this[ag(0x152)][ag(0x130)](d=>d['path']===c)?.[ag(0x139)]),this['_selectedInstance']&&this['_injectSquaresInto'](this[ag(0xda)],this['_selectedInstance'][ag(0x17d)],c=>this[ag(0x140)]&&c in this['_currentDefs']?c:null);}['_injectSquaresInto'](c,d,e){const ah=F,f=c?.[ah(0xb4)];if(!f||!d)return;for(const g of f[ah(0xbe)]('.wb-node')){const h=g[ah(0xcf)](ah(0x18c))??g,i=h[ah(0xd9)]?.[ah(0x14d)](),j=e(i),k=g[ah(0xbd)]('.wb-row');if(!j||!k)continue;const l=!!this['_bindings'][d]?.[j]?.[ah(0x101)];let m=k[ah(0xcf)]('.bsq3d');if(!m){if(getComputedStyle(k)[ah(0x117)]==='static')k['style']['position']='relative';m=document['createElement']('span'),m[ah(0xc1)]=ah(0x14e),m['title']=ah(0xf2),m[ah(0xeb)][ah(0xd4)]='position:absolute;left:5px;top:0;bottom:0;margin:auto\x200;'+'width:11px;height:11px;border:1px\x20solid\x20#4a5f72;box-sizing:border-box;'+'cursor:pointer;z-index:5;';const n=o=>{const ai=ah;o['preventDefault'](),o[ai(0x165)](),this[ai(0xbc)](o,m['dataset']['k'],m[ai(0xd2)]['u']);};m['addEventListener'](ah(0xed),n),m[ah(0x198)](ah(0xea),n),k['appendChild'](m);}m[ah(0xd2)]['k']=j,m[ah(0xd2)]['u']=d,m[ah(0xeb)]['background']=l?'#e08020':'transparent',m[ah(0xeb)]['borderColor']=l?'#e08020':'#4a5f72';}}['_cellEditor'](c,d,e){const aj=F,f=this['_PROPS']['find'](k=>k['path']===e),g=f?.[aj(0x139)],h=this['_selectedObj']?.[aj(0x17d)],i=h&&g?this['_bindings'][h]?.[g]:null;if(i?.[aj(0x101)]){const k=document[aj(0x175)](aj(0x166));return k['textContent']=i[aj(0x101)],k['title']=i[aj(0x101)],k['style'][aj(0xd4)]='flex:1;width:100%;color:#e08020;font-family:Consolas,monospace;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;',k;}let j;if(c['type']==='boolean')j=document[aj(0x175)]('input'),j['type']=aj(0x151),j['checked']=!!d,j[aj(0x122)]=()=>this[aj(0x155)][aj(0x108)](e,j['checked']);else c[aj(0x14c)]===aj(0xba)?(j=document['createElement'](aj(0xb6)),j[aj(0x14c)]='color',j[aj(0x16f)]=d||aj(0x124),j['style'][aj(0xd4)]='flex:1;height:20px;',j[aj(0x12c)]=()=>this['_pg'][aj(0x108)](e,j[aj(0x16f)])):(j=document['createElement']('input'),j[aj(0x14c)]=aj(0x195),j[aj(0x158)]=aj(0xd5),j[aj(0x16f)]=d??'',j['style'][aj(0xd4)]='flex:1;width:100%;box-sizing:border-box;',j[aj(0x122)]=()=>this[aj(0x155)]['setPropertyValue'](e,j['valueAsNumber']),j[aj(0xf3)]=l=>{const ak=aj;if(l['key']==='Enter')this[ak(0x155)]['setPropertyValue'](e,j['valueAsNumber']);});return j;}[F(0x178)](c){const al=F,d=this['_selectedObj'];if(!d)return;const f=c[al(0xd0)];this[al(0x15d)]=!![];try{switch(c['property']){case'positionX':d[al(0x117)]['x']=f;break;case'positionY':d[al(0x117)]['y']=f;break;case al(0xdd):d[al(0x117)]['z']=f;break;case'rotationX':d[al(0x153)]['x']=f*RAD;break;case'rotationY':d['rotation']['y']=f*RAD;break;case'rotationZ':d['rotation']['z']=f*RAD;break;case'scaleX':d[al(0x19e)]['x']=f;break;case'scaleY':d[al(0x19e)]['y']=f;break;case al(0x18e):d[al(0x19e)]['z']=f;break;case'visible':d['visible']=!!f;break;case al(0x145):d['material']&&(d[al(0x12d)]['opacity']=f,d[al(0x12d)]['transparent']=f<0x1,d['material']['needsUpdate']=!![]);break;case'color':d['material']?.['color']&&(d['material'][al(0xba)][al(0xe5)](f),d[al(0x12d)][al(0x14a)]=!![]);break;}this['_editor']?.[al(0xc6)]?.['objectChanged']?.[al(0x113)]?.(d);}finally{this[al(0x15d)]=![];}}['_updateHeader'](){const am=F,c=this[am(0xe0)],d=this[am(0x10f)]('objType'),e=this[am(0x10f)]('objName');if(!d||!e)return;!c?(d['textContent']='',e[am(0xd9)]='No\x20object\x20selected'):(d['textContent']=c['type']||'',e['textContent']=c['name']||c[am(0x17d)]?.['slice'](0x0,0x8)||'—');}['_setupMenu'](){const an=F,c=this[an(0x10f)]('ctxMenu'),d=this[an(0x10f)]('ctxBack');if(!c||!d)return;d['addEventListener'](an(0xed),()=>this[an(0x19c)]()),d[an(0x198)]('contextmenu',f=>{const ao=an;f[ao(0x114)](),this[ao(0x19c)]();}),c['addEventListener']('click',f=>{const ap=an,g=f['target']['closest']('.cmItem');if(!g)return;const h=g['dataset'][ap(0x10b)];this['_closeMenu']();if(h===ap(0xc4))this['_openBindDialog'](this['_ctxTarget']);if(h==='edittext')this[ap(0xcc)](this['_ctxTarget']);if(h===ap(0xf0))this[ap(0xde)](this[ap(0xdb)]);});}[F(0xbc)](c,d,f){const aq=F;if(!d||!f)return;this['_ctxTarget']={'uuid':f,'key':d};const g=this['_getDomElement']('ctxMenu'),h=this['_getDomElement'](aq(0x134));if(!g||!h)return;g[aq(0xeb)]['left']=c[aq(0xfc)]+'px',g[aq(0xeb)][aq(0xe1)]=c[aq(0xca)]+'px',g[aq(0x181)]['add']('open'),h[aq(0x181)][aq(0xff)](aq(0xc7));}[F(0x19c)](){const ar=F;this['_getDomElement']('ctxMenu')?.['classList']['remove'](ar(0xc7)),this[ar(0x10f)]('ctxBack')?.[ar(0x181)][ar(0x19d)](ar(0xc7));}['_clearBind']({uuid:c,key:d}={}){const as=F;if(!c||!d)return;if(this['_bindings'][c]){delete this['_bindings'][c][d];if(!Object['keys'](this[as(0x125)][c])[as(0xc5)])delete this['_bindings'][c];}this[as(0x110)](),this[as(0x155)]?.['refresh'](),this['_propsPg']?.['refresh'](),this[as(0x13c)]();}[F(0xcc)]({uuid:c,key:d}={}){const at=F;if(!c||!d)return;const e=this['_bindings'][c]?.[d],f=window['prompt']('ioBroker\x20State\x20ID\x20for\x20\x22'+d+'\x22:',e?.[at(0x101)]||'');if(f===null)return;if(!f['trim']()){this['_clearBind']({'uuid':c,'key':d});return;}if(!this['_bindings'][c])this[at(0x125)][c]={};this[at(0x125)][c][d]={...e||{},'signal':f['trim']()},this['_syncHost'](),this[at(0x155)]?.[at(0x13e)](),this[at(0xda)]?.[at(0x13e)](),this['_scheduleInject']();}async['_openBindDialog']({uuid:c,key:d}={}){const au=F;if(!c||!d||!this['_appShell']){console['warn'](au(0x173),{'uuid':c,'key':d,'hasShell':!!this['_appShell']});return;}const e=this[au(0x152)][au(0x130)](m=>m[au(0x139)]===d)?.['label']||d,f=this['_bindings'][c]?.[d],g=f?.[au(0x101)]?{'bindableObjectNames':[f[au(0x101)]],'expression':f['formula']&&f[au(0x19b)]!==au(0x14f)?f[au(0x19b)]:'','invert':f[au(0xe2)]||![],'historic':f['historic']||null,'converter':f['converter']||null,'target':'property'}:null;let h,i;try{[{IobrokerWebuiBindingsEditor:h},{IobrokerWebuiConfirmationWrapper:i}]=await Promise[au(0x18f)]([import(au(0x192)),import(au(0x15b))]);}catch(m){console[au(0x1a4)](au(0x18d),m);return;}const j=new h({'name':e,'propertyType':au(0x148)},g,au(0x13a),this[au(0x112)][au(0xe6)],null,this['_appShell']),k=new i();k[au(0xfe)]=au(0x123)+d,k[au(0x171)](j);const l=this['_appShell']['openDialog'](k,{'x':0xc8,'y':0x96,'width':0x2bc,'height':0x1cc});k[au(0xf9)]['on'](()=>l[au(0x184)]()),k[au(0x1a0)]['on'](()=>{const av=au;l[av(0x184)]();const n=j[av(0x170)];if(n){if(!this[av(0x125)][c])this['_bindings'][c]={};const o={'signal':n};if(j[av(0x149)])o['formula']=j['expression'];if(j['invert'])o['invert']=!![];if(j[av(0xb7)])o[av(0xb7)]=j[av(0xb7)];this[av(0x125)][c][d]=o;}else this[av(0xde)]({'uuid':c,'key':d});this[av(0x110)](),this[av(0x155)]?.[av(0x13e)](),this[av(0xda)]?.[av(0x13e)](),this['_scheduleInject']();});}['_syncHost'](){const aw=F;if(this['_editorHost']?.['sceneData'])this[aw(0x18a)]['sceneData']['bindings']=this['_bindings'];}[F(0x107)](){const ax=F;try{this['_mo']?.['disconnect']();}catch(c){}try{this[ax(0xb8)]?.[ax(0x10e)]();}catch(d){}clearTimeout(this[ax(0x11a)]),super[ax(0x107)]?.();}}customElements['define']('iobroker-webui-3dscreen-properties',IobrokerWebui3DScreenPropertiesPanel);
|
|
97
|
+
`;static ['_PG_DARK']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20:host\x20{\x20background:#252d3a\x20!important;\x20color:#c8cdd5\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#tableDiv\x20{\x20background:#252d3a\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#head,\x20thead\x20th\x20{\x20background:#1e2533\x20!important;\x20color:#7ab4d8\x20!important;\x20border-bottom-color:#1a2030\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20#description\x20{\x20display:none\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20div.wunderbaum\x20span.wb-node\x20{\x20color:#c8cdd5\x20!important;\x20padding-left:18px\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20div.wunderbaum\x20div.wb-row.wb-active\x20span.wb-node,\x0a\x20\x20\x20\x20\x20\x20\x20\x20div.wunderbaum\x20div.wb-row:hover\x20{\x20background:#2c3748\x20!important;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20input,\x20select,\x20textarea\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:#1a2030\x20!important;\x20color:#c8cdd5\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:1px\x20solid\x20#3a4a5a\x20!important;\x20border-radius:2px\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20input[type=color]\x20{\x20padding:0\x20!important;\x20}\x0a\x20\x20\x20\x20';[F(0x1e8)]=null;['_editorHost']=null;['_appShell']=null;[F(0x1a8)]={};['_selectedObj']=null;[F(0x1a2)]=null;['_pg']=null;['_proxy']=null;['_applying']=![];['_PROPS']=[{'path':F(0x1d8),'key':'position.x','type':'number','category':'Position','label':'X'},{'path':'positionY','key':F(0x267),'type':F(0x1e1),'category':F(0x1c4),'label':'Y'},{'path':'positionZ','key':F(0x221),'type':F(0x1e1),'category':F(0x1c4),'label':'Z'},{'path':'rotationX','key':'rotation.x','type':'number','category':F(0x280),'label':'X'},{'path':F(0x22a),'key':'rotation.y','type':'number','category':F(0x280),'label':'Y'},{'path':'rotationZ','key':F(0x1d6),'type':'number','category':'Rotation\x20(°)','label':'Z'},{'path':F(0x25e),'key':F(0x1ba),'type':'number','category':'Scale','label':'X'},{'path':F(0x1d0),'key':F(0x19d),'type':'number','category':F(0x23c),'label':'Y'},{'path':'scaleZ','key':'scale.z','type':'number','category':'Scale','label':'Z'},{'path':F(0x1e2),'key':F(0x1e2),'type':F(0x27f),'label':F(0x255)},{'path':'opacity','key':'material.opacity','type':F(0x1e1),'label':'Opacity'},{'path':F(0x1b2),'key':'material.color','type':'color','label':'Color'}];async[F(0x1f3)](c,d,e){const G=F;this[G(0x1e8)]=c,this[G(0x247)]=d,this['_appShell']=e,this['_bindings']=d?.[G(0x276)]?.[G(0x25f)]??{},this[G(0x26e)](),this[G(0x1ed)](),this[G(0x1e9)](),this['_setupMenu'](),this[G(0x19e)](G(0x20f))?.['addEventListener'](G(0x203),()=>this['_openDynamicDialog']()),this['_refreshPropsValues'](),c['signals']['objectSelected'][G(0x210)](f=>{const H=G;this[H(0x277)]=f,this['_selectedInstance']=this['_findInstance'](f),this['_updateHeader'](),this[H(0x215)](),this[H(0x1fd)]();if(this['_selectedInstance'])this['_activateTab']('props');}),c['signals'][G(0x1f2)][G(0x210)](f=>{const I=G;if(this['_applying'])return;if(f&&f===this[I(0x277)])this['_refreshGrid']();}),this['_updateHeader'](),this['_refreshGrid']();}[F(0x26e)](){const J=F,c=this[J(0x19e)](J(0x19b));if(!c)return;c[J(0x1de)](J(0x203),d=>{const K=J,f=d['target']['closest'](K(0x272));if(!f)return;this[K(0x257)](f[K(0x239)][K(0x1a6)]);});}[F(0x257)](c){const L=F;for(const d of this['shadowRoot']['querySelectorAll']('.tab'))d['classList'][L(0x1a0)]('active',d['dataset']['tab']===c);this[L(0x19e)](L(0x240))?.['classList']['toggle'](L(0x21e),c==='props'),this[L(0x19e)]('bindPane')?.['classList']['toggle']('active',c==='bind'),c==='bind'&&(this[L(0x215)](),this['_scheduleInject']()),c===L(0x266)&&this['_refreshPropsValues']();}['_createPropsValueGrid'](){const M=F,c=new VisualizationPropertyGrid();c[M(0x205)]=this['_appShell']?.[M(0x205)],c['visualizationShell']=this[M(0x1ae)],c[M(0x1d1)]=!![],c['showHead']=![],c[M(0x1db)]=(d,e)=>e&&e!==M(0x270)?null:this['_propsValueTypeInfo'](),c['typeName']=M(0x270),c['getSpecialEditorForType']=(d,e,f)=>this[M(0x274)](d,e,f),c['propertyChanged']['on'](d=>{const N=M;if(this[N(0x1a1)]&&this['_editorHost']?.[N(0x234)])this['_editorHost'][N(0x234)](this['_selectedInstance']['uuid'],d['property'],d[N(0x252)]);}),this[M(0x275)]=c,this['_getDomElement'](M(0x19a))['appendChild'](c),this['_injectDark'](c,()=>{const O=M,d=c['shadowRoot'][O(0x24a)]('table')??c['shadowRoot'];this[O(0x1e3)]=new MutationObserver(()=>this[O(0x207)]()),this['_moProps']['observe'](d,{'childList':!![],'subtree':!![]});});}[F(0x274)](c,d,e){const P=F,f=this['_selectedInstance']?.['uuid'],g=f?this['_bindings'][f]?.[e]:null;if(g?.[P(0x1b0)]){const h=document[P(0x199)](P(0x20d));return h['textContent']=g['signal'],h[P(0x227)]=g[P(0x1b0)],h['style'][P(0x211)]=P(0x1d5),h;}return null;}[F(0x226)](){const Q=F,c=this['_currentDefs']??{},d=Object[Q(0x258)](c)[Q(0x1c7)](e=>{const R=Q,f=c[e]||{},g={'name':e,'defaultValue':f['default'],'description':f[R(0x26b)],'category':f['category']};if(f[R(0x26b)]==='enum')g['type']=R(0x256),g['values']=f['values']||[];else{if(f[R(0x26b)]===R(0x1e1)||f['type']===R(0x27f)||f[R(0x26b)]==='color')g[R(0x26b)]=f['type'];else g[R(0x26b)]='string';}return g;});return{'name':'Properties','properties':d};}['_ensurePropValues'](){const S=F,c=this[S(0x247)]?.[S(0x276)];if(c&&!c['propertyValues'])c['propertyValues']={};return c?.[S(0x202)]??{};}[F(0x1dc)](c){const T=F;let d=c;while(d){if(d['userData']?.['embeddedControl'])return d;d=d[T(0x1ab)];}return null;}async['_loadControlPropDefs'](c,d=F(0x225)){this['_ctrlDefsCache']??={};const f=d+':'+c;if(this['_ctrlDefsCache'][f])return this['_ctrlDefsCache'][f];let g={};try{const h=await iobrokerHandler['getWebuiObject'](d,c);g=h?.['properties']??{};}catch(i){}return this['_ctrlDefsCache'][f]=g,g;}async[F(0x237)](c){const U=F,d=this['_appShell']?.['serviceContainer'];if(!d?.['propertiesServices']||!c)return{};const f={'element':c},g=['Attributes','Common',U(0x21d),'AttachedProperties','Unkown',U(0x27c)],h=[...d['propertiesServices']][U(0x1ac)]();for(const i of h){const j=i?.['constructor']?.[U(0x278)]||'';if(g['some'](m=>j[U(0x246)](m)))continue;let k=![];try{k=i['isHandledElement'](f);}catch(m){}if(!k)continue;let l=null;try{l=await i['getProperties'](f);}catch(n){}if(l&&l['length'])return this['_flattenProps'](l);}return{};}[F(0x1c6)](c){const d={},e=f=>{const V=b;for(const g of f){if(!g)continue;if(Array['isArray'](g['properties'])){e(g['properties']);continue;}if(!g[V(0x278)])continue;let h=V(0x19c);if(g['type']===V(0x1e1))h=V(0x1e1);else{if(g['type']==='boolean')h='boolean';else{if(g['type']===V(0x1b2))h=V(0x1b2);else{if(g[V(0x26b)]==='list'){d[g[V(0x278)]]={'type':V(0x256),'values':g[V(0x1c3)]||[],'default':g['defaultValue'],'_pt':g[V(0x219)]};continue;}}}}d[g[V(0x278)]]={'type':h,'default':g['defaultValue'],'_pt':g['propertyType']};}};return e(c),d;}[F(0x25a)](c,d,f){const W=F;let g;if(f==null||f===W(0x1b3)||f===W(0x1eb))try{g=c[d];}catch(h){}if(g==null||g===''){const i=d['replace'](/[A-Z]/g,j=>'-'+j[W(0x218)]());if(c['hasAttribute']?.(i))g=c['getAttribute'](i);}return g;}['_openDynamicDialog'](){const X=F,c=this[X(0x1a1)];if(!c)return;const e=['string','number',X(0x27f),X(0x1b2),X(0x1ff),X(0x1b0),'screen',X(0x256)],f=(c[X(0x268)][X(0x245)]||[])['map'](r=>({...r})),g=document[X(0x199)]('div');g['style'][X(0x211)]=X(0x263);const h=document['createElement']('div');h['style'][X(0x211)]='background:#1e2d3d;color:#d0d8e0;border:1px\x20solid\x20#3e6db4;min-width:460px;max-width:620px;max-height:80vh;display:flex;flex-direction:column;font-size:12px;font-family:Segoe\x20UI,Arial,sans-serif;box-shadow:0\x204px\x2024px\x20rgba(0,0,0,0.6);';const i=document['createElement']('div');i['textContent']='Dynamic\x20Properties\x20—\x20'+(c['name']||X(0x24c)),i['style']['cssText']='padding:6px\x2010px;font-weight:bold;border-bottom:1px\x20solid\x20#3e6db4;color:#7c9cbf;',h['appendChild'](i);const j=document[X(0x199)]('div');j[X(0x22b)][X(0x211)]='display:grid;grid-template-columns:1fr\x2090px\x201fr\x201fr\x2028px;gap:3px;padding:4px\x2010px\x200\x2010px;color:#7c9cbf;';for(const r of[X(0x278),X(0x26b),X(0x20c),'enum\x20values','']){const s=document['createElement'](X(0x22f));s[X(0x241)]=r,j[X(0x212)](s);}h[X(0x212)](j);const k=document['createElement'](X(0x22f));k[X(0x22b)]['cssText']='display:flex;flex-direction:column;gap:3px;padding:4px\x2010px;overflow-y:auto;flex:1;',h['appendChild'](k);const l=()=>{const Y=X;k[Y(0x23d)]='',f['forEach']((u,v)=>{const Z=Y,w=document['createElement']('div');w[Z(0x22b)]['cssText']=Z(0x1ce);const x=document['createElement']('input');x[Z(0x216)]=u['name']??'',x['placeholder']='propertyName',x['oninput']=()=>u[Z(0x278)]=x[Z(0x216)],w[Z(0x212)](x);const y=document[Z(0x199)](Z(0x253));for(const C of e){const D=document[Z(0x199)]('option');D[Z(0x216)]=C,D[Z(0x241)]=C;if(u['type']===C)D[Z(0x196)]=!![];y[Z(0x212)](D);}y[Z(0x224)]=()=>{const a0=Z;u[a0(0x26b)]=y[a0(0x216)],A[a0(0x22b)]['visibility']=u['type']==='enum'?a0(0x1e2):'hidden';},w[Z(0x212)](y);const z=document[Z(0x199)]('input');z['value']=u[Z(0x20c)]??'',z[Z(0x197)]='default',z['oninput']=()=>u['default']=z[Z(0x216)],w[Z(0x212)](z);const A=document['createElement']('input');A['value']=u['values']?JSON['stringify'](u['values']):'',A['placeholder']=Z(0x24d),A[Z(0x22b)]['visibility']=u[Z(0x26b)]==='enum'?Z(0x1e2):Z(0x1e7),A[Z(0x1a4)]=()=>{const a1=Z;try{u[a1(0x1c3)]=JSON['parse'](A[a1(0x216)]);}catch{}},w[Z(0x212)](A);const B=document['createElement'](Z(0x20b));B['textContent']='✕',B['title']='remove',B['onclick']=()=>{f['splice'](v,0x1),l();},w[Z(0x212)](B),k['appendChild'](w);});};l();const m=document['createElement'](X(0x22f));m['style']['cssText']='display:flex;gap:4px;padding:8px\x2010px;border-top:1px\x20solid\x20#3e6db4;';const n=document['createElement'](X(0x20b));n['textContent']=X(0x1dd),n[X(0x1c0)]=()=>{const a2=X;f['push']({'name':'','type':a2(0x19c)}),l();};const o=document[X(0x199)](X(0x22f));o[X(0x22b)]['flex']='1';const p=document['createElement'](X(0x20b));p[X(0x241)]='ok',p['style']['minWidth']='60px',p[X(0x1c0)]=()=>{const a3=X,u=[],v=new Set(),w=a3(0x1f5);for(const x of f){let y=x[a3(0x278)]??'';for(const A of w)y=y['replaceAll'](A,'');y=y[a3(0x262)]('\x20','');if(!y)continue;y=y[0x0][a3(0x218)]()+y[a3(0x1cd)](0x1);if(v['has'](y))continue;v[a3(0x210)](y);const z={'name':y,'type':x['type']??a3(0x19c)};if(x['default']!=null&&x[a3(0x20c)]!=='')z[a3(0x20c)]=x['default'];if(x[a3(0x26b)]==='enum'&&x['values'])z[a3(0x1c3)]=x['values'];u[a3(0x27a)](z);}c[a3(0x268)]['dynamicDefs']=u,this[a3(0x1aa)]={},g['remove'](),this['_refreshPropsValues']();};const q=document['createElement']('button');q[X(0x241)]='cancel',q[X(0x22b)]['minWidth']='60px',q[X(0x1c0)]=()=>g[X(0x21f)](),m['appendChild'](n),m[X(0x212)](o),m[X(0x212)](p),m['appendChild'](q),h[X(0x212)](m),g['appendChild'](h),g['onclick']=u=>{const a4=X;if(u[a4(0x1d3)]===g)g['remove']();},document[X(0x259)]['appendChild'](g);}async[F(0x1fd)](){const a5=F;if(!this[a5(0x275)])return;const c=this['_getDomElement']('propsHint'),e=this[a5(0x19e)](a5(0x19a)),f=this['_getDomElement'](a5(0x1e4));let g,h,i;if(this[a5(0x1a1)]){const j=this['_selectedInstance']['userData'][a5(0x222)],l=this['_selectedInstance'][a5(0x268)]['embeddedType']||a5(0x225),m=this[a5(0x1a1)]['userData']['dynamicDefs']||[],n=l==='control'||l==='npm',o=n?this[a5(0x247)]?.[a5(0x235)]?.(this['_selectedInstance'][a5(0x228)]):null,p=o?await this[a5(0x237)](o):{},q=!n?await this[a5(0x1c2)](j,l):{},r=n?{'width':{'type':'number','category':a5(0x208)},'height':{'type':a5(0x1e1),'category':a5(0x208)},'textContent':{'type':'string','category':'Element'},'innerHTML':{'type':'string','category':'Element'}}:{};g={...r,...p,...q};for(const s of m)if(s?.[a5(0x278)])g[s[a5(0x278)]]={'type':s['type'],'default':s['default'],'values':s['values']};if(!this[a5(0x1a1)][a5(0x268)]['props'])this[a5(0x1a1)][a5(0x268)]['props']={};h=this[a5(0x1a1)]['userData'][a5(0x266)];if(h[a5(0x264)]==null&&this['_selectedInstance']['userData']['cssWidth']!=null)h[a5(0x264)]=this['_selectedInstance']['userData']['cssWidth'];if(h['height']==null&&this['_selectedInstance'][a5(0x268)][a5(0x23a)]!=null)h['height']=this[a5(0x1a1)][a5(0x268)][a5(0x23a)];if(o)for(const t of Object[a5(0x258)](p)){if(h[t]==null){const u=this[a5(0x25a)](o,t,p[t][a5(0x1bc)]);if(u!=null&&u!=='')h[t]=u;}}i=j;if(f)f['style']['display']='block';}else{g=this['_editorHost']?.['sceneData']?.[a5(0x1f1)]??{},h=this['_ensurePropValues'](),i=null;if(f)f[a5(0x22b)][a5(0x250)]=a5(0x19f);}this[a5(0x1b7)]=g;if(!g||!Object['keys'](g)['length']){this[a5(0x231)](this[a5(0x275)],null);if(e)e['style'][a5(0x250)]='none';c&&(c[a5(0x22b)]['display']='block',c[a5(0x23d)]=this[a5(0x1a1)]?'\x22<b>'+i+'</b>\x22\x20has\x20no\x20properties.<br>Use\x20<b>+\x20Dynamic\x20Property</b>\x20above\x20to\x20add\x20per-instance\x20properties.':a5(0x1ea));return;}if(c)c[a5(0x22b)][a5(0x250)]=a5(0x19f);if(e)e['style'][a5(0x250)]='block';this[a5(0x231)](this['_propsPg'],h),this[a5(0x207)]();}['_createGrid'](){const a6=F,c=new VisualizationPropertyGrid();c[a6(0x205)]=this[a6(0x1ae)]?.[a6(0x205)],c[a6(0x26f)]=this[a6(0x1ae)],c['expanded']=!![],c[a6(0x20e)]=![],c['getTypeInfo']=(d,e)=>e&&e!==a6(0x1cc)?null:this[a6(0x213)](),c['typeName']='3DObject',c['getSpecialEditorForType']=(d,e,f)=>this[a6(0x265)](d,e,f),c['propertyChanged']['on'](d=>this[a6(0x27e)](d)),this['_pg']=c,this['_getDomElement'](a6(0x24e))[a6(0x212)](c),this[a6(0x248)](c,()=>{const a7=a6,d=c[a7(0x261)]['getElementById'](a7(0x1f7))??c[a7(0x261)];this[a7(0x1d9)]=new MutationObserver(()=>this['_scheduleInject']()),this['_mo']['observe'](d,{'childList':!![],'subtree':!![]}),this['_scheduleInject']();});}['_injectDark'](c,d){const e=()=>{const a8=b;if(!c['shadowRoot']){setTimeout(e,0x32);return;}try{const f=new CSSStyleSheet();f[a8(0x198)](IobrokerWebui3DScreenPropertiesPanel['_PG_DARK']),c[a8(0x261)]['adoptedStyleSheets']=[...c['shadowRoot']['adoptedStyleSheets']??[],f];}catch(g){}d?.();};e();}['_typeInfo'](){const a9=F;return{'name':this['_selectedObj']?.[a9(0x278)]||'3D\x20Object','properties':this[a9(0x1e6)]['map'](c=>({'name':c[a9(0x1c8)],'type':c[a9(0x26b)],'category':c[a9(0x22e)],'description':c['label']}))};}[F(0x220)](c){const aa=F,d=c['material'];return{'positionX':+c[aa(0x21a)]['x']['toFixed'](0x4),'positionY':+c['position']['y']['toFixed'](0x4),'positionZ':+c['position']['z'][aa(0x233)](0x4),'rotationX':+(c['rotation']['x']*DEG)[aa(0x233)](0x3),'rotationY':+(c[aa(0x201)]['y']*DEG)['toFixed'](0x3),'rotationZ':+(c['rotation']['z']*DEG)[aa(0x233)](0x3),'scaleX':+c['scale']['x']['toFixed'](0x4),'scaleY':+c['scale']['y']['toFixed'](0x4),'scaleZ':+c[aa(0x1f8)]['z']['toFixed'](0x4),'visible':!!c[aa(0x1e2)],'opacity':d?+(d[aa(0x244)]??0x1)[aa(0x233)](0x3):0x1,'color':d?.['color']?'#'+d[aa(0x1b2)][aa(0x229)]():aa(0x1ad)};}[F(0x231)](c,d){const ab=F;if(!c)return;if(!c[ab(0x251)]){setTimeout(()=>this['_safeSetSelected'](c,d),0x1e);return;}c[ab(0x1a9)]=d;}['_refreshGrid'](){const ac=F;if(!this['_pg'])return;if(!this['_selectedObj']){this[ac(0x231)](this['_pg'],null);return;}this[ac(0x23b)]=this['_buildProxy'](this[ac(0x277)]),this['_safeSetSelected'](this[ac(0x1e0)],this[ac(0x23b)]),this['_scheduleInject']();}[F(0x207)](){clearTimeout(this['_injTmr']),this['_injTmr']=setTimeout(()=>this['_injectAllSquares'](),0x3c);}[F(0x1bf)](){const ad=F;this['_injectSquaresInto'](this['_pg'],this[ad(0x277)]?.['uuid'],c=>this['_PROPS']['find'](d=>d[ad(0x1c8)]===c)?.['key']),this[ad(0x1a1)]&&this[ad(0x279)](this[ad(0x275)],this['_selectedInstance'][ad(0x228)],c=>this[ad(0x1b7)]&&c in this['_currentDefs']?c:null);}[F(0x279)](c,d,e){const ae=F,f=c?.[ae(0x261)];if(!f||!d)return;for(const g of f[ae(0x1fa)]('.wb-node')){const h=g[ae(0x22c)](ae(0x1ef))??g,i=h[ae(0x241)]?.[ae(0x217)](),j=e(i),k=g[ae(0x1ca)]('.wb-row');if(!j||!k)continue;const l=!!this[ae(0x1a8)][d]?.[j]?.['signal'];let m=k[ae(0x22c)](ae(0x1d2));if(!m){if(getComputedStyle(k)[ae(0x21a)]==='static')k['style'][ae(0x21a)]='relative';m=document['createElement']('span'),m[ae(0x254)]='bsq3d',m[ae(0x227)]=ae(0x25c),m['style'][ae(0x211)]='position:absolute;left:5px;top:0;bottom:0;margin:auto\x200;'+ae(0x1c9)+ae(0x249);const n=o=>{const af=ae;o['preventDefault'](),o[af(0x1c5)](),this['_openMenu'](o,m[af(0x239)]['k'],m['dataset']['u']);};m[ae(0x1de)](ae(0x203),n),m['addEventListener'](ae(0x209),n),k[ae(0x212)](m);}m['dataset']['k']=j,m[ae(0x239)]['u']=d,m['style']['background']=l?'#e08020':ae(0x1e5),m[ae(0x22b)]['borderColor']=l?ae(0x26a):'#4a5f72';}}[F(0x265)](c,d,e){const ag=F,f=this['_PROPS'][ag(0x1af)](k=>k['path']===e),g=f?.[ag(0x1b4)],h=this['_selectedObj']?.[ag(0x228)],i=h&&g?this[ag(0x1a8)][h]?.[g]:null;if(i?.[ag(0x1b0)]){const k=document[ag(0x199)](ag(0x20d));return k[ag(0x241)]=i[ag(0x1b0)],k[ag(0x227)]=i[ag(0x1b0)],k['style'][ag(0x211)]=ag(0x1d5),k;}let j;if(c['type']===ag(0x27f))j=document['createElement'](ag(0x1f4)),j['type']=ag(0x1a5),j[ag(0x271)]=!!d,j[ag(0x224)]=()=>this[ag(0x1e0)][ag(0x206)](e,j['checked']);else c['type']===ag(0x1b2)?(j=document[ag(0x199)]('input'),j['type']='color',j['value']=d||ag(0x1ad),j['style'][ag(0x211)]=ag(0x27b),j[ag(0x1a4)]=()=>this['_pg']['setPropertyValue'](e,j['value'])):(j=document['createElement'](ag(0x1f4)),j[ag(0x26b)]=ag(0x1e1),j[ag(0x204)]='any',j[ag(0x216)]=d??'',j[ag(0x22b)][ag(0x211)]=ag(0x1fb),j[ag(0x224)]=()=>this['_pg'][ag(0x206)](e,j[ag(0x20a)]),j[ag(0x200)]=l=>{const ah=ag;if(l['key']==='Enter')this['_pg']['setPropertyValue'](e,j[ah(0x20a)]);});return j;}['_onProxyChanged'](c){const ai=F,d=this['_selectedObj'];if(!d)return;const f=c[ai(0x252)];this[ai(0x1d7)]=!![];try{switch(c[ai(0x1b3)]){case ai(0x1d8):d['position']['x']=f;break;case ai(0x230):d['position']['y']=f;break;case ai(0x236):d[ai(0x21a)]['z']=f;break;case'rotationX':d[ai(0x201)]['x']=f*RAD;break;case'rotationY':d['rotation']['y']=f*RAD;break;case ai(0x1bb):d[ai(0x201)]['z']=f*RAD;break;case ai(0x25e):d[ai(0x1f8)]['x']=f;break;case'scaleY':d[ai(0x1f8)]['y']=f;break;case ai(0x1b9):d[ai(0x1f8)]['z']=f;break;case ai(0x1e2):d[ai(0x1e2)]=!!f;break;case ai(0x244):d[ai(0x1cf)]&&(d[ai(0x1cf)]['opacity']=f,d[ai(0x1cf)]['transparent']=f<0x1,d['material'][ai(0x1b8)]=!![]);break;case ai(0x1b2):d[ai(0x1cf)]?.[ai(0x1b2)]&&(d['material']['color'][ai(0x21c)](f),d['material'][ai(0x1b8)]=!![]);break;}this['_editor']?.['signals']?.[ai(0x1f2)]?.[ai(0x26c)]?.(d);}finally{this[ai(0x1d7)]=![];}}['_updateHeader'](){const aj=F,c=this['_selectedObj'],d=this['_getDomElement']('objType'),e=this['_getDomElement'](aj(0x260));if(!d||!e)return;!c?(d['textContent']='',e['textContent']=aj(0x1a7)):(d['textContent']=c['type']||'',e['textContent']=c['name']||c[aj(0x228)]?.['slice'](0x0,0x8)||'—');}['_setupMenu'](){const ak=F,c=this[ak(0x19e)]('ctxMenu'),d=this[ak(0x19e)]('ctxBack');if(!c||!d)return;d[ak(0x1de)]('click',()=>this[ak(0x1a3)]()),d[ak(0x1de)](ak(0x209),f=>{const al=ak;f['preventDefault'](),this[al(0x1a3)]();}),c[ak(0x1de)](ak(0x203),f=>{const am=ak,g=f[am(0x1d3)]['closest'](am(0x1d4));if(!g)return;const h=g['dataset']['action'];this['_closeMenu']();if(h==='editbind')this['_openBindDialog'](this['_ctxTarget']);if(h===am(0x1ec))this['_openTextEdit'](this[am(0x1a2)]);if(h===am(0x1f9))this[am(0x25b)](this['_ctxTarget']);});}['_openMenu'](c,d,f){const an=F;if(!d||!f)return;this['_ctxTarget']={'uuid':f,'key':d};const g=this[an(0x19e)]('ctxMenu'),h=this[an(0x19e)](an(0x1b6));if(!g||!h)return;g['style'][an(0x1fe)]=c['clientX']+'px',g[an(0x22b)]['top']=c['clientY']+'px',g[an(0x1f0)][an(0x210)]('open'),h['classList'][an(0x210)]('open');}['_closeMenu'](){const ao=F;this['_getDomElement'](ao(0x23f))?.[ao(0x1f0)]['remove']('open'),this['_getDomElement']('ctxBack')?.[ao(0x1f0)][ao(0x21f)](ao(0x243));}['_clearBind']({uuid:c,key:d}={}){const ap=F;if(!c||!d)return;if(this[ap(0x1a8)][c]){delete this['_bindings'][c][d];if(!Object[ap(0x258)](this[ap(0x1a8)][c])[ap(0x22d)])delete this['_bindings'][c];}this['_syncHost'](),this[ap(0x1e0)]?.['refresh'](),this['_propsPg']?.[ap(0x1ee)](),this[ap(0x207)]();}['_openTextEdit']({uuid:c,key:d}={}){const aq=F;if(!c||!d)return;const e=this['_bindings'][c]?.[d],f=window[aq(0x24f)]('ioBroker\x20State\x20ID\x20for\x20\x22'+d+'\x22:',e?.['signal']||'');if(f===null)return;if(!f['trim']()){this['_clearBind']({'uuid':c,'key':d});return;}if(!this[aq(0x1a8)][c])this[aq(0x1a8)][c]={};this['_bindings'][c][d]={...e||{},'signal':f['trim']()},this['_syncHost'](),this['_pg']?.['refresh'](),this['_propsPg']?.['refresh'](),this['_scheduleInject']();}async['_openBindDialog']({uuid:c,key:d}={}){const ar=F;if(!c||!d||!this[ar(0x1ae)]){console['warn'](ar(0x223),{'uuid':c,'key':d,'hasShell':!!this['_appShell']});return;}const e=this[ar(0x1e6)]['find'](m=>m['key']===d)?.[ar(0x1da)]||d,f=this['_bindings'][c]?.[d],g=f?.['signal']?{'bindableObjectNames':[f['signal']],'expression':f['formula']&&f['formula']!=='val'?f['formula']:'','invert':f[ar(0x1be)]||![],'historic':f[ar(0x1df)]||null,'converter':f['converter']||null,'target':ar(0x1b3)}:null;let h,i;try{[{IobrokerWebuiBindingsEditor:h},{IobrokerWebuiConfirmationWrapper:i}]=await Promise['all']([import(ar(0x23e)),import('./IobrokerWebuiConfirmationWrapper.js')]);}catch(m){console[ar(0x1bd)](ar(0x21b),m);return;}const j=new h({'name':e,'propertyType':'propertyAndAttribute'},g,'property',this[ar(0x1ae)][ar(0x205)],null,this[ar(0x1ae)]),k=new i();k['title']=ar(0x1f6)+d,k[ar(0x212)](j);const l=this['_appShell']['openDialog'](k,{'x':0xc8,'y':0x96,'width':0x2bc,'height':0x1cc});k[ar(0x1cb)]['on'](()=>l['close']()),k['okClicked']['on'](()=>{const as=ar;l['close']();const n=j['objectNames'];if(n){if(!this['_bindings'][c])this[as(0x1a8)][c]={};const o={'signal':n};if(j['expression'])o[as(0x1fc)]=j['expression'];if(j['invert'])o['invert']=!![];if(j[as(0x1df)])o['historic']=j[as(0x1df)];this['_bindings'][c][d]=o;}else this['_clearBind']({'uuid':c,'key':d});this['_syncHost'](),this['_pg']?.[as(0x1ee)](),this[as(0x275)]?.['refresh'](),this[as(0x207)]();});}['_syncHost'](){const at=F;if(this['_editorHost']?.[at(0x276)])this['_editorHost']['sceneData']['bindings']=this['_bindings'];}[F(0x1c1)](){const au=F;try{this['_mo']?.['disconnect']();}catch(c){}try{this[au(0x1e3)]?.['disconnect']();}catch(d){}clearTimeout(this['_injTmr']),super['disconnectedCallback']?.();}}customElements[F(0x242)](F(0x24b),IobrokerWebui3DScreenPropertiesPanel);
|