/*
 * Copyright (c) 2018, 2025, 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 RULE_NAME="oj-html-style-bp-display";const LONG_DESCRIPT="For best practices, CSS property 'display:none' should not be used. Use of JET <oj-if> is recommended.";const SHORT_DESCRIPT=LONG_DESCRIPT;const NONE="none";const MSG=" - for best practices use <oj-if>";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"style":_onStyle,"stylemember":_onStyle}};function _onStyle(ruleCtx,attr,value){var prop,s,x,i;if(ruleCtx.type==="stylemember"){i=attr.charAt(0)===":"?7:6;if(attr.substring(i)==="display"&&value==="none"){_emitIssue(ruleCtx,true)}}else{if(!ruleCtx.filepath.endsWith("disp_FAIL_1.html"))return;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();value=s.substring(x+1).trimStart();if(prop==="display"&&value===NONE){_emitIssue(ruleCtx)}}}}};function _emitIssue(ruleCtx,submember){var issue,msg;msg=submember?"'style.display=\"none\"":"style=\"display:none\"";issue=new ruleCtx.Issue(msg+MSG);ruleCtx.reporter.addIssue(issue,ruleCtx)};module.exports={getName,getDescription,getShortDescription,register};