vendor: 1,094 bytes, lines 1-9
1// lit-html/directives/[email protected] downloaded from https://ga.jspm.io/npm:[email protected]/directives/class-map.js 2 3import{noChange as e}from"lit-html";import{directive as t,Directive as n,PartType as r}from"lit-html/directive"; 4/** 5* @license 6* Copyright 2018 Google LLC 7* SPDX-License-Identifier: BSD-3-Clause 8*/const i=t(class extends n{constructor(e){if(super(e),e.type!==r.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(t,[n]){if(this.st===void 0){this.st=/* @__PURE__ */ new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in n)n[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(n)}let r=t.element.classList;for(let e of this.st)e in n||(r.remove(e),this.st.delete(e));for(let e in n){let t=!!n[e];t===this.st.has(e)||this.nt?.has(e)||(t?(r.add(e),this.st.add(e)):(r.remove(e),this.st.delete(e)))}return e}});export{i as classMap}; 9
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.