/*
 * Copyright (c) 2018, 2026, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-disabled-property"};ruleDef.prototype.getShortDescription=function(){return"Check component does not use the problematic disabled property"};ruleDef.prototype.getDescription=function(){return"This rule checks that a component does not define a property called disabled which can cause issues with IE"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==="composite"){if(meta.properties&&meta.properties.hasOwnProperty("disabled")){var deprecated=false;if(meta.properties.disabled.hasOwnProperty("status")){var statusArray=meta.properties.disabled.status;statusArray.forEach(status=>{if(status.hasOwnProperty("type")){if(status.type==="deprecated"){deprecated=true}}})}if(!deprecated){issue=new context.Issue(`Component ${fullName} defines a property called 'disabled' this can cause problems with Internet Explorer and we recommend 'disable' as a replacement property name`);context.reporter.addIssue(issue,context)}}}}};module.exports=ruleDef;