-
Notifications
You must be signed in to change notification settings - Fork 1
/
6f58b968.js
1 lines (1 loc) · 83.9 KB
/
6f58b968.js
1
System.register(["./be7cca87.js"],(function(e,t){"use strict";var i,a,n,o,r,s,l,c,d,u,p,h,m,g,f,v,x,b,y,S,T,k,H,w,E,N,C,A,P,_,L,O,M,D,R,B,z,W,X;return{setters:[function(e){i=e.m,a=e.w,n=e.az,o=e.a,r=e.c,s=e.j,l=e.l,c=e._,d=e.e,u=e.f,p=e.g,h=e.d,m=e.n,g=e.aA,f=e.a4,v=e.aB,x=e.t,b=e.k,y=e.b,S=e.ap,T=e.u,k=e.q,H=e.au,w=e.a3,E=e.U,N=e.aq,C=e.v,A=e.aC,P=e.aD,_=e.aE,L=e.aF,O=e.aG,M=e.p,D=e.h,R=e.aH,B=e.a5,z=e.aI,W=e.a6,X=e.aJ}],execute:function(){var j=e("a",{defaultSettings:{type:"string"},format:{"simple-fields":{defaultSettings:{type:"object",format:"simple-fields"}}},inputMethod:{alt:{defaultSettings:{type:"string",format:"alt"}},array:{defaultSettings:{type:"array"},properties:{label:"itemLabel"}},boolean:{defaultSettings:{type:"boolean"}},code:{defaultSettings:{type:"markup"}},"code-editor":{defaultSettings:{type:"markup"}},color:{defaultSettings:{type:"string",format:"color"}},colorpicker:{defaultSettings:{type:"string",format:"colorpicker"}},"date-time":{defaultSettings:{type:"string",format:"date-time"}},datepicker:{defaultSettings:{type:"string",format:"date"}},fieldset:{defaultSettings:{type:"object"}},fileupload:{defaultSettings:{type:"string",format:"fileupload"}},haxupload:{defaultSettings:{type:"string",format:"fileupload"}},iconpicker:{defaultSettings:{type:"string",format:"iconpicker"}},markup:{defaultSettings:{type:"markup"}},"md-block":{defaultSettings:{type:"markup",format:"md-block"}},monthpicker:{defaultSettings:{type:"string",format:"month"}},number:{defaultSettings:{type:"number"}},object:{defaultSettings:{type:"object"}},select:{defaultSettings:{type:"string",format:"select"}},radio:{defaultSettings:{type:"string",format:"radio"}},slider:{defaultSettings:{type:"number",format:"slider"}},tabs:{defaultSettings:{type:"object",format:"tabs"}},collapse:{defaultSettings:{type:"object",format:"collapse"}},textarea:{defaultSettings:{type:"string",format:"textarea"}},timepicker:{defaultSettings:{type:"string",format:"time"}},weekpicker:{defaultSettings:{type:"string",format:"week"}}}}),I=e("b",{defaultSettings:{element:"simple-fields-field",errorProperty:"errorMessage",invalidProperty:"invalid",noWrap:!0,attributes:{type:"text"},properties:{minLength:"minlength",maxLength:"maxlength"}},format:{radio:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"radio"},properties:{options:"options"},child:{element:"simple-fields-array-item",noWrap:!0,descriptionProperty:"description",properties:{previewBy:"previewBy"}}}},select:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"select"},properties:{options:"options",items:"itemsList"}}},"simple-picker":{defaultSettings:{element:"simple-picker",attributes:{autofocus:!0},properties:{options:"options"}}}},type:{array:{defaultSettings:{element:"simple-fields-array",noWrap:!0,descriptionProperty:"description",child:{element:"simple-fields-array-item",noWrap:!0,descriptionProperty:"description",properties:{previewBy:"previewBy"}}}},boolean:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"checkbox",value:!1}}},file:{defaultSettings:{import:"@haxtheweb/hax-body/lib/hax-upload-field.js",element:"hax-upload-field",noWrap:!0,attributes:{autofocus:!0,type:"file","show-sources":!0},properties:{accepts:"accepts"}}},integer:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,step:1,type:"number"},properties:{minimum:"min",maximum:"max",multipleOf:"step"}}},markup:{defaultSettings:{import:"@haxtheweb/simple-fields/lib/simple-fields-code.js",element:"simple-fields-code",setValueProperty:"editorValue",noWrap:!0},format:{"md-block":{defaultSettings:{element:"md-block",setValueProperty:"source",noWrap:!0}}}},number:{defaultSettings:{element:"simple-fields-field",noWrap:!0,type:"number",attributes:{autofocus:!0,type:"number"},properties:{minimum:"min",maximum:"max",multipleOf:"step"}}},object:{defaultSettings:{element:"simple-fields-fieldset",noWrap:!0},format:{cardlist:{defaultSettings:{element:"hax-element-card-list",noWrap:!0}},tabs:{defaultSettings:{import:"@haxtheweb/simple-fields/lib/simple-fields-tabs.js",element:"simple-fields-tabs",noWrap:!0,child:{import:"@haxtheweb/simple-fields/lib/simple-fields-tab.js",element:"simple-fields-tab",noWrap:!0,labelSlot:"label",descriptionSlot:""},properties:{layoutBreakpoint:"layoutBreakpoint",iconBreakpoint:"iconBreakpoint",sticky:"sticky"}}},collapse:{defaultSettings:{import:"@haxtheweb/a11y-collapse/lib/a11y-collapse-group.js",element:"div",noWrap:!0,attributes:{radio:!0,"heading-button":!0,accordion:!0},child:{import:"@haxtheweb/a11y-collapse/a11y-collapse.js",element:"a11y-collapse",noWrap:!0,labelSlot:"heading",descriptionSlot:""}}},fields:{defaultSettings:{element:"simple-fields",noWrap:!0,descriptionProperty:"description",properties:{schema:"schema"}}}}},string:{format:i(i(i(i(i(i(i(i({alt:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,required:!0}}},color:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"color"}}},colorpicker:{defaultSettings:{import:"@haxtheweb/simple-colors/lib/simple-colors-picker.js",element:"simple-colors-picker",attributes:{autofocus:!0}}},date:{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"date"}}},"date-time":{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"datetime-local"}}}},"date",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"date"}}}),"email",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"email"}}}),"fileupload",{defaultSettings:{import:"@haxtheweb/hax-body/lib/hax-upload-field.js",element:"hax-upload-field",noWrap:!0,attributes:{autofocus:!0,"show-sources":!0},properties:{accepts:"accepts"}}}),"iconpicker",{defaultSettings:{import:"@haxtheweb/simple-icon-picker/simple-icon-picker.js",element:"simple-icon-picker",attributes:{autofocus:!0},properties:{options:"icons"}}}),"month",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"month"}}}),"textarea",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"textarea"}}}),"time",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"time"}}}),"uri",{defaultSettings:{element:"simple-fields-field",noWrap:!0,attributes:{autofocus:!0,type:"file"},properties:{accepts:"accepts"}}})}}}),G={url:new URL("./elements/hax-body-behaviors/lib/HAXWiring.js",document.baseURI).href},q=e("c",o((function e(){var i=this;r(this,e),this.haxProperties={type:"element",editingElement:"core",hideDefaultSettings:!1,canScale:!1,canEditSource:!0,settings:{configure:[],advanced:[],developer:[]},wipeSlot:{}},this.setup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return"undefined"!==a(i.tagName)&&(t=i.tagName.toLowerCase()),globalThis.addEventListener("hax-store-ready",i._haxStoreReady.bind(i)),"undefined"!==a(globalThis.HaxStore)&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?i.setHaxProperties(e,t,n,!0):i.setHaxProperties(e,t,n,!1)},this._haxStoreReady=function(e){if(e.detail&&"undefined"!==a(i.tagName)&&"undefined"!==a(i.haxProperties)){var t=i.tagName,n=i.haxProperties,o=i;if(""!=t&&"undefined"===a(globalThis.HaxStore)){var r=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:t.toLowerCase(),properties:n}});o.dispatchEvent(r)}else if(""!=t&&"undefined"===a(globalThis.HaxStore.instance.elementList[t.toLowerCase()])){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:t.toLowerCase(),properties:n}});o.dispatchEvent(s)}else if("undefined"!==a(i.tagName)&&"undefined"===a(globalThis.HaxStore.instance.elementList[i.tagName.toLowerCase()])){var l=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:n}});o.dispatchEvent(l)}}},this.setHaxProperties=s(l().mark((function e(){var n,o,r,s,c,d,u,p,h=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:{},o=h.length>1&&void 0!==h[1]?h[1]:"",r=h.length>2&&void 0!==h[2]?h[2]:document,s=h.length>3&&void 0!==h[3]&&h[3],"string"!=typeof n){e.next=8;break}return e.next=7,fetch(n).then((function(e){return!(!e||!e.json)&&e.json()}));case 7:n=e.sent;case 8:if("undefined"===a(n.api)&&(n.api="1"),"1"==n.api){if("undefined"===a(n.type)&&(n.type="element"),"undefined"===a(n.editingElement)&&(n.editingElement="core"),"undefined"===a(n.hideDefaultSettings)&&(n.hideDefaultSettings=!1),"undefined"===a(n.canScale)&&(n.canScale=!0),"undefined"===a(n.designSystem)&&(n.designSystem={primary:!1,accent:!1,text:!1,card:!1,designTreatment:!1}),"undefined"===a(n.canEditSource)&&(n.canEditSource=!1),"undefined"===a(n.contentEditable)&&(n.contentEditable=!1),"undefined"===a(n.gizmo)?n.gizmo=!1:"undefined"!==a(n.gizmo.iconLib)&&(c=globalThis.WCGlobalBasePath?globalThis.WCGlobalBasePath:new URL("./HAXWiring.js",G.url).href+"/../../../../",t.import("".concat(c).concat(n.gizmo.iconLib))),"undefined"!==a(n.settings)){for("undefined"===a(n.settings.configure)&&(n.settings.configure=[]),d=0;d<n.settings.configure.length;d++)n.settings.configure[d]=i.validateSetting(n.settings.configure[d]),n.settings.configure[d]||n.settings.configure.splice(d,1);for("undefined"===a(n.settings.advanced)&&(n.settings.advanced=[]),u=0;u<n.settings.advanced.length;u++)n.settings.advanced[u]=i.validateSetting(n.settings.advanced[u]),n.settings.advanced[u]||n.settings.advanced.splice(u,1);for("undefined"===a(n.settings.developer)&&(n.settings.developer=[]),p=0;p<n.settings.developer.length;p++)n.settings.developer[p]=i.validateSetting(n.settings.developer[p]),n.settings.developer[p]||n.settings.developer.splice(p,1);globalThis.HaxStore&&(n=globalThis.HaxStore.requestAvailability().designSystemHAXProperties(n,o)),n=i.standardAdvancedProps(n,o)}"undefined"===a(n.saveOptions)&&(n.saveOptions={wipeSlot:!1}),"undefined"===a(n.documentation)&&(n.documentation={howTo:null,purpose:null}),"undefined"===a(n.demoSchema)&&(n.demoSchema=[]),s&&i.readyToFireHAXSchema(o,n,r),""===o&&("function"==typeof i._setHaxProperties?i._setHaxProperties(n):i.haxProperties=n)}else console.warn("This is't a valid usage of hax API. See hax-body-behaviors/lib/HAXWiring.js for more details on how to implement the API. https://haxtheweb.org/hax-schema for details but we will try and guess the wiring");case 10:case"end":return e.stop()}}),e)}))),this.readyToFireHAXSchema=function(e,t,n){if(""!=e&&"undefined"===a(globalThis.HaxStore)){var o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});n.dispatchEvent(o)}else if(""!=e){var r=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});n.dispatchEvent(r)}else if("undefined"!==a(i.tagName)){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:t}});n.dispatchEvent(s)}else if("undefined"!==a(n.tagName)){var l=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:n.tagName.toLowerCase(),properties:t}});n.dispatchEvent(l)}else console.warn(n),console.warn("".concat(e," missed our checks and has an issue in implementation with HAX"))},this.standardAdvancedProps=function(e,t){return e.hideDefaultSettings||(e.settings.advanced.push({attribute:"data-hax-lock",title:"Lock editing",description:"Prevent changes to this element and all its content",inputMethod:"boolean"}),e.settings.developer.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.developer.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.developer.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.developer.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.developer.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.developer.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.developer.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.developer.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"})),e},this.validateSetting=function(e){return("undefined"!==a(e.property)||"undefined"!==a(e.slot)||"undefined"!==a(e.attribute))&&("undefined"===a(e.title)&&("undefined"===a(e.attribute)?e.title=e.property:e.title=e.attribute),"undefined"===a(e.description)&&(e.description=""),"undefined"===a(e.inputMethod)&&(e.inputMethod="textfield"),"undefined"===a(e.type)&&(e.type="settings"),"undefined"===a(e.icon)&&(e.icon="android"),"undefined"===a(e.options)&&(e.options={}),"undefined"===a(e.required)&&(e.required=!1),"undefined"===a(e.disabled)&&(e.disabled=!1),"undefined"===a(e.validation)&&(e.validation=".*"),"undefined"===a(e.validationType)&&(e.validationType=""),"undefined"!==a(e.slot)&&("undefined"===a(e.slotWrapper)&&(e.slotWrapper="span"),"undefined"===a(e.slotAttributes)&&(e.slotAttributes={})),e)},this.getHaxProperties=function(){return i.haxProperties},this.getHaxJSONSchema=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;"undefined"===a(e)&&(e="configure"),"undefined"===a(t)&&(t=o.haxProperties);var r=t.settings[e],s={$schema:"http://json-schema.org/schema#",title:"HAX "+e+" form schema",type:"object",properties:{}};if(s.properties=(new n).fieldsToSchema(r),t.gizmo&&t.gizmo.tag&&globalThis.customElements.get(t.gizmo.tag)){var l=globalThis.document.createElement(t.gizmo.tag);s="function"==typeof l.postProcessgetHaxJSONSchema?l.postProcessgetHaxJSONSchema(s):o.postProcessgetHaxJSONSchema(s)}else s=o.postProcessgetHaxJSONSchema(s);return s},this.postProcessgetHaxJSONSchema=function(e){return e},this._getHaxJSONSchemaProperty=function(e){return(new n).fieldsToSchema(e)},this.getHaxJSONSchemaType=function(e){var t=(new n).fieldsConversion.inputMethod[e]||(new n).fieldsConversion;return t&&t.defaultSettings&&t.defaultSettings.type?t.defaultSettings.type:"string"},this.validHAXPropertyInputMethod=function(){return Object.keys((new n).fieldsConversion.inputMethod)},this.prototypeHaxProperties=function(){return{api:"1",type:"element",editingElement:"core",hideDefaultSettings:!1,canScale:!0,canEditSource:!0,contentEditable:!1,gizmo:{title:"Tag name",description:"",icon:"icons:android",color:"purple",tags:["Other"],handles:[{type:"data",type_exclusive:!1,url:"src"}],meta:{author:"auto"},requiresChildren:!1,requiresParent:!1},settings:{configure:[{slot:"",title:"Inner content",description:"The slotted content that lives inside the tag",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{slot:"button",title:"Button content",description:"The content that can override the button",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"title",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"primaryColor",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!1,validation:".*",validationType:"text"}],advanced:[{property:"secondaryColor",title:"Secondary color",description:"An optional secondary color used in certain edge cases.",inputMethod:"colorpicker",icon:"color"},{property:"endPoint",title:"API endpoint",description:"An optional endpoint to hit and load in more data dymaically.",inputMethod:"textfield",icon:"android",validation:"[a-z0-9]",validationType:"url"}],developer:[]},saveOptions:{wipeSlot:!1,unsetAttributes:["end-point","secondary-color"]},documentation:{howTo:"https://oer.hax.psu.edu/bto108/sites/haxcellence/welcome",purpose:"https://oer.hax.psu.edu/bto108/sites/haxcellence/welcome"},demoSchema:[{tag:"my-tag",content:"<p>inner html</p>",properties:{endPoint:"https://cdn2.thecatapi.com/images/9j5.jpg",primaryColor:"yellow",title:"A cat"}}]}}}))),U=e("d",(function(e){return function(e){function t(){var e;return r(this,t),(e=h(this,t)).windowControllers=new AbortController,e.HAXWiring=new q,e}return c(t,e),o(t,[{key:"designSystemHAXProperties",value:function(e,t){return e}},{key:"setHaxProperties",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==t&&"undefined"!==a(this.tagName)&&(t=this.tagName.toLowerCase()),globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?this.HAXWiring.setHaxProperties(e,t,i,!0):(globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this),{signal:this.windowControllers.signal}),this.HAXWiring.setHaxProperties(e,t,i,!1))}},{key:"disconnectedCallback",value:function(){this.windowControllers.abort(),u(p(t.prototype),"disconnectedCallback",this)&&u(p(t.prototype),"disconnectedCallback",this).call(this)}},{key:"setup",value:function(e){return this.HAXWiring.setup(e,"",this)}},{key:"_haxStoreReady",value:function(e){return this.HAXWiring._haxStoreReady(e)}},{key:"validateSetting",value:function(e){return this.HAXWiring.validateSetting(e)}},{key:"getHaxProperties",value:function(){return this.haxProperties}},{key:"getHaxJSONSchema",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return this.HAXWiring.getHaxJSONSchema(e,t,i)}},{key:"postProcessgetHaxJSONSchema",value:function(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}},{key:"_getHaxJSONSchemaProperty",value:function(e){return(new n).fieldsToSchema(e)}},{key:"getHaxJSONSchemaType",value:function(e){return this.HAXWiring.getHaxJSONSchemaType(e)}},{key:"validHAXPropertyInputMethod",value:function(){return this.HAXWiring.validHAXPropertyInputMethod()}},{key:"prototypeHaxProperties",value:function(){return this.HAXWiring.prototypeHaxProperties()}}],[{key:"properties",get:function(){return d(d({},u(p(t),"properties",this)),{},{haxProperties:globalThis.HAXWiring.haxProperties})}}])}(e)}));globalThis.HAXWiring=new q,globalThis.HAXBehaviors=globalThis.HAXBehaviors||{},globalThis.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:globalThis.HAXWiring.haxProperties},setHaxProperties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==t&&"undefined"!==a(this.tagName)&&(t=this.tagName.toLowerCase()),globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==a(globalThis.HaxStore)&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?globalThis.HAXWiring.setHaxProperties(e,t,i,!0):globalThis.HAXWiring.setHaxProperties(e,t,i,!1)},_haxStoreReady:function(e){return globalThis.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return globalThis.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return globalThis.HAXWiring.getHaxJSONSchema(e,t,i)},postProcessgetHaxJSONSchema:function(e){return globalThis.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(e){return(new n).fieldsToSchema(e)},getHaxJSONSchemaType:function(e){return globalThis.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return globalThis.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return globalThis.HAXWiring.prototypeHaxProperties()}};var F=function(e){function t(){var e;return r(this,t),(e=h(this,t)).eventName="hax-register-app",e}return c(t,e),o(t,[{key:"connectedCallback",value:function(){"undefined"!==a(this.data)&&("string"==typeof this.data&&(this.data=JSON.parse(this.data)),this.dispatchEvent(new CustomEvent(this.eventName,{bubbles:!0,composed:!0,cancelable:!1,detail:this.data})))}}],[{key:"tag",get:function(){return"hax-app"}}])}(m(HTMLElement));customElements.define(F.tag,F);var J,V,Y,K=function(e){function t(){var e;return r(this,t),(e=h(this,t)).eventName="hax-register-stax",e}return c(t,e),o(t,null,[{key:"tag",get:function(){return"hax-stax"}}])}(F);customElements.define(K.tag,K);var $={url:new URL("./elements/hax-body/lib/hax-store.js",document.baseURI).href};g({enforceActions:!1});function Q(e){try{return sessionStorage.getItem(e)}catch(e){return!1}}function Z(e,t){try{return sessionStorage.setItem(e,t)}catch(e){return!1}}var ee=function(e){function i(){var e,t,a;r(this,i),e=h(this,i),C(["core"]),e.toastShowEventName=globalThis.HAXCMS?"haxcms-toast-show":"simple-toast-show",e.t={close:"Close"},void 0!==globalThis.speechSynthesis&&(globalThis.SpeechRecognition||globalThis.webkitSpeechRecognition||globalThis.mozSpeechRecognition||globalThis.msSpeechRecognition||globalThis.oSpeechRecognition)&&(w.voiceSearch=!0),w.icon="hax:wizard-hat",w.allowedCallback=function(){return!(!e.ready||!e.editMode)},w.defineOption({title:"Insert emoji",icon:"editor:insert-emoticon",tags:["emoji"],value:{name:"Insert emoji",context:"/",program:(t=s(l().mark((function t(i,a){var n,o;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],o=globalThis.document.createElement("textarea"),t.next=4,Object.keys(globalThis.SimplePickerEmojis).forEach(function(){var t=s(l().mark((function t(a){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,globalThis.SimplePickerEmojis[a].forEach(function(){var t=s(l().mark((function t(r){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(""==i||r.description.includes(i))&&(o.innerHTML=r.value,n.push({title:r.description,textCharacter:o.value,tags:[a],value:{target:e,method:"_insertTextResult",args:[o.value]},context:["/","/HAX/text/emoji/"+o.value],eventName:"super-daemon-element-method",path:"/HAX/text/emoji/"+o.value}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 4:return t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)}))),function(e,i){return t.apply(this,arguments)})},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/HAX/text/emoji"}),w.defineOption({title:"Insert symbol",icon:"editor:functions",tags:["symbol"],value:{name:"Insert symbol",context:"/",program:(a=s(l().mark((function t(i,a){var n,o;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],o=globalThis.document.createElement("textarea"),t.next=4,Object.keys(globalThis.SimplePickerSymbols).forEach(function(){var t=s(l().mark((function t(a){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,globalThis.SimplePickerSymbols[a].forEach(function(){var t=s(l().mark((function t(r){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(""==i||a.includes(i))&&(o.innerHTML=r.value,n.push({title:"".concat(a,": ").concat(o.value),textCharacter:o.value,tags:[a],value:{target:e,method:"_insertTextResult",args:[o.value]},context:["/","/HAX/text/symbol/"+o.value],eventName:"super-daemon-element-method",path:"/HAX/text/symbol/"+o.value}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 4:return t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)})},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/HAX/text/symbol"}),w.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:e,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX"]}),w.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:e,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX"]}),w.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:e,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX"]}),w.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:e,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX"]}),w.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:e,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX"]}),w.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:e,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),e.primativeHooks={},e.__dragTarget=null,e.registerLocalization({context:e,namespace:"hax",basePath:$.url+"/../../",locales:["es"]}),e.appSearch=null,e.method="GET",e.haxSelectedText="",e.__winEvents={"hax-super-daemon-insert-tag":"_superDaemonInsert","hax-register-properties":"_haxStoreRegisterProperties","hax-consent-tap":"_haxConsentTap",onbeforeunload:"_onBeforeUnload",paste:"_onPaste",command:"_onCommand","hax-register-app":"_haxStoreRegisterApp","hax-register-stax":"_haxStoreRegisterStax","hax-register-core-piece":"_haxStorePieceRegistrationManager","hax-register-body":"_haxStoreRegisterBody","hax-insert-content":"_haxStoreInsertContent","hax-insert-content-array":"_haxStoreInsertMultiple","hax-refresh-tray-form":"refreshActiveNodeForm","rich-text-editor-prompt-open":"_richTextEditorPromptOpen","rich-text-editor-prompt-confirm":"_richTextEditorPromptConfirm"},globalThis.onbeforeunload=function(t){if(!e.skipExitTrap&&e.editMode){var i="Are you sure you want to leave? Your work will not be saved!";return t.returnValue=i,i}},A.registerNewTour({key:"hax",name:"Let's learn HAX",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n }\n simple-popover-manager button {\n font-size: 12px;\n margin: 0px 2px;\n }\n simple-popover-manager p {\n padding: 0;\n margin: 0;\n font-size: 14px;\n line-height: 20px;\n }\n simple-popover-manager h3 {\n margin: 8px 2px;\n }"}),e.skipHAXConfirmation=!1,e.storageData={},e.appStore={url:"",params:{}},e.daemonKeyCombo="".concat(w.key1," + ").concat(w.key2," + "),e.activeNode=null,e.activeEditingElement=null,e.haxBodies=[],e.activePlaceHolder=null,e.activePlaceHolderOperationType=null,e.sessionObject={},e.editMode=!1,e.skipExitTrap=!1,e.appStoreLoaded=!1,e.elementList={},e.elementAlign=S("hax-tray-elementAlign"),e.elementAlign&&null!=e.elementAlign||(e.elementAlign="left"),e.trayStatus="collapsed",e.trayDetail="content-edit",e.appList=[],e.gizmoList=[],e.recentGizmoList=P.readMemory("recentGizmoList")||[],e.haxAutoloader=null,e.activeHaxBody=null,e.haxTray=null,e.haxCancel=null,e.staxList=[],e.globalPreferences={},e.activeApp={},e.connectionRewrites={},e.daemonCommands={},e.keyboardShortcuts={"#":{tag:"h2",content:""},"##":{tag:"h3",content:""},"###":{tag:"h4",content:""},"####":{tag:"h5",content:""},"#####":{tag:"h6",content:""},"######":{tag:"h6",content:""},"1.":{tag:"ol",content:"<li></li>"},"-":{tag:"ul",content:"<li></li>"},"*":{tag:"ul",content:"<li></li>"},"+":{tag:"ul",content:"<li></li>"},"---":{tag:"hr"},"***":{tag:"hr"},___:{tag:"hr"},"```":{tag:"code",content:""},">":{tag:"blockquote",content:""}},e.__primsBuilder={caption:{title:"Caption",icon:"av:call-to-action"},video:{title:"Video",icon:"av:play-circle-filled"},audio:{title:"Audio",icon:"image:music-note"},section:{title:"Section",icon:"image:crop-landscape"},dl:{title:"Data list",icon:"editor:format-list-bulleted"},dt:{title:"Data term",icon:"editor:format-list-bulleted"},dd:{title:"Data definition",icon:"editor:format-list-bulleted"},ol:{title:"Numbered list",icon:"editor:format-list-numbered"},ul:{title:"Bulleted list",icon:"editor:format-list-bulleted"},li:{title:"List item",icon:"editor:format-list-bulleted"},h1:{title:"Heading",icon:"hax:h1"},h2:{title:"Heading",icon:"hax:h2",tags:["Text","h2","html","text","heading","header"]},h3:{title:"Heading",icon:"hax:h3"},h4:{title:"Heading",icon:"hax:h4"},h5:{title:"Heading",icon:"hax:h5"},h6:{title:"Heading",icon:"hax:h6"},strike:{title:"Cross out",icon:"editor:format-strikethrough"},u:{title:"Underline",icon:"editor:format-underlined"},sub:{title:"Subscript",icon:"mdextra:subscript"},sup:{title:"Superscript",icon:"mdextra:superscript"},div:{title:"DIV",icon:"image:crop-landscape"},span:{title:"SPAN",icon:"editor:short-text",handles:[{type:"inline",text:"text"}]},i:{title:"Italic",icon:"editor:format-italic"},em:{title:"Emphasis",icon:"editor:format-italic"},strong:{title:"Bold",icon:"editor:format-bold"},b:{title:"Bold",icon:"editor:format-bold"},blockquote:{title:"Block quote",icon:"editor:format-quote"},code:{title:"Code",icon:"icons:code"},embed:{title:"Embedded object",icon:"icons:fullscreen"}},e.validTagList=e.__validTags(),e.validGridTagList=e.__validGridTags(),e.validGizmoTypes=e.__validGizmoTypes();var n=globalThis.document.createElement("webview");return e._isSandboxed="function"==typeof n.reload,globalThis.document.body.style.setProperty("--hax-ui-headings","#d4ff77"),e.revisionHistoryLink=null,_(e,{daemonKeyCombo:L,gizmoList:L,recentGizmoList:L,activeNode:L,globalPreferences:L,activeGizmo:O,activeNodeIndex:O,editMode:L,revisionHistoryLink:L,elementAlign:L,trayStatus:L,trayDetail:L,appList:L,activeApp:L,haxSelectedText:L,activeEditingElement:L,activeHaxBody:L,appStoreLoaded:L}),M((function(){e._globalPreferencesChanged(x(e.globalPreferences))})),M((function(){e._editModeChanged(x(e.editMode))})),M((function(){var t=x(e.recentGizmoList);t.length>0&&P.writeMemory("recentGizmoList",t,"long")})),e}return c(i,e),o(i,[{key:"testHook",value:function(e,t){return!!(e&&e.tagName&&this.HTMLPrimativeTest(e)&&this.primativeHooks[e.tagName.toLowerCase()]&&this.primativeHooks[e.tagName.toLowerCase()][t])||e&&"function"==typeof e.haxHooks&&e.haxHooks()[t]}},{key:"runHook",value:(ne=s(l().mark((function e(t,i){var a,n,o=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=o.length>2&&void 0!==o[2]?o[2]:[],!this.testHook(t,i)){e.next=9;break}if(!this.HTMLPrimativeTest(t)){e.next=6;break}return e.next=5,(n=this.primativeHooks[t.tagName.toLowerCase()])[i].apply(n,k(a));case 5:case 8:return e.abrupt("return",e.sent);case 6:return e.next=8,t[t.haxHooks()[i]].apply(t,k(a));case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return ne.apply(this,arguments)})},{key:"getSelection",value:function(){if(this.activeHaxBody&&this.activeHaxBody.parentNode){if(this.activeHaxBody.parentNode.getSelection)return this.activeHaxBody.parentNode.getSelection();try{if(v(this.activeHaxBody.parentNode))return v(this.activeHaxBody.parentNode)}catch(e){}}return globalThis.getSelection()}},{key:"getRange",value:function(){var e=this.getSelection();return e&&e.getRangeAt&&e.rangeCount?e.getRangeAt(0):e||!1}},{key:"guessGizmo",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=[],s=[];if("undefined"!==a(e)&&this.validGizmoTypes.includes(e))for(var l in this.gizmoList){var c=x(this.gizmoList[l]),d=t.innerHTML?{innerHTML:t.innerHTML}:{},u=!1;if(c&&c.handles)for(var p,h=function(){if(e===c.handles[m].type||"*"===e&&!u){for(var l in c.handles[m])"type"!==l&&"undefined"!==a(t[l])&&(""===c.handles[m][l]||"inline"!==e&&c.meta&&(!c.meta||c.meta.inlineOnly||c.meta.hidden)||(u=!0,d[c.handles[m][l]]=t[l]));if(u||n){if(o&&c.handles[m].type_exclusive)return{v:[i.haxElementPrototype(c,d,"")]};var p={};k(c.handles).forEach((function(e){e&&e.type&&""!=e.type&&(p[e.type.toLowerCase()]=!0)})),c.tags&&c.tags.length>0&&k(c.tags).forEach((function(e){e&&""!=e&&(p[e.toLowerCase()]=!0)})),c.keywords=Object.keys(p),s.includes(c.tag)||(r.push(i.haxElementPrototype(c,d,"")),s.push(c.tag))}}},m=0;m<c.handles.length;m++)if(p=h())return p.v}return r}},{key:"insertLogicFromValues",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.activePlaceHolderOperationType||this.guessGizmoType(e);if("upload-only"===o)return this.toast("Upload successful!"),!1;"link"===this.activePlaceHolderOperationType&&(n=!0),this.activePlaceHolderOperationType=null;var r=o,s=!0;if("*"==o){if(i)return!1;s=!1,r="link"}var l=this.guessGizmo(o,e,!1,s);return l.length>0?(1===l.length||n?1===l.length&&"undefined"!==a(l[0].tag)?t.dispatchEvent(new CustomEvent("hax-insert-content",{bubbles:!0,cancelable:!0,composed:!0,detail:l[0]})):n&&t.dispatchEvent(new CustomEvent("hax-insert-content",{bubbles:!0,cancelable:!0,composed:!0,detail:l.find((function(e){return"a"==e.tag}))})):this.haxAppPicker.presentOptions(l,o,"Pick how to present this "+r,"gizmo"),!0):(this.toast("Sorry, HAX doesn't know how to handle that type of link yet."),!1)}},{key:"write",value:function(e,t,i){i&&i.dispatchEvent(new CustomEvent("hax-store-write",{composed:!0,bubbles:!0,cancelable:!1,detail:{property:e,value:t,owner:i}}))}},{key:"mimeTypeToGizmoType",value:function(e){var t=e.split("/");switch(t[0]){case"audio":return"audio";case"image":return"svg+xml"==t[1]?"svg":"image";case"video":return"video";case"text":return["csv","html","markdown"].includes(t[1])?t[1]:"document";case"application":return"pdf"==t[1]?"pdf":["zip","gzip","x-tar"].includes(t[1])?"archive":"document"}}},{key:"guessGizmoType",value:function(e){if("undefined"!==a(e.source)){var t=e.source.toLowerCase();if(-1!=t.indexOf(".mp3")||-1!=t.indexOf(".midi")||-1!=t.indexOf(".mid"))return"audio";if(-1!=t.indexOf(".png")||-1!=t.indexOf(".jpg")||-1!=t.indexOf(".jpeg"))return"image";if(-1!=t.indexOf(".gif"))return"gif";if(-1!=t.indexOf(".pdf"))return"pdf";if(-1!=t.indexOf(".svg"))return"svg";if(-1!=t.indexOf(".csv"))return"csv";if(-1!=t.indexOf(".md"))return"markdown";if(-1!=t.indexOf(".html")||-1!=t.indexOf(".htm"))return"html";if(-1!=t.indexOf(".txt")||-1!=t.indexOf(".doc")||-1!=t.indexOf(".docx")||-1!=t.indexOf(".xls")||-1!=t.indexOf(".xlsx")||-1!=t.indexOf(".vtt")||-1!=t.indexOf(".ppt"))return"document";if(-1!=t.indexOf(".zip")||-1!=t.indexOf(".tar.gz")||-1!=t.indexOf(".tar"))return"archive";if("external"!=globalThis.MediaBehaviors.Video.getVideoType(t))return"video"}return"*"}},{key:"render",value:function(){return b(J||(J=y([" <slot></slot> "])))}},{key:"toast",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"capsule",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.t.close,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;globalThis.dispatchEvent(new CustomEvent(this.toastShowEventName,{bubbles:!0,composed:!0,cancelable:!0,detail:d({text:e,duration:t,classStyle:a,closeText:n,eventCallback:o,slot:r},i)}))}},{key:"_storageDataChanged",value:function(e){e&&this.ready&&this.__storageDataProcessed&&(S("haxConfirm",!1)?T("haxUserData",e):Q("haxConfirm")&&Z("haxUserData",e))}},{key:"isSingleSlotElement",value:function(e){var t=Object.keys(this.slotsSchemaFromNode(e));return 1==t.length&&0===t[0].length}},{key:"isTextElement",value:function(e){var t;return null!=e&&e.tagName?t=e.tagName.toLowerCase():null!=e&&e.tag&&(t=e.tag.toLowerCase()),!!(t&&this.validTagList.includes(t)&&["p","ol","ul","li","a","h1","h2","h3","h4","h5","h6","strike","u","b","sub","sup","span","mark","abbr","i","bold","em","strong","blockquote","code","figure"].includes(t))}},{key:"isInlineElement",value:function(e){var t;return null!=e&&e.tagName?t=e.tagName.toLowerCase():null!=e&&e.tag?t=e.tag.toLowerCase():"string"==typeof e&&(t=e),!!(t&&this.validTagList.includes(t)&&(this.haxSchemaFromTag(t)&&this.haxSchemaFromTag(t).meta&&this.haxSchemaFromTag(t).meta.inlineOnly||["a","strike","u","b","sub","sup","span","code","mark","abbr","i","bold","em","strong"].includes(t)))}},{key:"isGridPlateElement",value:function(e){var t;return e&&e.tagName?t=e.tagName.toLowerCase():e&&e.tag&&(t=e.tag.toLowerCase()),!(!t||!this.validGridTagList.includes(t))}},{key:"isLayoutElement",value:function(e){var t=e&&e.tagName&&this.haxSchemaFromTag(e.tagName)||{};return t.type&&"grid"===t.type}},{key:"isLayoutSlot",value:function(e){return!(!e||!e.parentNode)&&this.isLayoutElement(e.parentNode)}},{key:"isOriginalGridPlate",value:function(e){return!!e&&"GRID-PLATE"===e.tagName}},{key:"activeSchema",value:function(){return this.activeNode?this.haxSchemaFromTag(this.activeNode.tagName):void 0}},{key:"activeParentSchema",value:function(){return this.activeNode&&this.activeNode.parentNode?this.haxSchemaFromTag(this.activeNode.parentNode.tagName):void 0}},{key:"slottedContentByNode",value:function(e){var t=d({},this.slotsSchemaFromNode(e)||{});return e?(k(e.children||[]).forEach((function(e){e.slot&&""!==e.slot&&t[e.slot]?(t[e.slot].items=t[e.slot].items||[],t[e.slot].items.push(e)):e.slot&&""!==e.slot||!t[""]||(t[""].items=t[""].items||[],t[""].items.push(e))})),t):t}},{key:"slotsSchemaFromNode",value:function(e){if(!e||!e.tagName)return{};var t={},i=this.haxSchemaFromTag(e.tagName||{}),a=this.slotsFromSchema(i);this.isOriginalGridPlate(e)&&(e.layout||"1-1-1-1").split("-").map((function(e,t){a.push({slot:"col-".concat(t+1),title:"Column ".concat(t+1),excludedSlotWrappers:["grid-plate"]})}));return a.forEach((function(a){a.items=void 0,a.label=a.title||a.slot,a.editMode=d(d({},i.editMode),a.editMode),a.grid=e,(a.slot||""===a.slot)&&(t[a.slot]=a)})),t}},{key:"schemaBySlotId",value:function(e,t){return(this.slotsSchemaFromNode(e)||{})[t]}},{key:"_appStoreChanged",value:function(e,t){e&&t&&(e.url&&!e.apps&&this.shadowRoot?this.loadAppStoreFromRemote():this.__appStoreData=e)}},{key:"_loadAppStoreData",value:(ae=s(l().mark((function e(t){var i,n,o,r,s,c,d,u,p,h;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t){e.next=9;break}if(i={},"undefined"!==a(t.autoloader))for(n in t.autoloader=Object.assign({},t.autoloader),t.autoloader)o=n,r=t.autoloader[n],isNaN(o)||(o=t.autoloader[n],r="@haxtheweb/".concat(o,"/").concat(o,".js")),"string"!=typeof r&&(r.haxProperties&&this.setHaxProperties(t.autoloader[n].haxProperties,o),r=t.autoloader[n].import),this.validTagList.push(o),i[o]=r;if("undefined"!==a(t.apps))for(s=t.apps,c=0;c<s.length;c++)(d=globalThis.document.createElement("hax-app")).data=s[c],this.appendChild(d);if("undefined"!==a(t.stax))for(u=t.stax,p=0;p<u.length;p++)(h=globalThis.document.createElement("hax-stax")).data=u[p],this.appendChild(h);return this.dispatchEvent(new CustomEvent("hax-store-app-store-loaded",{bubbles:!0,cancelable:!0,composed:!0,detail:!0})),e.next=8,this._handleDynamicImports(i,this.haxAutoloader);case 8:this.appStoreLoaded=!0;case 9:case"end":return e.stop()}}),e,this)}))),function(e){return ae.apply(this,arguments)})},{key:"_handleDynamicImports",value:(ie=s(l().mark((function e(i,a){var n,o,r,s=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new URL("./hax-store.js",$.url).href+"/../../../../",globalThis.WCGlobalBasePath&&(n=globalThis.WCGlobalBasePath),o=l().mark((function e(o){var r,c;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!globalThis.customElements.get(o)){e.next=4;break}if(globalThis.customElements.get(o).haxProperties)s.setHaxProperties(globalThis.customElements.get(o).haxProperties,o);else try{r=globalThis.document.createElement(o),a.appendChild(r)}catch(e){}e.next=8;break;case 4:return c="".concat(n).concat(i[o]),s.isExternalURLImport(i[o])&&(c=i[o]),e.next=8,t.import(c).then((function(e){globalThis.customElements.get(o)&&globalThis.customElements.get(o).haxProperties?s.setHaxProperties(globalThis.customElements.get(o).haxProperties,o):a.appendChild(globalThis.document.createElement(o))})).catch((function(e){console.warn(e),a.appendChild(globalThis.document.createElement(o))}));case 8:case"end":return e.stop()}}),e)})),e.t0=l().keys(i);case 4:if((e.t1=e.t0()).done){e.next=9;break}return r=e.t1.value,e.delegateYield(o(r),"t2",7);case 7:e.next=4;break;case 9:case"end":return e.stop()}}),e)}))),function(e,t){return ie.apply(this,arguments)})},{key:"isExternalURLImport",value:function(e){var t;try{t=new URL(e)}catch(e){return!1}return new URL(t).origin!==location.origin}},{key:"_editModeChanged",value:function(e){e&&!this.appStoreLoaded&&this.__appStoreData&&this.haxAutoloader&&(clearTimeout(this.__readyToProcessAppStoreData),this._loadAppStoreData(this.__appStoreData))}},{key:"_globalPreferencesChanged",value:(ee=s(l().mark((function e(t){var i,a=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.__storageDataProcessed&&t&&this.ready&&("string"==typeof(i=this.storageData)&&(i=JSON.parse(i)),i.globalPreferences=t,this.storageData=i,this._storageDataChanged(this.storageData),t.haxLang&&te.editMode&&(clearTimeout(this._debounceLang),this._debounceLang=setTimeout(s(l().mark((function e(){var t,i;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=l().keys(a.elementList);case 1:if((e.t1=e.t0()).done){e.next=10;break}return t=e.t1.value,i=a.elementList[t],e.next=6,a.attemptGizmoTranslation(t,i);case 6:i=e.sent,a.elementList[t]=i,e.next=1;break;case 10:a.gizmoList.forEach((function(e){a.elementList[e.tag].gizmo.title&&(e.title=a.elementList[e.tag].gizmo.title),a.elementList[e.tag].gizmo.description&&(e.description=a.elementList[e.tag].gizmo.description)}));case 11:case"end":return e.stop()}}),e)}))),100)));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return ee.apply(this,arguments)})},{key:"_haxConsentTap",value:function(e){T("haxConfirm",!0),T("haxUserData",JSON.stringify(this.storageData))}},{key:"updated",value:function(e){var t=this;u(p(i.prototype),"updated",this)&&u(p(i.prototype),"updated",this).call(this,e),e.forEach((function(e,i){"appStore"==i&&t[i]&&t._appStoreChanged(t[i],e),["ready","__appStoreData","haxAutoloader"].includes(i)&&t.ready&&t.__appStoreData&&t.haxAutoloader&&(clearTimeout(t.__readyToProcessAppStoreData),t.__readyToProcessAppStoreData=setTimeout((function(){t._loadAppStoreData(t.__appStoreData)}),0)),["haxAutoloader","haxTray","haxCancel"].includes(i)&&(clearTimeout(t.__storeReady),t.__storeReady=setTimeout((function(){t._storePiecesAllHere(t.haxAutoloader,t.activeHaxBody,t.haxTray,t.haxCancel)}),0))}))}},{key:"_calculateActiveGizmo",value:function(e){if(null==e||!e.tagName)return null;for(var t in this.gizmoList){var i=this.gizmoList[t];if(i.tag===e.tagName.toLowerCase())return i}}},{key:"loadAppStoreFromRemote",value:function(){var e=this,t=new URLSearchParams(this.appStore.params),i=this.appStore.url;t&&(i+="?".concat(t)),fetch(i,{method:this.method}).then((function(e){if(e.ok)return e.json()})).then((function(t){e.__appStoreData=t}))}},{key:"firstUpdated",value:function(e){var t=this;if(u(p(i.prototype),"firstUpdated",this)&&u(p(i.prototype),"firstUpdated",this).call(this,e),this.skipHAXConfirmation&&(Z("haxConfirm",!0),T("haxConfirm",!0)),Q("haxConfirm")||S("haxConfirm"))if(Q("haxConfirm")&&!S("haxConfirm"))try{var a=Q("haxUserData")?JSON.parse(Q("haxUserData")):{};this.storageData=a,this._storageDataChanged(this.storageData)}catch(e){}else try{var n=S("haxUserData",{});this.storageData=n,this._storageDataChanged(this.storageData)}catch(e){}else{Z("haxConfirm",!0);this.toast("\n The HAX content editor keeps preferences in order to improve your experience.\n This data is stored in your browser and is never sent anywhere.\n Click to accept.\n ","-1",{},"fit-bottom","I Accept","hax-consent-tap")}setTimeout((function(){t.__storageDataProcessed=!0,t.storageData.globalPreferences&&t.write("globalPreferences",t.storageData.globalPreferences,t)}),0)}},{key:"_storePiecesAllHere",value:function(e,t,i,a){if(!this.ready&&t&&e&&i&&a){this.dispatchEvent(new CustomEvent("hax-store-ready",{bubbles:!0,cancelable:!1,composed:!0,detail:!0}));var n=globalThis.RichTextEditorPrompt.requestAvailability();n&&(n.shadowRoot.querySelector("#formfields").schematizer=j,n.shadowRoot.querySelector("#formfields").elementizer=I),i.shadowRoot.querySelector("#haxcancelbutton")&&(a.shadowRoot.querySelector("#dialog").associateEvents(i.shadowRoot.querySelector("#haxcancelbutton")),a.shadowRoot.querySelector("#dialog")&&globalThis.addEventListener("simple-modal-confirmed",this._handleConfirmCancel.bind(this))),this.ready=!0,this._buildPrimitiveDefinitions()}}},{key:"_handleConfirmCancel",value:function(e){e.detail.invokedBy===this.haxTray.shadowRoot.querySelector("#haxcancelbutton")&&(this.editMode=!1,this.dispatchEvent(new CustomEvent("hax-cancel",{bubbles:!0,composed:!0,cancelable:!1,detail:e.detail})))}},{key:"_positionCursorInNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.activeHaxBody.positionContextMenus();var i=globalThis.document.createRange(),a=this.getSelection();return i.setStart(e,t),i.collapse(!0),a.removeAllRanges(),a.addRange(i),i}},{key:"_onBeforeUnload",value:function(e){if(!this.skipExitTrap&&this.editMode)return"Are you sure you want to leave? Your work will not be saved!"}},{key:"isBase64",value:function(e){try{return btoa(atob(e))==e}catch(e){return!1}}},{key:"retrieveImageFromClipboardAsBlob",value:function(e,t){if(0==e.clipboardData&&"function"==typeof t)return t(void 0);var i=e.clipboardData.items;if(null==i&&"function"==typeof t)return t(void 0);for(var a=0;a<i.length;a++)if(-1!=i[a].type.indexOf("image")){var n=i[a].getAsFile();if("function"==typeof t)return t(n)}}},{key:"_onCommand",value:function(e){var t=this;if(e.detail.command&&"removeFormat"===e.detail.command&&(this.activeNode.innerHTML=H(this.activeNode.innerHTML)),e.detail.command&&"formatBlock"===e.detail.command){var i=d({},this.activeNode.dataset),a=this.activeNode.slot;setTimeout((function(){for(var e in i)e.startsWith("hax")||(t.activeNode.dataset[e]=i[e]);a&&t.activeNode.setAttribute("slot",a)}),0)}}},{key:"_onPaste",value:(K=s(l().mark((function e(t){var i,a,n,o,r,s,c,d,u,p,h,m,g,v,x,b,y,S,T,k,w=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.editMode||"HAX-TRAY"===globalThis.document.activeElement.tagName||"BODY"===globalThis.document.activeElement.tagName||"SIMPLE-MODAL"===globalThis.document.activeElement.tagName){e.next=90;break}if(this.isTextElement(this.activeNode)||(this.activeNode=this.activeHaxBody.haxInsert("p","",{})),i="",a="",t.clipboardData||t.originalEvent.clipboardData?""==(i=(t.originalEvent||t).clipboardData.getData("text/html"))&&(i=(t.originalEvent||t).clipboardData.getData("text")):globalThis.clipboardData&&(i=globalThis.clipboardData.getData("Text")),i=(i=(i=(i=(i=i.trim()).replace(/<span>\s*?<\/span>/g," ")).replace(/(?:style="(\S+:\s*[^;"]+;\s*)*)+"/g,"")).replace(/<div/g,"<p")).replace(/<\/div>/g,"</p>"),a=i,!this.isBase64(a)){e.next=18;break}return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.abrupt("return",this.retrieveImageFromClipboardAsBlob(t,(function(e){if(e){var i=globalThis.URL||globalThis.webkitURL,a=globalThis.document.createElement("img");for(var n in a.src=i.createObjectURL(e),w.activeNode.parentNode.insertBefore(a,w.activeNode.nextElementSibling),t.clipboardData.items)!t.clipboardData.items[n].name&&t.clipboardData.items[n].type&&(t.clipboardData.items[n].name="image-"+Math.floor(Date.now()/1e3)+t.clipboardData.items[n].type.replace("image/","."));return t.dataTransfer=t.clipboardData,t.placeHolderElement=a,w.dispatchEvent(new CustomEvent("place-holder-file-drop",{bubbles:!0,cancelable:!0,composed:!0,detail:t})),a}return!1})));case 18:if(t.clipboardData.files.length>0){for(o in t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),n=this.activeHaxBody.haxInsert("p","",{}),t.dataTransfer=t.clipboardData,t.clipboardData.files)!t.clipboardData.files[o].name&&t.clipboardData.files[o].type&&(t.clipboardData.files[o].name="image-"+Math.floor(Date.now()/1e3)+t.clipboardData.files[o].type.replace("image/","."));t.placeHolderElement=n,this.dispatchEvent(new CustomEvent("place-holder-file-drop",{bubbles:!0,cancelable:!0,composed:!0,detail:t}))}case 19:if(r=!1,s="",(c=globalThis.document.createElement("div")).innerHTML=i,d=[],!c.children){e.next=36;break}return i=(i=(i=(i=H(i)).replace(/<h1>/g,"<h2>")).replace(/<\/h1>/g,"</h2>")).replace(/<img src=\"file:(.*?)\/>/g,(function(e,t){var i=t.split('"');return'<place-holder type="image" text="file:'.concat(i[0],'"></place-holder>')})),e.next=31,this.htmlToHaxElements(i);case 31:if(1!==(d=e.sent).length||this.__validGridTags().includes(d[0].tag)){e.next=36;break}return e.next=35,this.htmlToHaxElements(d[0].content);case 35:d=e.sent;case 36:if(0!==d.length||!R(i)){e.next=43;break}if(""!=this.activeNode.innerText.trim()&&(r=!0),u={source:i,title:i},r||this.insertLogicFromValues(u,this,!1,!0)){e.next=41;break}return e.abrupt("return",!1);case 41:e.next=86;break;case 43:if(0!==d.length){e.next=52;break}if(r=!0,a==i){e.next=49;break}s=i,e.next=50;break;case 49:return e.abrupt("return",!1);case 50:e.next=86;break;case 52:if(1!==d.length||"p"!==d[0].tag){e.next=57;break}s=i,r=!0,e.next=86;break;case 57:if(1!==d.length||"a"!==d[0].tag||!d[0].properties.href){e.next=68;break}if(""==this.activeNode.innerText.trim()){e.next=63;break}s=d[0].properties.href,r=!0,e.next=66;break;case 63:if(p={source:d[0].properties.href,title:d[0].content},this.insertLogicFromValues(p,this)){e.next=66;break}return e.abrupt("return",!1);case 66:e.next=86;break;case 68:if(this.isGridPlateElement(d[0])){e.next=72;break}return e.abrupt("return",!1);case 72:e.t0=l().keys(d);case 73:if((e.t1=e.t0()).done){e.next=86;break}return h=e.t1.value,"p"==d[h].tag&&["li","ol","ul"].includes(this.activeNode.tagName.toLowerCase())&&(d[h].tag="li"),delete d[h].properties.style,delete d[h].properties.start,delete d[h].properties.align,m=f({tag:d[h].tag,content:d[h].content.replace(/<span> <\/span>/g," ").trim(),properties:d[h].properties}),e.t2=s,e.next=83,this.nodeToContent(m);case 83:s=e.t2+=e.sent,e.next=73;break;case 86:t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();try{if(g=this.getRange(),v=this.getSelection(),(x=globalThis.document.createElement("div")).innerHTML=s,g&&v){for(b in x.children)x.children[b].tagName&&this.isTextElement(x.children[b])&&""===x.children[b].innerHTML&&x.children[b].remove();if(r){if(R(i))(y=globalThis.document.createElement("a")).setAttribute("href",i),y.setAttribute("rel","noopener noreferrer"),y.setAttribute("target","_blank"),y.innerText=i;else if(x.children&&x.children.length>0){for(;x.childNodes.length>1;)g.insertNode(Array.from(x.childNodes).pop());y=Array.from(x.childNodes).pop()}else y=globalThis.document.createTextNode(x.innerHTML);g.deleteContents(),g.insertNode(y),setTimeout((function(){w._positionCursorInNode(y,y.length)}),0)}else{for(""!=this.activeNode.innerText.trim()&&g.endOffset!=this.activeNode.innerText.length&&(S=!0,globalThis.document.execCommand("insertParagraph")),g.commonAncestorContainer&&g.commonAncestorContainer.parentNode&&(k||this.activeNode==g.commonAncestorContainer||(k=g.commonAncestorContainer.parentNode)||(k=g.commonAncestorContainer));x.firstElementChild;)T=x.firstElementChild,k?(k.getAttribute&&k.getAttribute("slot")&&T.setAttribute("slot",k.getAttribute("slot")),S?(this.activeHaxBody.haxReplaceNode(k.previousElementSibling,T),S=!1):k.parentNode?k.parentNode.insertBefore(T,k.nextElementSibling):k.insertBefore(T,k.nextElementSibling)):this.activeNode?(this.activeNode.getAttribute("slot")&&T.setAttribute("slot",this.activeNode.getAttribute("slot")),""==this.activeNode.innerText.trim()?this.activeHaxBody.haxReplaceNode(this.activeNode,T):this.activeNode.parentNode.insertBefore(T,this.activeNode.nextElementSibling)):this.activeHaxBody.appendChild(T),k=T;setTimeout((function(){T&&T.childNodes&&T.childNodes[0]&&(w._positionCursorInNode(T.childNodes[0],T.childNodes[0].length),T=null,k=null)}),0)}}}catch(e){console.warn(e)}case 90:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"__validGridTags",value:function(){return["p","ol","ul","li","div","h1","h2","h3","h4","h5","h6","blockquote","code","section","dl","dd","dt","figure"]}},{key:"__validTags",value:function(){return["p","div","span","mark","abbr","table","caption","sup","sub","u","strike","tr","th","td","ol","ul","li","a","strong","kbd","tt","em","i","b","hr","h1","h2","h3","h4","h5","h6","blockquote","code","figure","figcaption","img","iframe","video","audio","section","dl","dt","dd","template","webview"]}},{key:"__validGizmoTypes",value:function(){return["data","video","audio","text","link","file","pdf","image","csv","doc","document","archive","markdown","html","content","text","gif","inline","*"]}},{key:"_insertTextResult",value:(F=s(l().mark((function e(t){var i=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.activeNode.focus(),w.activeRange&&(w.activeRange.setStart(this.activeNode,0),w.activeRange.collapse(!0),w.activeSelection.removeAllRanges(),w.activeSelection.addRange(w.activeRange),w.activeSelection.selectAllChildren(this.activeNode),w.activeSelection.collapseToEnd()),setTimeout((function(){""==i.activeNode.textContent?i.activeNode.textContent=t:globalThis.document.execCommand("insertHTML",!1,t)}),0);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return F.apply(this,arguments)})},{key:"_openExternalLink",value:function(e){globalThis.open(e,"_blank")}},{key:"_haxStoreContribute",value:(U=s(l().mark((function e(t,i){var a,n,o,r,s=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=s.length>2&&void 0!==s[2]?s[2]:null,n="","merlin"!=t){e.next=7;break}o="[".concat(t,"] New command request from HAX daemon"),n="Location: ".concat(globalThis.location.href,"\nMerlin command: ").concat(a,"\nWhat did you want merlin to do?\n"),e.next=16;break;case 7:if(o="[".concat(t,"] User report from HAX daemon"),n="Location: ".concat(globalThis.location.href,"\nBrowser: ").concat(navigator.userAgent,"\nOS: ").concat(navigator.userAgentData.platform," - ").concat(navigator.deviceMemory,"GB RAM - ").concat(navigator.hardwareConcurrency," cores\nScreen: ").concat(globalThis.screen.width,"x").concat(globalThis.screen.height,"\nWindow size: ").concat(globalThis.innerWidth,"x").concat(globalThis.innerHeight,"\n"),!navigator.getBattery){e.next=14;break}return e.next=12,globalThis.navigator.getBattery();case 12:r=e.sent,n+="Battery: ".concat(100*r.level,"%\n");case 14:navigator.connection&&globalThis.navigator.connection.effectiveType&&(n+="Connection: ".concat(navigator.connection.effectiveType,"\n")),n+="".concat("feature"==t?"Your idea:":"Bug you experienced:","\n");case 16:globalThis.open("https://github.com/haxtheweb/issues/issues/new?assignees=&labels=".concat(i,"&template=issue-report.md&title=").concat(o,"&body=").concat(encodeURIComponent(n)),"_blank");case 17:case"end":return e.stop()}}),e)}))),function(e,t){return U.apply(this,arguments)})},{key:"_richTextEditorPromptOpen",value:(q=s(l().mark((function e(t){var i,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.detail.element||!t.detail.element.gizmo.tag){e.next=5;break}if(i=globalThis.document.createElement(t.detail.element.gizmo.tag),!te.testHook(i,"setupActiveElementForm")){e.next=5;break}return e.next=5,te.runHook(i,"setupActiveElementForm",[t.detail.element]);case 5:"hidden"==(a=globalThis.getComputedStyle(globalThis.document.body)).getPropertyValue("overflow")&&(this.__overflowHiddenOnOpen=a.getPropertyValue("overflow"),globalThis.document.body.style.overflow="auto"),setTimeout((function(){var e=globalThis.document.querySelector("rich-text-editor-prompt").shadowRoot.querySelector(".actions");"function"==typeof e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!0):e.scrollIntoView({behavior:"smooth",inline:"center"})}),100);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return q.apply(this,arguments)})},{key:"_richTextEditorPromptConfirm",value:function(e){var t=this,i=e.detail.value&&e.detail.value.target?e.detail.value.target:null;setTimeout((function(){"A"===t.activeNode.tagName&&i&&(t.activeNode.setAttribute("target",i),t.refreshActiveNodeForm())}),0),this.__overflowHiddenOnOpen&&(globalThis.document.body.style.overflow=this.__overflowHiddenOnOpen,this.__overflowHiddenOnOpen=null)}},{key:"_buildPrimitiveDefinitions",value:function(){if(this._isSandboxed){this.setHaxProperties({type:"element",editingElement:"core",canScale:!0,designSystem:{card:!0,primary:!0},canEditSource:!0,settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this resource.",inputMethod:"textfield",icon:"link",required:!0,validationType:"url"}],advanced:[]}},"webview")}this.setHaxProperties({canScale:!0,type:"element",designSystem:{card:!0,primary:!0},editingElement:"core",canEditSource:!0,gizmo:{title:"Image",description:"A basic img tag",icon:"image:image",color:"blue-grey",tags:["Images","media","img","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this image.",inputMethod:"haxupload",noVoiceRecord:!0,icon:"link",required:!0,validationType:"url"},{attribute:"alt",title:"Alt text",description:"Useful for screen readers and improved SEO.",inputMethod:"alt",icon:"accessibility"},{attribute:"height",title:"Height",description:"height in pixels of the item. Leave blank to respond to the natural resolution",inputMethod:"textfield",icon:"icons:swap-vert"}],advanced:[{attribute:"loading",title:"Loading method",description:"Whether or not to lazy load this",inputMethod:"select",options:{lazy:"Load when visible",auto:"Automatic"}}]},demoSchema:[{tag:"img",content:"",properties:{src:"https://cdn2.thecatapi.com/images/9j5.jpg",loading:"lazy"}}]},"img");this.setHaxProperties({canScale:!0,type:"grid",canEditSource:!0,gizmo:{title:"Figure",description:"A basic figure tag",icon:"hax:figure",color:"blue-grey",tags:["Images","media","figure","html"],requiresChildren:"figcaption",handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[]},demoSchema:[{tag:"figure",properties:{},content:'<img src="https://dummyimage.com/300x200/000/fff" alt="image other media here">\n<figcaption><p>Image Caption Here</p></figcaption>'}]},"figure");this.setHaxProperties({canScale:!0,type:"grid",editingElement:"core",canEditSource:!0,gizmo:{title:"Figure caption",description:"Used inside of a figure tag",icon:"image:image",color:"blue-grey",tags:["Images","media","caption","figure","html"],handles:[],requiresParent:"figure",meta:{author:"W3C",hidden:!0}},settings:{configure:[{slot:"",title:"Figure Caption",description:"Caption for the figure",inputMethod:"code-editor"}]},demoSchema:[{tag:"figcaption",properties:{},content:"Image Caption Here"}]},"figcaption");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:{primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Highlight",description:"Highlight text within a block of content",icon:"editor:highlight",color:"yellow",tags:["Content","text","highlight","mark","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"innerText",title:"Text",description:"Text of the highlight",inputMethod:"textfield",required:!0}],advanced:[],developer:[]},demoSchema:[{tag:"mark",content:"Highlight me",properties:{}}]},"mark");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:{primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Abbreviation",description:"Simple abbreviation with tooltip of full word",icon:"hax:abbr",color:"yellow",tags:["Content","text","abbr","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"innerText",title:"Text",description:"Text that is visible, the abbreviation",inputMethod:"textfield",required:!0},{attribute:"title",title:"Word",description:"Word that the abbreviation is representing",inputMethod:"textfield",required:!0}],advanced:[],developer:[]},demoSchema:[{tag:"abbr",content:"Abbr",properties:{title:"Abbreviation"}}]},"abbr");var e={type:"element",editingElement:"core",canScale:!1,designSystem:{accent:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Basic link",description:"A basic a tag",icon:"icons:link",color:"blue-grey",tags:["Resource","link","a","url","html","href","address","http"],handles:[],meta:{author:"W3C"}},settings:{configure:[{attribute:"href",title:"Link",description:"The URL for the link",inputMethod:"haxupload",required:!0,validationType:"url"},{attribute:"innerText",title:"Text",description:"Text of the link",inputMethod:"textfield",required:!0},{attribute:"target",title:"Target",description:"Where to open the link.",inputMethod:"select",options:{"":"Same window",_blank:"New window - _blank",_top:"Top window - _top",_parent:"Parent window - _parent"}}],advanced:[],developer:[{attribute:"title",title:"Title text",description:"Useful for screen readers and improved SEO.",inputMethod:"textfield"},{attribute:"rel",title:"rel",description:"Specifies the relationship between this document and the opened globalThis.document. Change as part of security or SEO policy.",inputMethod:"select",options:{noopener:"noopener","noopener noreferrer":"noopener noreferrer","nofollow ":"nofollow","noopener noreferrer nofollow":"noopener noreferrer nofollow",opener:"opener"}}]},demoSchema:[{tag:"p",content:'<a href="#">Link to content</a>',properties:{}}]};this.validGizmoTypes.forEach((function(t){e.gizmo.handles.push({type:t,source:"href",title:"innerText",alt:"title"})})),this.setHaxProperties(e,"a");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:!0,canEditSource:!0,contentEditable:!0,gizmo:{title:"Paragraph",description:"A basic text area",icon:"hax:paragraph",color:"blue-grey",tags:["Text","p","paragraph","text","html"],handles:[{type:"content",title:"innerHTML",alt:"title"}],meta:{author:"W3C",outlineDesigner:!0}},settings:{configure:[],advanced:[]},demoSchema:[{tag:"p",content:"Deep thoughts..",properties:{}}]},"p");var t={type:"element",editingElement:{tag:"editable-table",import:"@haxtheweb/editable-table/editable-table.js",callback:this.setupEditableTable.bind(this)},canScale:!0,canEditSource:!0,gizmo:{title:"Table",description:"A table for displaying data",icon:"image:grid-on",color:"blue-grey",tags:["Instructional","table","data","html","grid","matrix","spreadsheet","csv","excel"],meta:{hidden:!0,author:"W3C"}},settings:{configure:[],advanced:[]}};this.setHaxProperties(t,"table");var i=globalThis.document.createElement("editable-table");this.haxAutoloader.appendChild(i);var a={type:"element",editingElement:{tag:"iframe-loader",import:"@haxtheweb/iframe-loader/iframe-loader.js",callback:this.setupIframeLoader.bind(this)},canScale:!1,designSystem:{card:!0,primary:!0},canEditSource:!1,gizmo:{title:"iFrame",description:"A basic way to frame external web content",icon:"hax:iframe",color:"blue-grey",tags:["Resource","iframe","content","url","link","embed","https","html","address"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this resource.",inputMethod:"textfield",icon:"link",required:!0,validationType:"url"}]}};this.setHaxProperties(a,"iframe");var n=globalThis.document.createElement("iframe-loader");for(var o in this.haxAutoloader.appendChild(n),this.__primsBuilder){var r="";["h1","h2","h3","h4","h5","h6"].includes(o)?r="Heading":"ul"!=o&&"ol"!=o||(r="<li>Item</li><li>Item</li>"),this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:["h1","h2","h3","h4","h5","h6"].includes(o)?{text:!0,card:!0,primary:!0,designTreatment:!0}:!!["ol","ul"].includes(o)&&{text:!0,card:!0,accent:!0,primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:this.__primsBuilder[o].title,icon:this.__primsBuilder[o].icon,tags:this.__primsBuilder[o].tags||["Text",o,"html","text"],handles:this.__primsBuilder[o].handles||[],meta:{author:"W3C",inlineOnly:!!["em","b","strong","i","strike","u","sub","sup","span"].includes(o),hidden:!["h2","ul"].includes(o),outlineDesigner:!!["h2","ul"].includes(o)}},settings:{configure:[],advanced:[]},demoSchema:[{tag:o,content:r,properties:{}}]},o)}this.setHaxProperties({canScale:!0,type:"element",editingElement:"core",designSystem:{primary:!0},canEditSource:!1,contentEditable:!0,gizmo:{title:"Horizontal line",icon:"hax:hr",meta:{author:"W3C"}},settings:{configure:[],advanced:[]},demoSchema:[{tag:"hr",content:"",properties:{"data-width":"50"}}]},"hr")}},{key:"_haxStorePieceRegistrationManager",value:function(e){e.detail&&e.detail.piece&&e.detail.object&&(this[e.detail.piece]=e.detail.object)}},{key:"setupEditableTable",value:function(e){this.activeNode=e,setTimeout((function(){e.editMode=!0,e.focus()}),0)}},{key:"setupIframeLoader",value:function(e){this.activeNode=e,setTimeout((function(){e.disabled=!0}),0)}},{key:"_haxStoreInsertContent",value:(G=s(l().mark((function e(t){var i,n,o,r,s,c;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.detail){e.next=13;break}if(i=t.detail,!globalThis.customElements.get(i.tag)){e.next=8;break}if(n=globalThis.document.createElement(i.tag),!this.testHook(n,"preProcessInsertContent")){e.next=8;break}return e.next=7,this.runHook(n,"preProcessInsertContent",[i,this.activeNode]);case 7:i=e.sent;case 8:o={},"undefined"!==a(i.properties)&&(o=i.properties),o.innerHTML&&(""==i.content&&(i.content=o.innerHTML),delete o.innerHTML),o.innerText&&(""==i.content&&(i.content=o.innerText),delete o.innerText),"undefined"!==a(i.__type)&&"inline"===i.__type?(r=f({tag:i.tag,content:i.content,properties:o}),null!==this.activePlaceHolder&&(this.activePlaceHolder.deleteContents(),this.activePlaceHolder.insertNode(r)),this.activePlaceHolder=null):i.replace||i.replacement||i.nextToActive?(s=f({tag:i.tag,content:i.content,properties:o}),this.activePlaceHolder?(this.activeHaxBody.haxReplaceNode(this.activePlaceHolder,s),this.activePlaceHolder=null):i.nextToActive&&this.activeNode?this.activeHaxBody.__slot&&this.activeNode.haxLayoutContainer?this.activeNode.appendChild(s):this.activeNode.parentNode.insertBefore(s,this.activeNode):this.activeHaxBody.haxReplaceNode(this.activeNode,s)):this.activeNode&&this.activeNode.parentNode&&"HAX-BODY"!=this.activeNode.parentNode.tagName?(c=f({tag:i.tag,content:i.content,properties:o}),this.activeNode.parentNode.haxLayoutContainer?(null!=this.activeNode.getAttribute("slot")&&c.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeHaxBody.haxInsert(i.tag,i.content,o)):this.activeHaxBody.haxInsert(i.tag,i.content,o)):this.activeHaxBody.haxInsert(i.tag,i.content,o);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"slotsFromSchema",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e?e.settings:{},a=[];return Object.keys(d({},i||{})).map((function(e){return(i[e]||[]).filter((function(e){var i=!t||!e.required;return!(!e.slot&&""!==e.slot||a.includes(e.slot)||!i)&&(a.push(e.slot),!0)}))})).flat()}},{key:"haxSchemaFromTag",value:function(e){return e&&e.toLowerCase&&(e=e.toLowerCase(),this.elementList&&this.elementList[e])?this.elementList[e]:{}}},{key:"_haxStoreInsertMultiple",value:function(e){var t;if(e.detail)for(var i in e.detail)t={},"undefined"!==a(e.detail[i].properties)&&(t=e.detail[i].properties),this.activeHaxBody.haxInsert(e.detail[i].tag,e.detail[i].content,t)}},{key:"_haxStoreRegisterBody",value:function(e){var t=this;e.detail&&(this.haxBodies.push(e.detail),this.activeHaxBody=e.detail,this.write("activeHaxBody",this.activeHaxBody,this),this.write("editMode",this.editMode,this),clearTimeout(this.__storeReady),this.__storeReady=setTimeout((function(){t._storePiecesAllHere(t.haxAutoloader,t.activeHaxBody,t.haxTray,t.haxCancel)}),0))}},{key:"_superDaemonInsert",value:function(e){w.programTarget&&e.detail.properties&&(e.detail.properties.src||e.detail.properties.source||e.detail.properties.href)?w.programTarget.value=e.detail.properties.src||e.detail.properties.source||e.detail.properties.href:this.haxTray._processTrayEvent(e),w.programTarget=null}},{key:"computePolyfillSafe",value:function(){return!(!globalThis.document.head.createShadowRoot&&!globalThis.document.head.attachShadow)||(console.warn("Shadow DOM missing, certain operations hidden"),!1)}},{key:"_haxStoreRegisterApp",value:function(e){if(e.detail){var t=e.detail;t.index=this.appList.length,this.appList=[].concat(k(this.appList),[t]),this.write("appList",x(this.appList),this);var i="media";if(t.connection.operations&&t.connection.operations.browse&&t.connection.operations.browse.resultMap&&t.connection.operations.browse.resultMap.defaultGizmoType&&(i=t.connection.operations.browse.resultMap.defaultGizmoType),w.defineOption({title:"Search "+t.details.title,icon:t.details.icon,tags:["Search"].concat(k(t.details.tags),[i]),more:t.details.tos&&t.details.tos.length>0?b(V||(V=y(['<div class="tos-text">Terms of service:</div>\n <ul class="tos-text">\n ',"\n </ul>"])),t.details.tos.map((function(e){return b(Y||(Y=y(['\n <li>\n <a\n href="','"\n target="_blank"\n rel="noopener nofollow noreferrer"\n >',"</a\n >\n </li>\n "])),e.link,e.title)}))):null,value:{name:"Search "+t.details.title,context:"/",index:t.index,detail:t,program:(o=s(l().mark((function e(i,n){var o,r,c,d,u,p;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=x(te.activeApp),r=x(te.appList[n.index]),o.index!=r.index&&(te.activeApp=x(te.appList[n.index])),c=Object.keys(n.detail.connection.operations.browse.search)[0],(d={})[c]=i,te.appSearch.updateSearchValues(d),e.next=9,te.appSearch.loadAppData();case 9:return u=e.sent,p=[],e.next=13,u.forEach(function(){var e=s(l().mark((function e(i){var n,o,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=i.map,(o=i.type)&&null!=o&&""!=o&&"undefined"!=o||!n.source||(o=te.guessGizmoType(n)),(r=te.guessGizmo(o,n,!1,!0)).length>0&&"undefined"!==a(r[0].tag)&&(r[0].nextToActive=!0),p.push({title:i.title,image:i.image,tags:[],value:{value:r[0].tag,eventName:"insert-tag",properties:r[0].properties},context:["/","/sources/"+t.details.title.toLowerCase()],eventName:"hax-super-daemon-insert-tag",path:"/sources/"+t.details.title.toLowerCase()});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 13:return e.abrupt("return",p);case 14:case"end":return e.stop()}}),e)}))),function(e,t){return o.apply(this,arguments)})},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/sources/"+t.details.title.toLowerCase(),priority:"local files"===t.details.title.toLowerCase()?-100:0}),t.connection&&t.connection.protocol&&t.connection.url){var n=globalThis.document.createElement("link");n.rel="preconnect",n.href=t.connection.protocol+"://"+t.connection.url,globalThis.document.head.appendChild(n)}"undefined"!==a(e.target.parentElement)&&"HAX-STORE"===e.target.parentElement.tagName&&e.target.parentElement.removeChild(e.target)}var o}},{key:"_haxStoreRegisterStax",value:function(e){e.detail&&(e.detail.index=this.staxList.length,this.staxList=[].concat(k(this.staxList),[e.detail]),this.write("staxList",this.staxList,this),"undefined"!==a(e.target.parentElement)&&"HAX-STORE"===e.target.parentElement.tagName&&e.target.parentElement.removeChild(e.target))}},{key:"activeBodyIgnoreActive",value:function(e){this.activeHaxBody.__ignoreActive=e}},{key:"dashToCamel",value:function(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}},{key:"htmlToHaxElements",value:(D=s(l().mark((function e(t){var i,n,o,r,s;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=[],(n=globalThis.document.createElement("div")).innerHTML=t,!n.children){e.next=17;break}o=this.validTagList,r=n.children,s=0;case 7:if(!(s<r.length)){e.next=17;break}if("undefined"===a(r[s].tagName)||!o.includes(r[s].tagName.toLowerCase())){e.next=14;break}return e.t0=i,e.next=12,B(r[s],null);case 12:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 14:s++,e.next=7;break;case 17:return e.abrupt("return",i);case 18:case"end":return e.stop()}}),e,this)}))),function(e){return D.apply(this,arguments)})},{key:"nodeToContent",value:(N=s(l().mark((function e(t){var i,n,o,r,s,c,d,u,p,h,m,g,f,v,x,b,y;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.testHook(t,"preProcessNodeToContent")){e.next=4;break}return e.next=3,this.runHook(t,"preProcessNodeToContent",[t]);case 3:t=e.sent;case 4:for(i=t.tagName.toLowerCase(),this._isSandboxed&&"webview"===i&&(i="iframe"),n="",n+="<"+i,o=this.elementList[i],r={},s=0,c=t.attributes.length;s<c;++s)d=t.attributes.item(s).nodeName,u=t.attributes.item(s).value,"style"==d||a(u)!==("undefined"==typeof Object?"undefined":a(Object))&&u.constructor!==Array?null!=u&&"null"!=u&&(!0===u||"true"===u?r[d]=!0:!1===u||("string"==typeof u&&""!==u?(u=(u=(u=(u=u.replace(new RegExp("&","g"),"&")).replace(new RegExp('"',"g"),""")).replace(new RegExp("<","g"),"<")).replace(new RegExp(">","g"),">"),r[d]=u):""===u?(""==u&&""!=t.attributes.item(s).value&&(u=t.attributes.item(s).value),r[d]=u):r[d]=u)):r[d]=JSON.stringify(u).replace(new RegExp('"',"g"),""");if(customElements.get(i)&&(p=customElements.get(i).properties),"undefined"===a(p)&&(p=t.__data),"undefined"!==a(p))for(h in p)d=W(h),u=null,"undefined"!==a(t[h])&&(u=t[h]),p[h].readOnly||p[h].computed||u===p[h].value||d.startsWith("__")||(null==u||"object"!==a(u)&&u.constructor!==Array?null!=u&&"null"!=u&&(!0===u||"true"===u?r[d]=!0:!1===u||("string"==typeof u&&""!==u?(u=(u=(u=(u=u.replace(new RegExp("&","g"),"&")).replace(new RegExp('"',"g"),""")).replace(new RegExp("<","g"),"<")).replace(new RegExp(">","g"),">"),r[d]=u):""===u?""==u&&""!=p[h].value?u=p[h].value:""===u&&p[h].value:r[d]=u)):(u.constructor===Array&&u!=[]||"object"===a(u)&&u!={})&&(r[d]=JSON.stringify(u).replace(new RegExp('"',"g"),""")));if("undefined"!==a(o)&&"undefined"!==a(o.saveOptions.unsetAttributes))for(m in o.saveOptions.unsetAttributes)delete r[o.saveOptions.unsetAttributes[m]];for(f in g=["inner-text","inner-html","tabindex","guestinstance"])"undefined"!==a(r[g[f]])&&delete r[g[f]];for(v in"undefined"!==a(r.id)&&""===r.id&&delete r.id,delete r.draggable,delete r.contenteditable,delete r.role,delete r["data-hax-ray"],delete r["data-hax-layout"],delete r["data-hax-grid"],delete r["data-hax-active"],""==r.class&&delete r.class,r)!0===r[v]?n+=" "+v:n+=" "+v+'="'+r[v]+'"';if(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"].includes(i)?n+="/>":n+=">","undefined"!==a(o)&&o.saveOptions.wipeSlot){e.next=51;break}if(!((x=t.childNodes).length>0)){e.next=51;break}b=0,y=x.length;case 33:if(!(b<y)){e.next=51;break}if("undefined"===a(x[b].tagName)){e.next=47;break}if(this.HTMLPrimativeTest(x[b])||"TEMPLATE"===x[b].tagName){e.next=42;break}return e.t0=n,e.next=39,this.nodeToContent(x[b]);case 39:n=e.t0+=e.sent,e.next=45;break;case 42:x[b].removeAttribute("data-hax-ray"),x[b].contentEditable=!1,n+=x[b].outerHTML;case 45:e.next=48;break;case 47:8===x[b].nodeType?n+="\x3c!-- "+x[b].textContent+" --\x3e":1!==x[b].nodeType&&"undefined"!==a(x[b].textContent)&&"undefined"!==x[b].textContent&&(n+=z(x[b].textContent));case 48:b++,e.next=33;break;case 51:if(!this.testHook(t,"progressiveEnhancement")){e.next=56;break}return e.t1=n,e.next=55,this.runHook(t,"progressiveEnhancement",[t]);case 55:n=e.t1+=e.sent;case 56:if("span"===i?n+="</"+i+">":"hr"===i||"br"===i||"img"===i||(n+="</"+i+">\n"),n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n.replace(/ /gm," ")).replace(/ data-hax-ray="(\s|.)*?"/gim,"")).replace(/ data-hax-active="(\s|.)*?"/gim,"")).replace(/ class=""/gim,"")).replace(/ contenteditable="(\s|.)*?"/gim,"")).replace(/<span style="(.*?)">/gim,"<span>")).replace(/<span>\s*?<\/span>/g," ")).replace(/<span><br\/><\/span>/gm,"")).replace(/<strong style="(.*?)">/gim,"<strong>")).replace(/<b style="(.*?)">/gim,"<b>")).replace(/<strike style="(.*?)">/gim,"<strike>")).replace(/<em style="(.*?)">/gim,"<em>")).replace(/<i style="(.*?)">/gim,"<i>")).replace(/<p>(\s*)<\/p>/gm,"<p></p>")).replace(/<p> <\/p>/gm,"<p></p>")).replace(/<p><br\/><\/p>/gm,"<p></p>")).replace(/<p><br><\/p>/gm,"<p></p>"),!this.testHook(t,"postProcessNodeToContent")){e.next=78;break}return e.next=77,this.runHook(t,"postProcessNodeToContent",[n]);case 77:n=e.sent;case 78:return e.abrupt("return",n);case 79:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"HTMLPrimativeTest",value:function(e){return"undefined"!==a(e.tagName)&&-1==e.tagName.indexOf("-")}},{key:"getHaxAppStoreTargets",value:function(e){return x(this.appList).filter((function(t){if("undefined"!==a(t.connection.operations.add)){var i=t.connection.operations.add;if("undefined"!==a(i.acceptsGizmoTypes)&&i.acceptsGizmoTypes.includes(e))return!0}return!1}))}},{key:"refreshActiveNodeForm",value:(E=s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B(this.haxTray.activeNode,null);case 2:return this.haxTray.activeHaxElement=e.sent,e.next=5,this.haxTray._setupForm();case 5:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"haxElementPrototype",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return{tag:e.tag,properties:t,content:i,gizmo:e}}},{key:"getHAXSlot",value:(g=s(l().mark((function e(t){var i,n,o,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isTextElement(t)){e.next=2;break}return e.abrupt("return",t.innerHTML);case 2:if(i="",!((n=t.childNodes).length>0)){e.next=26;break}o=0,r=n.length;case 6:if(!(o<r)){e.next=26;break}if(n[o]){e.next=9;break}return e.abrupt("return");case 9:if("undefined"===a(n[o].tagName)){e.next=22;break}if(!(n[o].tagName.indexOf("-")>0)){e.next=19;break}return e.t0=i,e.next=14,this.nodeToContent(n[o]);case 14:e.t1=e.sent,e.t2=" "+e.t1,i=e.t0+=e.t2+"\n",e.next=20;break;case 19:i+=" "+n[o].outerHTML+"\n";case 20:e.next=23;break;case 22:8===n[o].nodeType?i+="\x3c!-- "+n[o].textContent+" --\x3e":1!==n[o].nodeType&&"undefined"!==a(n[o].textContent)&&"undefined"!==n[o].textContent&&(i+=n[o].textContent);case 23:o++,e.next=6;break;case 26:return e.abrupt("return",i);case 27:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"_haxStoreRegisterProperties",value:(m=s(l().mark((function e(t){var i,n,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.detail&&t.detail.properties&&t.detail.tag)){e.next=15;break}if(this.elementList[t.detail.tag]){e.next=14;break}return i=t.detail,e.next=5,this.attemptGizmoTranslation(i.tag,i.properties);case 5:if(i.properties=e.sent,(n=i.properties.gizmo)&&(n.tag=i.tag,(o=this.gizmoList).push(n),this.gizmoList=k(o),this.write("gizmoList",o,this),n.meta&&(n.meta.inlineOnly||n.meta.hidden)||w.defineOption({title:n.title,icon:n.icon,tags:n.tags||[],value:{value:n.tag,eventName:"insert-tag",demoSchema:!0},context:["HAX"],eventName:"hax-super-daemon-insert-tag",path:"HAX/insert/block/"+n.tag})),this.elementList[i.tag]=i.properties,this.validTagList.find((function(e){return e===i.tag}))||this.validTagList.push(i.tag),"grid"!=i.properties.type||this.validGridTagList.find((function(e){return e===i.tag}))||this.validGridTagList.push(i.tag),!globalThis.customElements.get(t.detail.tag)||!this.testHook(globalThis.document.createElement(t.detail.tag),"gizmoRegistration")){e.next=14;break}return e.next=14,this.runHook(globalThis.document.createElement(t.detail.tag),"gizmoRegistration",[this]);case 14:"undefined"!==a(t.target.parentElement)&&"HAX-AUTOLOADER"===t.target.parentElement.tagName&&this.haxAutoloader.removeChild(t.target);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"activeGizmo",get:function(){var e=x(this._calculateActiveGizmo(this.activeNode));return this.write("activeGizmo",e,this),e}},{key:"activeNodeIndex",get:function(){var e=this,t=null;return this.activeNode&&Array.from(x(this.activeHaxBody).children).map((function(i,a){x(e.activeNode)!==i&&x(e.activeNode).parentElement!==i||(t=a)})),t}},{key:"attemptGizmoTranslation",value:(n=s(l().mark((function e(t,i){var a,n,o,r,s,c,d;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X.loadNamespaceFile(t+".haxProperties");case 2:if((a=e.sent)||"en"!=this.globalPreferences.haxLang||!globalThis.customElements.get(t)||!globalThis.customElements.get(t).haxProperties){e.next=9;break}if("string"!=typeof(a=globalThis.customElements.get(t).haxProperties)){e.next=9;break}return e.next=8,fetch(a).then((function(e){return!(!e||!e.json)&&e.json()}));case 8:a=e.sent;case 9:if(a){if(i.gizmo&&a.gizmo)for(n in a.gizmo)i.gizmo[n]=a.gizmo[n];if(i.settings&&a.settings)for(o in{advanced:"advanced",configure:"configure"})if(i.settings[o]&&a.settings[o])for(r in a.settings[o])for(s in a.settings[o][r])i.settings[o][r][s]=a.settings[o][r][s];if(i.demoSchema&&a.demoSchema)for(c in a.demoSchema)if(a.demoSchema[c].properties)for(d in a.demoSchema[c].properties)i.demoSchema[c].properties[d]=a.demoSchema[c].properties[d]}return e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}],[{key:"tag",get:function(){return"hax-store"}},{key:"properties",get:function(){return d(d({},u(p(i),"properties",this)),{},{skipHAXConfirmation:{type:Boolean,reflect:!0,attribute:"skip-hax-confirmation"},storageData:{type:Object},haxTray:{type:Object},haxCancel:{type:Object},haxAutoloader:{type:Object},haxBodies:{type:Array},activePlaceHolder:{type:Object},activePlaceHolderOperationType:{type:String},appStore:{type:Object},sessionObject:{type:Object},skipExitTrap:{type:Boolean},elementList:{type:Object},staxList:{type:Array},validTagList:{type:Array},validGridTagList:{type:Array},validGizmoTypes:{type:Array},_isSandboxed:{type:Boolean},__appStoreData:{type:Object},ready:{type:Boolean},connectionRewrites:{type:Object}})}}]);var n,m,g,E,N,D,G,q,U,F,K,ee,ie,ae,ne}(E(N(U(D))));customElements.define(ee.tag,ee),globalThis.HaxStore=globalThis.HaxStore||{},globalThis.HaxStore.requestAvailability=function(){return globalThis.HaxStore.instance||(globalThis.HaxStore.instance=globalThis.document.createElement("hax-store"),globalThis.document.body.appendChild(globalThis.HaxStore.instance)),globalThis.HaxStore.instance};var te=e("H",globalThis.HaxStore.requestAvailability());globalThis.Hax=globalThis.Hax||{},globalThis.Hax.add=function(e){if(te.elementList[e]){var t,i=te.haxSchemaFromTag(e);t=i.gizmo.tag&&i.demoSchema&&i.demoSchema[0]?f(i.demoSchema[0]):globalThis.document.createElement(e),te.activeHaxBody.haxReplaceNode(te.activeNode,t),te.activeHaxBody.__focusLogic(t)}else te.toast("".concat(e," is not a valid tag"))},globalThis.Hax.delete=function(){null!=te.activeNode&&te.activeHaxBody.haxDeleteNode(te.activeNode)},globalThis.Hax.duplicate=function(){te.activeHaxBody.haxDuplicateNode(te.activeNode)},globalThis.Hax.move=function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?te.activeHaxBody.haxMoveGridPlate(te.activeNode,-1):te.activeHaxBody.haxMoveGridPlate(te.activeNode)},globalThis.Hax.grid=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];te.activeHaxBody.haxGridPlateOps(e)},globalThis.Hax.set=function(e,t){te.write(e,t,window)},globalThis.Hax.get=function(e){return te[e]},globalThis.Hax.export=s(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te.activeHaxBody.haxToContent();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),globalThis.Hax.import=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"<p></p>";return te.activeHaxBody.importContent(e)}}}}));