| 
          "use strict";(()=>{var P=class{constructor(e={}){this.namespace=e.namespace,this.prefix=[this.namespace,e.prefix].filter(Boolean).join(" "),this.enabled=e.enabled!==!1,this.timestamp=e.timestamp!==!1,this.timestampFormat=e.timestampFormat||"locale"}getTimestamp(){let e=new Date;return this.timestampFormat==="ISO"?e.toISOString():e.toLocaleString()}formatMessage(e,...t){let u=[this.prefix];return this.timestamp&&u.push(`[${this.getTimestamp()}]`),u.push(`[${e.toUpperCase()}]`),[u.join(" "),...t]}debug(...e){this.enabled&&console.debug(...this.formatMessage("debug",...e))}info(...e){this.enabled&&console.info(...this.formatMessage("info",...e))}warn(...e){this.enabled&&console.warn(...this.formatMessage("warn",...e))}error(...e){this.enabled&&console.error(...this.formatMessage("error",...e))}log(...e){this.enabled&&console.log(...this.formatMessage("log",...e))}custom(e,...t){this.enabled&&console.log(...this.formatMessage(e,...t))}group(e,t){if(!this.enabled)return t();console.group(`${this.prefix} ${e}`);try{t()}finally{console.groupEnd()}}groupCollapsed(e,t){if(!this.enabled)return t();console.groupCollapsed(`${this.prefix} ${e}`);try{t()}finally{console.groupEnd()}}table(e,t){this.enabled&&(this.info("Table data:"),console.table(e,t))}time(e){this.enabled&&console.time(`${this.prefix} ${e}`)}timeEnd(e){this.enabled&&console.timeEnd(`${this.prefix} ${e}`)}timeLog(e){this.enabled&&console.timeLog(`${this.prefix} ${e}`)}enable(){this.enabled=!0}disable(){this.enabled=!1}setPrefix(e){this.prefix=e}};function v(r={}){return new P(r)}function O(r,e){function t(u){return u.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")}if(window.trustedTypes){let n=window.trustedTypes.createPolicy("myHTMLPolicy",{createHTML:t}).createHTML(e);r.innerHTML=n}else{let u=t(e);r.innerHTML=u}}async function B(r){let{tagName:e,id:t,attributes:u={},parentSelector:n="body",parentElement:m,textContent:d,innerHTML:b,innerElement:w,returnElement:T=!0,checkExisting:k=!0,replaceExisting:C=!1,insertionMethod:$="append",contextElement:h,waitTimeout:I=3e4,persistent:M=!1,autoRemove:E=!0,debounceDelay:_=500,observerConfig:y={childList:!0,subtree:!0,attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1},namespace:R,onMount:S}=r,a=v({prefix:"[createElement]",namespace:R}),o={action:"create",tagName:e,id:t,parentMethod:n?"selector":"element",parentIdentifier:n||(m?m.tagName:"unknown"),waitTimeout:I,insertionMethod:$};if(a.info(`Starting element creation: <${e}> with ID="${t}"${h?" (conditional)":""} using ${$} insertion`),!e||typeof e!="string")return a.error("Element creation failed: Tag parameter is required and must be a string",o),null;if(!t||typeof t!="string")return a.error("Element creation failed: ID parameter is required and must be a non-empty string",o),null;if(!n&&!m)return a.error("Element creation failed: Either parentSelector or parentElement must be provided",o),null;if($!=="append"&&$!=="insertBeforeElement"&&$!=="prepend")return a.error("Element creation failed: insertionMethod must be 'append', 'insertBeforeElement', or 'prepend'",o),null;function q(i,l,s){try{let g=new DOMParser().parseFromString(l,"text/html"),f=g.querySelector("parsererror");if(f)throw new Error(`HTML parsing error: ${f.textContent}`);let D=Array.from(g.body.childNodes);return D.length===0?(a.warn(`No valid elements found in HTML string: "${l.substring(0,50)}${l.length>50?"...":""}"`,s),!1):(D.forEach(N=>{let A=i.ownerDocument.importNode(N,!0);i.appendChild(A)}),a.debug(`Created DOM elements programmatically: "${l.substring(0,50)}${l.length>50?"...":""}" (${D.length} elements)`,s),!0)}catch(p){a.warn(`DOMParser failed, attempting fallback method: ${p.message}`,s);try{return O(i,l),a.debug(`Successfully created DOM elements via fallback method: "${l.substring(0,50)}${l.length>50?"...":""}"`,s),!0}catch(g){return a.error(`DOM insertion failed: ${g.message}`,{...s,originalError:p.message,fallbackError:g.message}),!1}}}function L(){try{let i=null;if(k&&(i=document.getElementById(t),i))if(o.action="exists",C)a.info(`Found existing element with ID="${t}", replacing as requested`,o),i.remove(),o.action="replace";else return a.warn(`Element with ID="${t}" already exists, skipping creation. Use replaceExisting=true to replace.`,o),T?i:null;let l=m;if(!l&&n){let f=document.querySelector(n);if(!f)return a.error(`Element creation failed: Parent element not found with selector: ${n}`,o),null;l=f,a.debug(`Found parent element with selector: ${n}`,o)}if(!l)return a.error("Element creation failed: No valid parent element found",o),null;let s=document.createElement(e);a.debug(`Created DOM element: <${e}>`,o),s.setAttribute("id",t),a.debug(`Set required ID attribute: id="${t}"`,o);let p=Object.keys(u).length;if(p>0&&(Object.entries(u).forEach(([f,D])=>{D!=null&&(s.setAttribute(f,String(D)),a.debug(`Set attribute: ${f}="${D}"`,o))}),a.debug(`Applied ${p} additional attributes to element`,o)),w&&typeof w=="function")try{let f=w();f instanceof HTMLElement?(s.appendChild(f),a.debug("Inserted child element via innerElement callback",o)):(a.warn("innerElement callback did not return a valid HTMLElement, falling back to other content methods",o),d!==void 0?(s.textContent=d,a.debug(`Set textContent: "${d.substring(0,100)}${d.length>100?"...":""}"`,o)):b!==void 0&&q(s,b,o))}catch(f){a.error("Error executing innerElement callback, falling back to other content methods:",f,o),d!==void 0?(s.textContent=d,a.debug(`Set textContent: "${d.substring(0,100)}${d.length>100?"...":""}"`,o)):b!==void 0&&q(s,b,o)}else d!==void 0?(s.textContent=d,a.debug(`Set textContent: "${d.substring(0,100)}${d.length>100?"...":""}"`,o)):b!==void 0&&q(s,b,o);if($==="insertBeforeElement")if(l.parentElement)l.parentElement.insertBefore(s,l),a.debug("Inserted element before parent",o);else return a.error("Element insertion failed: Parent element has no parent to insert before",o),null;else $==="prepend"?(l.insertBefore(s,l.firstChild),a.debug("Prepended element as first child of parent",o)):(l.appendChild(s),a.debug("Appended element to end of parent",o));if(S&&typeof S=="function")try{S(s),a.debug(`Successfully called onMount callback for element ID="${t}"`,o)}catch(f){a.warn(`Error in onMount callback for element ID="${t}":`,f,o)}let g=`Element creation successful: <${e}> (ID="${t}") ${o.action==="replace"?"replaced and ":""}${$}ed to ${o.parentMethod==="selector"?`parent selected by "${n}"`:"provided parent element"}${h?" (after content element)":""}`;return a.info(g,{...o,success:!0,hasAttributes:p>0,hasContent:!!(d||b||w),parentTagName:l.tagName,elementPath:s.tagName+"#"+s.id+(s.className?`.${s.className.replace(/\s+/g,".")}`:"")}),T?s:null}catch(i){let l=`Element creation failed with exception: ${i.message||"Unknown error"}`;return a.error(l,{...o,success:!1,error:i.message||"Unknown error",stack:i.stack||"No stack trace available"}),null}}async function H(){try{if(typeof h=="function"){let i=await h();return i instanceof HTMLElement&&document.contains(i)}else if(typeof h=="string")return document.querySelector(h)!==null}catch(i){a.warn(`Error checking content element for element ID="${t}":`,i)}return!1}function V(){if(!M&&!E)return;a.info(`Setting up ${M?"persistent":""}${M&&E?" and ":""}${E?"auto-removal":""} monitoring for element ID="${t}"`);let i=null,l=new MutationObserver(async()=>{i&&clearTimeout(i),i=setTimeout(async()=>{a.debug(`Persistent monitoring check triggered for element ID="${t}"`);let p=await H(),g=document.getElementById(t);p?M&&!g?(a.info(`Context element found but managed element missing, recreating element ID="${t}"`),L()):a.debug(`Both context and managed elements exist for ID="${t}"`):E&&g?(a.info(`Context element no longer present, removing managed element ID="${t}"`),g.remove()):a.debug(`Context element no longer present for element ID="${t}"`)},_)}),s={childList:y.childList===!0,subtree:y.subtree===!0,attributes:y.attributes===!0,attributeOldValue:y.attributeOldValue===!0,characterData:y.characterData===!0,characterDataOldValue:y.characterDataOldValue===!0};l.observe(document.documentElement||document.body,s),a.debug(`Started persistent MutationObserver for element ID="${t}"`)}if(!h)return L();if(a.info(`Checking initial condition for element ID="${t}"`,{...o,waitCondition:typeof h=="function"?"callback":h,persistent:M}),await H()){a.info(`Initial content element already satisfied for element ID="${t}"`,o);let i=L();return(M||E)&&V(),i}return new Promise(i=>{let l=Date.now(),s=null,p=null,g=!1;function f(N){g||E&&(g=!0,s&&(clearTimeout(s),s=null),p&&(p.disconnect(),p=null,a.debug(`Disconnected MutationObserver for element ID="${t}"`,o)),i(N))}s=setTimeout(()=>{a.error(`Element creation failed: Wait condition timeout after ${I}ms for element ID="${t}"`,{...o,success:!1,timeoutReached:!0,waitCondition:typeof h=="function"?"callback":h}),f(null)},I),a.info(`Setting up MutationObserver for element ID="${t}"`,{...o,observerConfig:y,waitCondition:typeof h=="function"?"callback":h}),p=new MutationObserver(async N=>{if(!g&&(a.debug(`MutationObserver detected ${N.length} mutations for element ID="${t}"`,o),await H())){let A=Date.now()-l;a.info(`Wait condition satisfied via MutationObserver for element ID="${t}" after DOM changes`,{...o,elapsedTime:A});let W=L();(M||E)&&V(),f(W)}});let D={childList:y.childList===!0,subtree:y.subtree===!0,attributes:y.attributes===!0,attributeOldValue:y.attributeOldValue===!0,characterData:y.characterData===!0,characterDataOldValue:y.characterDataOldValue===!0};p.observe(document.documentElement||document.body,D),a.debug(`Started MutationObserver monitoring for element ID="${t}"`,{...o,target:"document.documentElement"})})}function F(r){if(!r||typeof r!="string")return"";let e=r.trim().replace(/\s+/g," ").replace(/<(\w+)[^>]*>\s*<\/\1>/g,"").replace(/(<\/(?:h[1-6]|p|div|ul|ol|li|blockquote)>)\s*(<(?:h[1-6]|p|div|ul|ol|li|blockquote))/g,`$1 |