text: import{html,PolymerElement}from"../../@polymer/polymer/polymer-element.js";import"../../@polymer/paper-button/paper-button.js";class LayoutBuilder extends PolymerElement{static get template(){return html`
        <style>
          :host {
            display: block;
          }
  
          :host paper-button {
            display: block;
            margin: 0;
          }
          :host paper-button,
          :host #content-wrapper {
            border: 1px solid #ddd;
          }
  
          :host #content:not(:empty) {
            padding: 15px;
          }
  
          :host([hidden]) {
            display: none;
          }
        </style>
        <div id="content-wrapper">
          <div id="prepend-child">
            <paper-button on-tap="_handleAddChild"
              >Insert into [[type]]</paper-button
            >
          </div>
          <div id="content"><slot></slot></div>
        </div>
        <div id="insert-sibling-after">
          <paper-button on-tap="_handleAddSibling">Add new [[type]]</paper-button>
        </div>
      `}static get haxProperties(){return{canScale:!0,canPosition:!0,canEditSource:!1,gizmo:{title:"Layout builder",description:"A new UI for adding content to layouts",icon:"icons:android",color:"green",groups:["Builder"],handles:[{type:"todo:read-the-docs-for-usage"}],meta:{author:"nikkimk",owner:"The Pennsylvania State University"}},settings:{quick:[],configure:[],advanced:[]}}}static get properties(){let props={type:{name:"type",type:Boolean,value:"layout"},id:{name:"id",type:String,reflecttoAttribute:!0}};return super.properties&&(props=Object.assign(props,super.properties)),props}static get tag(){return"layout-builder"}connectedCallback(){super.connectedCallback(),this.id=this._generateUUID()}_handleAddChild(){let lb=document.createElement("layout-builder");lb.type="sub-"+this.type,lb.innerHTML=`I am a ${this.type} of ${this.id}.`,this.prepend(lb)}_handleAddSibling(){let lb=document.createElement("layout-builder");lb.type=this.type,lb.innerHTML=`I am a ${this.type} of ${this.id}.`,this.parentNode.insertBefore(lb,this.nextSibling)}_generateUUID(){let hex=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return this.type+"-ss-s-s-s-sss".replace(/s/g,hex)}}window.customElements.define(LayoutBuilder.tag,LayoutBuilder);export{LayoutBuilder};