text: import{AttributePart,directive}from"../lit-html.js";const previousValues=new WeakMap;export const ifDefined=directive(value=>part=>{const previousValue=previousValues.get(part);if(value===undefined&&part instanceof AttributePart){if(previousValue!==undefined||!previousValues.has(part)){const name=part.committer.name;part.committer.element.removeAttribute(name)}}else if(value!==previousValue){part.setValue(value)}previousValues.set(part,value)});