/*
 * 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 RULE_NAME="oj-html-ojtag-nonglobattr-prefix";const SHORT="Web component elements with a non-global attribute with a ':' prefix and an attribute expression, is not recommended";const LONG="On web component elements, any use of a non-global attribute prefixed with ':' and with an attribute expression such "+"as attr=\"[[...]]\" or attr=\"{{...}}\", is not recommended.<br><br>"+"If the expression has a complex (e.g. array or object) value, it won't be applied correctly. The :foo syntax is effectively "+"binding an attribute on the element, which means that the value is always coerced to a string (since that's all HTML attributes are). "+"The standard non-colon binding creates a property binding which can have any value it wants because the value will be "+"applied on the JS object, not the DOM element.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return LONG};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,DomUtils,attrPos,issue;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(tagName==="oj-label"&&(attrib==="for"||attrib===":for")){continue}if(!DomUtils.isCommonAttr(attrib)){if(attrib.charAt(0)===":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue(`Expression-bound non-global attribute '${attrib}' with ':' prefix found on <${tagName}> - use '${attrib.substring(1)}'`);attrPos=DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};