/*
 * 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 getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._slotAttr(ruleCtx,slotVal)}};Rule.prototype._slotAttr=function(ruleCtx,slotVal){var issue,node;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){issue=new ruleCtx.Issue(`unresolved slot '${slotVal}' on <${ruleCtx.tag}>`);let attrPos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;