(()=>{function e(p,u,v,m,f){return{require:"ngModel",restrict:"EA",link:function(i,a,e,n){var c,s,r;function t(){var e,t;r=!1,(s=n.$viewValue)?(c=i.$new(!0),_.forEach(i.mapping,function(e,t){Object.defineProperty(c,t,{enumerable:!0,get:_.partial(o,t)})}),_.assign(c,{goToGroupDetails:d,goToDeviceDetails:l,getActiveAlarmsStatusClass:g,isReady:_.constant(!0)}),"none"===i.sanitizationOption&&(r=!0),e=angular.element('<div ng-if="isReady()" style="width:100%;height:100%;transform: translateZ(0);"></div>'),t=document.implementation.createHTMLDocument(""),t=$.parseHTML(s,t,r),$(t).is("svg")?(e.append($(t).filter("svg")),n.$setValidity("c8y-scada-svg",!0)):(e.html('<div class="alert-warning" translate style="padding: 20px;">'.concat(f("Invalid SVG"),"</div>")),n.$setValidity("c8y-scada-svg",!1)),p(e)(c),a.html(""),a.append(e)):n.$setValidity("c8y-scada-svg",!1)}function o(t){var e=i.mapping[t],a=_.find(i.devices,function(e){return i.deviceIds[t]===e.id});return m.getValueForMapping(a,e)}function d(e){u.path("/group/".concat(e))}function l(e){u.path("/device/".concat(e))}function g(e){return _.toLower(v.getHighestSeverityFromAlarmsStatus(e))||"none"}n.$render=t,i.$watch("mapping",t),i.$watch("deviceIds",t,!0)},scope:{mapping:"=",devices:"=",deviceIds:"=",sanitizationOption:"=?"},replace:!1}}e.$inject=["$compile","$location","c8yAlarms","ScadaWidgetUtilSvc","gettext"],angular.module("c8y.parts.scadaWidget").directive("c8yScadaSvg",e)})();