/**
 * Copyright 2018 The Pennsylvania State University
 * @license Apache-2.0, see License.md for full text.
 */
import{generateResourceID as e}from"../utils/utils.js";export const SchemaBehaviors=function(s){return class extends s{constructor(){super(),this.schemaResourceID="",this.schemaMap={prefix:{oer:"http://oerschema.org/",schema:"http://schema.org/",dc:"http://purl.org/dc/terms/",foaf:"http://xmlns.com/foaf/0.1/",cc:"http://creativecommons.org/ns#",bib:"http://bib.schema.org"}}}static get properties(){return{...super.properties,schemaMap:{type:Object,readOnly:!0,observer:"_schemaMapChanged"}}}updated(e){super.updated&&super.updated(e),e.forEach(((e,s)=>{"schemaMap"==s&&this._schemaMapChanged(this[s],e)}))}_schemaMapChanged(s,t){if(void 0!==s){this.schemaResourceID=this.getAttribute("resource"),""!=this.schemaResourceID&&null!=this.schemaResourceID&&"null"!=this.schemaResourceID||(this.schemaResourceID=e(),this.setAttribute("resource",this.schemaResourceID));let t=s.prefix,h="";for(var r in t)t.hasOwnProperty(r)&&(h+=r+":"+t[r]+" ");""!=h&&this.setAttribute("prefix",h)}}}};