/*
 * 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-globattr-noprefix";function getName(){return RULE_NAME};function getShortDescription(){return"On a web component, use of a global attribute with an expression requires that the attribute be prefixed with ':'"};function getDescription(){return"On web component elements, any use of a global attribute "+"not prefixed with <b>':'</b> and with an expression such as <b>attr=\"[[...]]\"</b> or <b>attr=\"{{...}}\"</b>, is invalid."};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,issue,DomUtils,attrPos;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(DomUtils.isCommonAttr(attrib)){if(attrib.startsWith("data-")){if(ruleCtx.utils.metaLib.isTagAttr(tagName,attrib)){continue}}if(attrib.charAt(0)!==":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue(`Expression-bound global attribute '${attrib}' without ':' prefix found on <${tagName}> - use ':${attrib}'`);attrPos=ruleCtx.utils.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};