/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
import"./boot.js";const t=window.trustedTypes&&trustedTypes.createPolicy("polymer-html-literal",{createHTML:t=>t});class LiteralString{constructor(t,e){assertValidTemplateStringParameters(t,e);const r=e.reduce(((e,r,n)=>e+literalValue(r)+t[n+1]),t[0]);this.value=r.toString()}toString(){return this.value}}function literalValue(t){if(t instanceof LiteralString)return t.value;throw new Error(`non-literal value passed to Polymer's htmlLiteral function: ${t}`)}export const html=function html(e,...r){assertValidTemplateStringParameters(e,r);const n=document.createElement("template");let l=r.reduce(((t,r,n)=>t+function htmlValue(t){if(t instanceof HTMLTemplateElement)return t.innerHTML;if(t instanceof LiteralString)return literalValue(t);throw new Error(`non-template value passed to Polymer's html function: ${t}`)}(r)+e[n+1]),e[0]);return t&&(l=t.createHTML(l)),n.innerHTML=l,n};const assertValidTemplateStringParameters=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(t.raw)||e.length!==t.length-1)throw new TypeError("Invalid call to the html template tag")};export const htmlLiteral=function(t,...e){return new LiteralString(t,e)};