diff --git a/assets/js/app.js b/assets/js/app.js index 5faf26a..143f060 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -8,7 +8,36 @@ let socketPath = document.querySelector("meta[name='socket-path']").getAttribute let socketTransport = document.querySelector("meta[name='socket-transport']").getAttribute("content"); let normalizedTransport = (socketTransport == "longpoll") ? LongPoll : WebSocket; -let liveSocket = new LiveSocket(socketPath, Socket, { transport: normalizedTransport, params: { _csrf_token: csrfToken }}); + +const Hooks = { + JsonPrettyPrint: { + mounted() { + this.formatJson(); + }, + updated() { + this.formatJson(); + }, + formatJson() { + try { + // Get the raw JSON content + const rawJson = this.el.textContent.trim(); + // Parse and stringify with indentation + const formattedJson = JSON.stringify(JSON.parse(rawJson), null, 2); + // Update the element content + this.el.textContent = formattedJson; + } catch (error) { + console.error("Error formatting JSON:", error); + // Keep the original content if there's an error + } + } + } +}; + +let liveSocket = new LiveSocket(socketPath, Socket, { + transport: normalizedTransport, + params: { _csrf_token: csrfToken }, + hooks: Hooks +}); // Show progress bar on live navigation and form submits topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" }); diff --git a/lib/error_tracker.ex b/lib/error_tracker.ex index fa0184a..30d3073 100644 --- a/lib/error_tracker.ex +++ b/lib/error_tracker.ex @@ -223,14 +223,13 @@ defmodule ErrorTracker do ## Content serialization - The content stored on the context should be serializable using the JSON library - used by the application (usually `Jason`), so it is rather recommended to use - primitive types (strings, numbers, booleans...). + The content stored on the context should be serializable using the JSON library used by the + application (usually `JSON` for Elixir 1.18+ and `Jason` for older versions), so it is + recommended to use primitive types (strings, numbers, booleans...). If you still need to pass more complex data types to your context, please test - that they can be encoded to JSON or storing the errors will fail. In the case - of `Jason` that may require defining an Encoder for that data type if not - included by default. + that they can be encoded to JSON or storing the errors will fail. You may need to define a + custom encoder for that data type if not included by default. """ @spec set_context(context()) :: context() def set_context(params) when is_map(params) do @@ -383,4 +382,13 @@ defmodule ErrorTracker do Telemetry.new_occurrence(occurrence, muted) occurrence end + + @doc false + def __default_json_encoder__ do + # Elixir 1.18+ includes the JSON module. On older versions we should fall back to Jason (which + # is listed as an optional dependency). + if Version.match?(System.version(), ">= 1.18.0"), + do: JSON, + else: Jason + end end diff --git a/lib/error_tracker/schemas/occurrence.ex b/lib/error_tracker/schemas/occurrence.ex index 1c4288e..f579799 100644 --- a/lib/error_tracker/schemas/occurrence.ex +++ b/lib/error_tracker/schemas/occurrence.ex @@ -46,26 +46,32 @@ defmodule ErrorTracker.Occurrence do if changeset.valid? do context = get_field(changeset, :context, %{}) - json_encoder = + db_json_encoder = ErrorTracker.Repo.with_adapter(fn - :postgres -> Application.get_env(:postgrex, :json_library, Jason) - :mysql -> Application.get_env(:myxql, :json_library, Jason) - :sqlite -> Application.get_env(:ecto_sqlite3, :json_library, Jason) + :postgres -> Application.get_env(:postgrex, :json_library) + :mysql -> Application.get_env(:myxql, :json_library) + :sqlite -> Application.get_env(:ecto_sqlite3, :json_library) end) - case json_encoder.encode_to_iodata(context) do - {:ok, _} -> - put_change(changeset, :context, context) - - {:error, _} -> - Logger.warning( - "[ErrorTracker] Context has been ignored: it is not serializable to JSON." - ) - - put_change(changeset, :context, %{ - error: "Context not stored because it contains information not serializable to JSON." - }) - end + validated_context = + try do + json_encoder = db_json_encoder || ErrorTracker.__default_json_encoder__() + _iodata = json_encoder.encode_to_iodata!(context) + + context + rescue + _e in Protocol.UndefinedError -> + Logger.warning( + "[ErrorTracker] Context has been ignored: it is not serializable to JSON." + ) + + %{ + error: + "Context not stored because it contains information not serializable to JSON." + } + end + + put_change(changeset, :context, validated_context) else changeset end diff --git a/lib/error_tracker/web/live/show.html.heex b/lib/error_tracker/web/live/show.html.heex index c72ddb4..e0c1414 100644 --- a/lib/error_tracker/web/live/show.html.heex +++ b/lib/error_tracker/web/live/show.html.heex @@ -77,7 +77,13 @@ <.section title="Context"> -
<%= Jason.encode!(@occurrence.context, pretty: true) %>+
+ <%= ErrorTracker.__default_json_encoder__().encode_to_iodata!(@occurrence.context) %> +diff --git a/mix.exs b/mix.exs index 7e3b8a4..0ba79b9 100644 --- a/mix.exs +++ b/mix.exs @@ -86,10 +86,10 @@ defmodule ErrorTracker.MixProject do [ {:ecto_sql, "~> 3.0"}, {:ecto, "~> 3.11"}, - {:jason, "~> 1.1"}, {:phoenix_live_view, "~> 0.19 or ~> 1.0"}, {:phoenix_ecto, "~> 4.6"}, {:plug, "~> 1.10"}, + {:jason, "~> 1.1", optional: true}, {:postgrex, ">= 0.0.0", optional: true}, {:myxql, ">= 0.0.0", optional: true}, {:ecto_sqlite3, ">= 0.0.0", optional: true}, diff --git a/priv/static/app.js b/priv/static/app.js index c1f8744..6922176 100644 --- a/priv/static/app.js +++ b/priv/static/app.js @@ -11,4 +11,4 @@ removing illegal node: "${(Y.outerHTML||Y.nodeValue).trim()}" import {Socket} from "phoenix" import {LiveSocket} from "phoenix_live_view" let liveSocket = new LiveSocket("/live", Socket, {...}) - `);this.socket=new Z(Q,$),this.bindingPrefix=$.bindingPrefix||v5,this.opts=$,this.params=W1($.params||{}),this.viewLogger=$.viewLogger,this.metadataCallbacks=$.metadata||{},this.defaults=Object.assign(p0(E5),$.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=p0(window.location),this.hooks=$.hooks||{},this.uploaders=$.uploaders||{},this.loaderTimeout=$.loaderTimeout||k5,this.reloadWithJitterTimer=null,this.maxReloads=$.maxReloads||x5,this.reloadJitterMin=$.reloadJitterMin||O5,this.reloadJitterMax=$.reloadJitterMax||A5,this.failsafeJitter=$.failsafeJitter||R5,this.localStorage=$.localStorage||window.localStorage,this.sessionStorage=$.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.domCallbacks=Object.assign({onNodeAdded:W1(),onBeforeElUpdated:W1()},$.dom||{}),this.transitions=new V9,window.addEventListener("pagehide",(Y)=>{this.unloaded=!0}),this.socket.onOpen(()=>{if(this.isUnloaded())window.location.reload()})}isProfileEnabled(){return this.sessionStorage.getItem(Y1)==="true"}isDebugEnabled(){return this.sessionStorage.getItem(N0)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(N0)==="false"}enableDebug(){this.sessionStorage.setItem(N0,"true")}enableProfiling(){this.sessionStorage.setItem(Y1,"true")}disableDebug(){this.sessionStorage.setItem(N0,"false")}disableProfiling(){this.sessionStorage.removeItem(Y1)}enableLatencySim(Q){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(z1,Q)}disableLatencySim(){this.sessionStorage.removeItem(z1)}getLatencySim(){let Q=this.sessionStorage.getItem(z1);return Q?parseInt(Q):null}getSocket(){return this.socket}connect(){if(window.location.hostname==="localhost"&&!this.isDebugDisabled())this.enableDebug();let Q=()=>{if(this.joinRootViews())this.bindTopLevelEvents(),this.socket.connect();else if(this.main)this.socket.connect();else this.bindTopLevelEvents({dead:!0});this.joinDeadView()};if(["complete","loaded","interactive"].indexOf(document.readyState)>=0)Q();else document.addEventListener("DOMContentLoaded",()=>Q())}disconnect(Q){clearTimeout(this.reloadWithJitterTimer),this.socket.disconnect(Q)}replaceTransport(Q){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(Q),this.connect()}execJS(Q,Z,$=null){this.owner(Q,(Y)=>T.exec($,Z,Y,Q))}execJSHookPush(Q,Z,$,Y){this.withinOwners(Q,(z)=>{T.exec("hook",Z,z,Q,["push",{data:$,callback:Y}])})}unload(){if(this.unloaded)return;if(this.main&&this.isConnected())this.log(this.main,"socket",()=>["disconnect for page nav"]);this.unloaded=!0,this.destroyAllViews(),this.disconnect()}triggerDOM(Q,Z){this.domCallbacks[Q](...Z)}time(Q,Z){if(!this.isProfileEnabled()||!console.time)return Z();console.time(Q);let $=Z();return console.timeEnd(Q),$}log(Q,Z,$){if(this.viewLogger){let[Y,z]=$();this.viewLogger(Q,Z,Y,z)}else if(this.isDebugEnabled()){let[Y,z]=$();m5(Q,Z,Y,z)}}requestDOMUpdate(Q){this.transitions.after(Q)}transition(Q,Z,$=function(){}){this.transitions.addTransition(Q,Z,$)}onChannel(Q,Z,$){Q.on(Z,(Y)=>{let z=this.getLatencySim();if(!z)$(Y);else setTimeout(()=>$(Y),z)})}wrapPush(Q,Z,$){let Y=this.getLatencySim(),z=Q.joinCount;if(!Y)if(this.isConnected()&&Z.timeout)return $().receive("timeout",()=>{if(Q.joinCount===z&&!Q.isDestroyed())this.reloadWithJitter(Q,()=>{this.log(Q,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})});else return $();let J={receives:[],receive(W,q){this.receives.push([W,q])}};return setTimeout(()=>{if(Q.isDestroyed())return;J.receives.reduce((W,[q,G])=>W.receive(q,G),$())},Y),J}reloadWithJitter(Q,Z){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let $=this.reloadJitterMin,Y=this.reloadJitterMax,z=Math.floor(Math.random()*(Y-$+1))+$,J=s.updateLocal(this.localStorage,window.location.pathname,n1,0,(W)=>W+1);if(J>this.maxReloads)z=this.failsafeJitter;this.reloadWithJitterTimer=setTimeout(()=>{if(Q.isDestroyed()||Q.isConnected())return;if(Q.destroy(),Z?Z():this.log(Q,"join",()=>[`encountered ${J} consecutive reloads`]),J>this.maxReloads)this.log(Q,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]);if(this.hasPendingLink())window.location=this.pendingLink;else window.location.reload()},z)}getHookCallbacks(Q){return Q&&Q.startsWith("Phoenix.")?o5[Q.split(".")[1]]:this.hooks[Q]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(Q){return`${this.getBindingPrefix()}${Q}`}channel(Q,Z){return this.socket.channel(Q,Z)}joinDeadView(){let Q=document.body;if(Q&&!this.isPhxView(Q)&&!this.isPhxView(document.firstElementChild)){let Z=this.newRootView(Q);if(Z.setHref(this.getHref()),Z.joinDead(),!this.main)this.main=Z;window.requestAnimationFrame(()=>Z.execNewMounted())}}joinRootViews(){let Q=!1;return K.all(document,`${U0}:not([${K0}])`,(Z)=>{if(!this.getRootById(Z.id)){let $=this.newRootView(Z);if($.setHref(this.getHref()),$.join(),Z.hasAttribute(V1))this.main=$}Q=!0}),Q}redirect(Q,Z){this.unload(),s.redirect(Q,Z)}replaceMain(Q,Z,$=null,Y=this.setPendingLink(Q)){let z=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let J=K.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(J,Z,z),this.main.setRedirect(Q),this.transitionRemoves(null,!0),this.main.join((W,q)=>{if(W===1&&this.commitPendingLink(Y))this.requestDOMUpdate(()=>{K.findPhxSticky(document).forEach((G)=>J.appendChild(G)),this.outgoingMainEl.replaceWith(J),this.outgoingMainEl=null,$&&$(Y),q()})})}transitionRemoves(Q,Z){let $=this.binding("remove");if(Q=Q||K.all(document,`[${$}]`),Z){const Y=K.findPhxSticky(document)||[];Q=Q.filter((z)=>!K.isChildOfAny(z,Y))}Q.forEach((Y)=>{this.execJS(Y,Y.getAttribute($),"remove")})}isPhxView(Q){return Q.getAttribute&&Q.getAttribute($0)!==null}newRootView(Q,Z,$){let Y=new $5(Q,this,null,Z,$);return this.roots[Y.id]=Y,Y}owner(Q,Z){let $=Z0(Q.closest(U0),(Y)=>this.getViewByEl(Y))||this.main;if($)Z($)}withinOwners(Q,Z){this.owner(Q,($)=>Z($,Q))}getViewByEl(Q){let Z=Q.getAttribute(M0);return Z0(this.getRootById(Z),($)=>$.getDescendentByEl(Q))}getRootById(Q){return this.roots[Q]}destroyAllViews(){for(let Q in this.roots)this.roots[Q].destroy(),delete this.roots[Q];this.main=null}destroyViewByEl(Q){let Z=this.getRootById(Q.getAttribute(M0));if(Z&&Z.id===Q.id)Z.destroy(),delete this.roots[Z.id];else if(Z)Z.destroyDescendent(Q.id)}setActiveElement(Q){if(this.activeElement===Q)return;this.activeElement=Q;let Z=()=>{if(Q===this.activeElement)this.activeElement=null;Q.removeEventListener("mouseup",this),Q.removeEventListener("touchend",this)};Q.addEventListener("mouseup",Z),Q.addEventListener("touchend",Z)}getActiveElement(){if(document.activeElement===document.body)return this.activeElement||document.activeElement;else return document.activeElement||document.body}dropActiveElement(Q){if(this.prevActive&&Q.ownsElement(this.prevActive))this.prevActive=null}restorePreviouslyActiveFocus(){if(this.prevActive&&this.prevActive!==document.body)this.prevActive.focus()}blurActiveElement(){if(this.prevActive=this.getActiveElement(),this.prevActive!==document.body)this.prevActive.blur()}bindTopLevelEvents({dead:Q}={}){if(this.boundTopLevelEvents)return;if(this.boundTopLevelEvents=!0,this.socket.onClose((Z)=>{if(Z&&Z.code===1000&&this.main)return this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",(Z)=>{if(Z.persisted)this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload()},!0),!Q)this.bindNav();if(this.bindClicks(),!Q)this.bindForms();this.bind({keyup:"keyup",keydown:"keydown"},(Z,$,Y,z,J,W)=>{let q=z.getAttribute(this.binding(C5)),G=Z.key&&Z.key.toLowerCase();if(q&&q.toLowerCase()!==G)return;let j={key:Z.key,...this.eventMeta($,Z,z)};T.exec($,J,Y,z,["push",{data:j}])}),this.bind({blur:"focusout",focus:"focusin"},(Z,$,Y,z,J,W)=>{if(!W){let q={key:Z.key,...this.eventMeta($,Z,z)};T.exec($,J,Y,z,["push",{data:q}])}}),this.bind({blur:"blur",focus:"focus"},(Z,$,Y,z,J,W)=>{if(W==="window"){let q=this.eventMeta($,Z,z);T.exec($,J,Y,z,["push",{data:q}])}}),window.addEventListener("dragover",(Z)=>Z.preventDefault()),window.addEventListener("drop",(Z)=>{Z.preventDefault();let $=Z0(R0(Z.target,this.binding(O1)),(J)=>{return J.getAttribute(this.binding(O1))}),Y=$&&document.getElementById($),z=Array.from(Z.dataTransfer.files||[]);if(!Y||Y.disabled||z.length===0||!(Y.files instanceof FileList))return;w.trackFiles(Y,z,Z.dataTransfer),Y.dispatchEvent(new Event("input",{bubbles:!0}))}),this.on(r1,(Z)=>{let $=Z.target;if(!K.isUploadInput($))return;let Y=Array.from(Z.detail.files||[]).filter((z)=>z instanceof File||z instanceof Blob);w.trackFiles($,Y),$.dispatchEvent(new Event("input",{bubbles:!0}))})}eventMeta(Q,Z,$){let Y=this.metadataCallbacks[Q];return Y?Y(Z,$):{}}setPendingLink(Q){return this.linkRef++,this.pendingLink=Q,this.linkRef}commitPendingLink(Q){if(this.linkRef!==Q)return!1;else return this.href=this.pendingLink,this.pendingLink=null,!0}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(Q,Z){for(let $ in Q){let Y=Q[$];this.on(Y,(z)=>{let J=this.binding($),W=this.binding(`window-${$}`),q=z.target.getAttribute&&z.target.getAttribute(J);if(q)this.debounce(z.target,z,Y,()=>{this.withinOwners(z.target,(G)=>{Z(z,$,G,z.target,q,null)})});else K.all(document,`[${W}]`,(G)=>{let j=G.getAttribute(W);this.debounce(G,z,Y,()=>{this.withinOwners(G,(B)=>{Z(z,$,B,G,j,"window")})})})})}}bindClicks(){window.addEventListener("mousedown",(Q)=>this.clickStartedAtTarget=Q.target),this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(Q,Z,$){let Y=this.binding(Z);window.addEventListener(Q,(z)=>{let J=null;if($)J=z.target.matches(`[${Y}]`)?z.target:z.target.querySelector(`[${Y}]`);else{if(z.detail===0)this.clickStartedAtTarget=z.target;let q=this.clickStartedAtTarget||z.target;J=R0(q,Y),this.dispatchClickAway(z,q),this.clickStartedAtTarget=null}let W=J&&J.getAttribute(Y);if(!W){if(!$&&K.isNewPageClick(z,window.location))this.unload();return}if(J.getAttribute("href")==="#")z.preventDefault();if(J.hasAttribute(v))return;this.debounce(J,z,"click",()=>{this.withinOwners(J,(q)=>{T.exec("click",W,q,J,["push",{data:this.eventMeta("click",z,J)}])})})},$)}dispatchClickAway(Q,Z){let $=this.binding("click-away");K.all(document,`[${$}]`,(Y)=>{if(!(Y.isSameNode(Z)||Y.contains(Z)))this.withinOwners(Y,(z)=>{let J=Y.getAttribute($);if(T.isVisible(Y)&&T.isInViewport(Y))T.exec("click",J,z,Y,["push",{data:this.eventMeta("click",Q,Q.target)}])})})}bindNav(){if(!s.canPushState())return;if(history.scrollRestoration)history.scrollRestoration="manual";let Q=null;window.addEventListener("scroll",(Z)=>{clearTimeout(Q),Q=setTimeout(()=>{s.updateCurrentState(($)=>Object.assign($,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",(Z)=>{if(!this.registerNewLocation(window.location))return;let{type:$,id:Y,root:z,scroll:J}=Z.state||{},W=window.location.href;K.dispatchEvent(window,"phx:navigate",{detail:{href:W,patch:$==="patch",pop:!0}}),this.requestDOMUpdate(()=>{if(this.main.isConnected()&&($==="patch"&&Y===this.main.id))this.main.pushLinkPatch(W,null,()=>{this.maybeScroll(J)});else this.replaceMain(W,null,()=>{if(z)this.replaceRootHistory();this.maybeScroll(J)})})},!1),window.addEventListener("click",(Z)=>{let $=R0(Z.target,t0),Y=$&&$.getAttribute(t0);if(!Y||!this.isConnected()||!this.main||K.wantsNewTab(Z))return;let z=$.href instanceof SVGAnimatedString?$.href.baseVal:$.href,J=$.getAttribute(P5);if(Z.preventDefault(),Z.stopImmediatePropagation(),this.pendingLink===z)return;this.requestDOMUpdate(()=>{if(Y==="patch")this.pushHistoryPatch(z,J,$);else if(Y==="redirect")this.historyRedirect(z,J);else throw new Error(`expected ${t0} to be "patch" or "redirect", got: ${Y}`);let W=$.getAttribute(this.binding("click"));if(W)this.requestDOMUpdate(()=>this.execJS($,W,"click"))})},!1)}maybeScroll(Q){if(typeof Q==="number")requestAnimationFrame(()=>{window.scrollTo(0,Q)})}dispatchEvent(Q,Z={}){K.dispatchEvent(window,`phx:${Q}`,{detail:Z})}dispatchEvents(Q){Q.forEach(([Z,$])=>this.dispatchEvent(Z,$))}withPageLoading(Q,Z){K.dispatchEvent(window,"phx:page-loading-start",{detail:Q});let $=()=>K.dispatchEvent(window,"phx:page-loading-stop",{detail:Q});return Z?Z($):$}pushHistoryPatch(Q,Z,$){if(!this.isConnected()||!this.main.isMain())return s.redirect(Q);this.withPageLoading({to:Q,kind:"patch"},(Y)=>{this.main.pushLinkPatch(Q,$,(z)=>{this.historyPatch(Q,Z,z),Y()})})}historyPatch(Q,Z,$=this.setPendingLink(Q)){if(!this.commitPendingLink($))return;s.pushState(Z,{type:"patch",id:this.main.id},Q),K.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:Q,pop:!1}}),this.registerNewLocation(window.location)}historyRedirect(Q,Z,$){if(!this.isConnected()||!this.main.isMain())return s.redirect(Q,$);if(/^\/$|^\/[^\/]+.*$/.test(Q)){let{protocol:z,host:J}=window.location;Q=`${z}//${J}${Q}`}let Y=window.scrollY;this.withPageLoading({to:Q,kind:"redirect"},(z)=>{this.replaceMain(Q,$,(J)=>{if(J===this.linkRef)s.pushState(Z,{type:"redirect",id:this.main.id,scroll:Y},Q),K.dispatchEvent(window,"phx:navigate",{detail:{href:Q,patch:!1,pop:!1}}),this.registerNewLocation(window.location);z()})})}replaceRootHistory(){s.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(Q){let{pathname:Z,search:$}=this.currentLocation;if(Z+$===Q.pathname+Q.search)return!1;else return this.currentLocation=p0(Q),!0}bindForms(){let Q=0,Z=!1;this.on("submit",($)=>{let Y=$.target.getAttribute(this.binding("submit")),z=$.target.getAttribute(this.binding("change"));if(!Z&&z&&!Y)Z=!0,$.preventDefault(),this.withinOwners($.target,(J)=>{J.disableForm($.target),window.requestAnimationFrame(()=>{if(K.isUnloadableFormSubmit($))this.unload();$.target.submit()})})},!0),this.on("submit",($)=>{let Y=$.target.getAttribute(this.binding("submit"));if(!Y){if(K.isUnloadableFormSubmit($))this.unload();return}$.preventDefault(),$.target.disabled=!0,this.withinOwners($.target,(z)=>{T.exec("submit",Y,z,$.target,["push",{submitter:$.submitter}])})},!1);for(let $ of["change","input"])this.on($,(Y)=>{let z=this.binding("change"),J=Y.target,W=J.getAttribute(z),q=J.form&&J.form.getAttribute(z),G=W||q;if(!G)return;if(J.type==="number"&&J.validity&&J.validity.badInput)return;let j=W?J:J.form,B=Q;Q++;let{at:U,type:V}=K.private(J,"prev-iteration")||{};if(U===B-1&&$==="change"&&V==="input")return;K.putPrivate(J,"prev-iteration",{at:B,type:$}),this.debounce(J,Y,$,()=>{this.withinOwners(j,(X)=>{if(K.putPrivate(J,B1,!0),!K.isTextualInput(J))this.setActiveElement(J);T.exec("change",G,X,J,["push",{_target:Y.target.name,dispatcher:j}])})})},!1);this.on("reset",($)=>{let Y=$.target;K.resetForm(Y,this.binding(m0),this.binding(c0));let z=Array.from(Y.elements).find((J)=>J.type==="reset");if(z)window.requestAnimationFrame(()=>{z.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(Q,Z,$,Y){if($==="blur"||$==="focusout")return Y();let z=this.binding(b5),J=this.binding(g5),W=this.defaults.debounce.toString(),q=this.defaults.throttle.toString();this.withinOwners(Q,(G)=>{let j=()=>!G.isDestroyed()&&document.body.contains(Q);K.debounce(Q,Z,z,W,J,q,j,()=>{Y()})})}silenceEvents(Q){this.silenced=!0,Q(),this.silenced=!1}on(Q,Z){window.addEventListener(Q,($)=>{if(!this.silenced)Z($)})}},V9=class{constructor(){this.transitions=new Set,this.pendingOps=[]}reset(){this.transitions.forEach((Q)=>{clearTimeout(Q),this.transitions.delete(Q)}),this.flushPendingOps()}after(Q){if(this.size()===0)Q();else this.pushPendingOp(Q)}addTransition(Q,Z,$){Z();let Y=setTimeout(()=>{this.transitions.delete(Y),$(),this.flushPendingOps()},Q);this.transitions.add(Y)}pushPendingOp(Q){this.pendingOps.push(Q)}size(){return this.transitions.size}flushPendingOps(){if(this.size()>0)return;let Q=this.pendingOps.shift();if(Q)Q(),this.flushPendingOps()}};var n0=M5(J5(),1),X9=document.querySelector("meta[name='csrf-token']").getAttribute("content"),L9=document.querySelector("meta[name='socket-path']").getAttribute("content"),F9=document.querySelector("meta[name='socket-transport']").getAttribute("content"),D9=F9=="longpoll"?z0:WebSocket,W5=new Y5(L9,x1,{transport:D9,params:{_csrf_token:X9}});n0.default.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",(Q)=>n0.default.show(300));window.addEventListener("phx:page-loading-stop",(Q)=>n0.default.hide());W5.connect();window.liveSocket=W5; + `);this.socket=new Z(Q,$),this.bindingPrefix=$.bindingPrefix||v5,this.opts=$,this.params=W1($.params||{}),this.viewLogger=$.viewLogger,this.metadataCallbacks=$.metadata||{},this.defaults=Object.assign(p0(E5),$.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=p0(window.location),this.hooks=$.hooks||{},this.uploaders=$.uploaders||{},this.loaderTimeout=$.loaderTimeout||k5,this.reloadWithJitterTimer=null,this.maxReloads=$.maxReloads||x5,this.reloadJitterMin=$.reloadJitterMin||O5,this.reloadJitterMax=$.reloadJitterMax||A5,this.failsafeJitter=$.failsafeJitter||R5,this.localStorage=$.localStorage||window.localStorage,this.sessionStorage=$.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.domCallbacks=Object.assign({onNodeAdded:W1(),onBeforeElUpdated:W1()},$.dom||{}),this.transitions=new V9,window.addEventListener("pagehide",(Y)=>{this.unloaded=!0}),this.socket.onOpen(()=>{if(this.isUnloaded())window.location.reload()})}isProfileEnabled(){return this.sessionStorage.getItem(Y1)==="true"}isDebugEnabled(){return this.sessionStorage.getItem(N0)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(N0)==="false"}enableDebug(){this.sessionStorage.setItem(N0,"true")}enableProfiling(){this.sessionStorage.setItem(Y1,"true")}disableDebug(){this.sessionStorage.setItem(N0,"false")}disableProfiling(){this.sessionStorage.removeItem(Y1)}enableLatencySim(Q){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(z1,Q)}disableLatencySim(){this.sessionStorage.removeItem(z1)}getLatencySim(){let Q=this.sessionStorage.getItem(z1);return Q?parseInt(Q):null}getSocket(){return this.socket}connect(){if(window.location.hostname==="localhost"&&!this.isDebugDisabled())this.enableDebug();let Q=()=>{if(this.joinRootViews())this.bindTopLevelEvents(),this.socket.connect();else if(this.main)this.socket.connect();else this.bindTopLevelEvents({dead:!0});this.joinDeadView()};if(["complete","loaded","interactive"].indexOf(document.readyState)>=0)Q();else document.addEventListener("DOMContentLoaded",()=>Q())}disconnect(Q){clearTimeout(this.reloadWithJitterTimer),this.socket.disconnect(Q)}replaceTransport(Q){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(Q),this.connect()}execJS(Q,Z,$=null){this.owner(Q,(Y)=>T.exec($,Z,Y,Q))}execJSHookPush(Q,Z,$,Y){this.withinOwners(Q,(z)=>{T.exec("hook",Z,z,Q,["push",{data:$,callback:Y}])})}unload(){if(this.unloaded)return;if(this.main&&this.isConnected())this.log(this.main,"socket",()=>["disconnect for page nav"]);this.unloaded=!0,this.destroyAllViews(),this.disconnect()}triggerDOM(Q,Z){this.domCallbacks[Q](...Z)}time(Q,Z){if(!this.isProfileEnabled()||!console.time)return Z();console.time(Q);let $=Z();return console.timeEnd(Q),$}log(Q,Z,$){if(this.viewLogger){let[Y,z]=$();this.viewLogger(Q,Z,Y,z)}else if(this.isDebugEnabled()){let[Y,z]=$();m5(Q,Z,Y,z)}}requestDOMUpdate(Q){this.transitions.after(Q)}transition(Q,Z,$=function(){}){this.transitions.addTransition(Q,Z,$)}onChannel(Q,Z,$){Q.on(Z,(Y)=>{let z=this.getLatencySim();if(!z)$(Y);else setTimeout(()=>$(Y),z)})}wrapPush(Q,Z,$){let Y=this.getLatencySim(),z=Q.joinCount;if(!Y)if(this.isConnected()&&Z.timeout)return $().receive("timeout",()=>{if(Q.joinCount===z&&!Q.isDestroyed())this.reloadWithJitter(Q,()=>{this.log(Q,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})});else return $();let J={receives:[],receive(W,q){this.receives.push([W,q])}};return setTimeout(()=>{if(Q.isDestroyed())return;J.receives.reduce((W,[q,G])=>W.receive(q,G),$())},Y),J}reloadWithJitter(Q,Z){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let $=this.reloadJitterMin,Y=this.reloadJitterMax,z=Math.floor(Math.random()*(Y-$+1))+$,J=s.updateLocal(this.localStorage,window.location.pathname,n1,0,(W)=>W+1);if(J>this.maxReloads)z=this.failsafeJitter;this.reloadWithJitterTimer=setTimeout(()=>{if(Q.isDestroyed()||Q.isConnected())return;if(Q.destroy(),Z?Z():this.log(Q,"join",()=>[`encountered ${J} consecutive reloads`]),J>this.maxReloads)this.log(Q,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]);if(this.hasPendingLink())window.location=this.pendingLink;else window.location.reload()},z)}getHookCallbacks(Q){return Q&&Q.startsWith("Phoenix.")?o5[Q.split(".")[1]]:this.hooks[Q]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(Q){return`${this.getBindingPrefix()}${Q}`}channel(Q,Z){return this.socket.channel(Q,Z)}joinDeadView(){let Q=document.body;if(Q&&!this.isPhxView(Q)&&!this.isPhxView(document.firstElementChild)){let Z=this.newRootView(Q);if(Z.setHref(this.getHref()),Z.joinDead(),!this.main)this.main=Z;window.requestAnimationFrame(()=>Z.execNewMounted())}}joinRootViews(){let Q=!1;return K.all(document,`${U0}:not([${K0}])`,(Z)=>{if(!this.getRootById(Z.id)){let $=this.newRootView(Z);if($.setHref(this.getHref()),$.join(),Z.hasAttribute(V1))this.main=$}Q=!0}),Q}redirect(Q,Z){this.unload(),s.redirect(Q,Z)}replaceMain(Q,Z,$=null,Y=this.setPendingLink(Q)){let z=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let J=K.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(J,Z,z),this.main.setRedirect(Q),this.transitionRemoves(null,!0),this.main.join((W,q)=>{if(W===1&&this.commitPendingLink(Y))this.requestDOMUpdate(()=>{K.findPhxSticky(document).forEach((G)=>J.appendChild(G)),this.outgoingMainEl.replaceWith(J),this.outgoingMainEl=null,$&&$(Y),q()})})}transitionRemoves(Q,Z){let $=this.binding("remove");if(Q=Q||K.all(document,`[${$}]`),Z){const Y=K.findPhxSticky(document)||[];Q=Q.filter((z)=>!K.isChildOfAny(z,Y))}Q.forEach((Y)=>{this.execJS(Y,Y.getAttribute($),"remove")})}isPhxView(Q){return Q.getAttribute&&Q.getAttribute($0)!==null}newRootView(Q,Z,$){let Y=new $5(Q,this,null,Z,$);return this.roots[Y.id]=Y,Y}owner(Q,Z){let $=Z0(Q.closest(U0),(Y)=>this.getViewByEl(Y))||this.main;if($)Z($)}withinOwners(Q,Z){this.owner(Q,($)=>Z($,Q))}getViewByEl(Q){let Z=Q.getAttribute(M0);return Z0(this.getRootById(Z),($)=>$.getDescendentByEl(Q))}getRootById(Q){return this.roots[Q]}destroyAllViews(){for(let Q in this.roots)this.roots[Q].destroy(),delete this.roots[Q];this.main=null}destroyViewByEl(Q){let Z=this.getRootById(Q.getAttribute(M0));if(Z&&Z.id===Q.id)Z.destroy(),delete this.roots[Z.id];else if(Z)Z.destroyDescendent(Q.id)}setActiveElement(Q){if(this.activeElement===Q)return;this.activeElement=Q;let Z=()=>{if(Q===this.activeElement)this.activeElement=null;Q.removeEventListener("mouseup",this),Q.removeEventListener("touchend",this)};Q.addEventListener("mouseup",Z),Q.addEventListener("touchend",Z)}getActiveElement(){if(document.activeElement===document.body)return this.activeElement||document.activeElement;else return document.activeElement||document.body}dropActiveElement(Q){if(this.prevActive&&Q.ownsElement(this.prevActive))this.prevActive=null}restorePreviouslyActiveFocus(){if(this.prevActive&&this.prevActive!==document.body)this.prevActive.focus()}blurActiveElement(){if(this.prevActive=this.getActiveElement(),this.prevActive!==document.body)this.prevActive.blur()}bindTopLevelEvents({dead:Q}={}){if(this.boundTopLevelEvents)return;if(this.boundTopLevelEvents=!0,this.socket.onClose((Z)=>{if(Z&&Z.code===1000&&this.main)return this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",(Z)=>{if(Z.persisted)this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload()},!0),!Q)this.bindNav();if(this.bindClicks(),!Q)this.bindForms();this.bind({keyup:"keyup",keydown:"keydown"},(Z,$,Y,z,J,W)=>{let q=z.getAttribute(this.binding(C5)),G=Z.key&&Z.key.toLowerCase();if(q&&q.toLowerCase()!==G)return;let j={key:Z.key,...this.eventMeta($,Z,z)};T.exec($,J,Y,z,["push",{data:j}])}),this.bind({blur:"focusout",focus:"focusin"},(Z,$,Y,z,J,W)=>{if(!W){let q={key:Z.key,...this.eventMeta($,Z,z)};T.exec($,J,Y,z,["push",{data:q}])}}),this.bind({blur:"blur",focus:"focus"},(Z,$,Y,z,J,W)=>{if(W==="window"){let q=this.eventMeta($,Z,z);T.exec($,J,Y,z,["push",{data:q}])}}),window.addEventListener("dragover",(Z)=>Z.preventDefault()),window.addEventListener("drop",(Z)=>{Z.preventDefault();let $=Z0(R0(Z.target,this.binding(O1)),(J)=>{return J.getAttribute(this.binding(O1))}),Y=$&&document.getElementById($),z=Array.from(Z.dataTransfer.files||[]);if(!Y||Y.disabled||z.length===0||!(Y.files instanceof FileList))return;w.trackFiles(Y,z,Z.dataTransfer),Y.dispatchEvent(new Event("input",{bubbles:!0}))}),this.on(r1,(Z)=>{let $=Z.target;if(!K.isUploadInput($))return;let Y=Array.from(Z.detail.files||[]).filter((z)=>z instanceof File||z instanceof Blob);w.trackFiles($,Y),$.dispatchEvent(new Event("input",{bubbles:!0}))})}eventMeta(Q,Z,$){let Y=this.metadataCallbacks[Q];return Y?Y(Z,$):{}}setPendingLink(Q){return this.linkRef++,this.pendingLink=Q,this.linkRef}commitPendingLink(Q){if(this.linkRef!==Q)return!1;else return this.href=this.pendingLink,this.pendingLink=null,!0}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(Q,Z){for(let $ in Q){let Y=Q[$];this.on(Y,(z)=>{let J=this.binding($),W=this.binding(`window-${$}`),q=z.target.getAttribute&&z.target.getAttribute(J);if(q)this.debounce(z.target,z,Y,()=>{this.withinOwners(z.target,(G)=>{Z(z,$,G,z.target,q,null)})});else K.all(document,`[${W}]`,(G)=>{let j=G.getAttribute(W);this.debounce(G,z,Y,()=>{this.withinOwners(G,(B)=>{Z(z,$,B,G,j,"window")})})})})}}bindClicks(){window.addEventListener("mousedown",(Q)=>this.clickStartedAtTarget=Q.target),this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(Q,Z,$){let Y=this.binding(Z);window.addEventListener(Q,(z)=>{let J=null;if($)J=z.target.matches(`[${Y}]`)?z.target:z.target.querySelector(`[${Y}]`);else{if(z.detail===0)this.clickStartedAtTarget=z.target;let q=this.clickStartedAtTarget||z.target;J=R0(q,Y),this.dispatchClickAway(z,q),this.clickStartedAtTarget=null}let W=J&&J.getAttribute(Y);if(!W){if(!$&&K.isNewPageClick(z,window.location))this.unload();return}if(J.getAttribute("href")==="#")z.preventDefault();if(J.hasAttribute(v))return;this.debounce(J,z,"click",()=>{this.withinOwners(J,(q)=>{T.exec("click",W,q,J,["push",{data:this.eventMeta("click",z,J)}])})})},$)}dispatchClickAway(Q,Z){let $=this.binding("click-away");K.all(document,`[${$}]`,(Y)=>{if(!(Y.isSameNode(Z)||Y.contains(Z)))this.withinOwners(Y,(z)=>{let J=Y.getAttribute($);if(T.isVisible(Y)&&T.isInViewport(Y))T.exec("click",J,z,Y,["push",{data:this.eventMeta("click",Q,Q.target)}])})})}bindNav(){if(!s.canPushState())return;if(history.scrollRestoration)history.scrollRestoration="manual";let Q=null;window.addEventListener("scroll",(Z)=>{clearTimeout(Q),Q=setTimeout(()=>{s.updateCurrentState(($)=>Object.assign($,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",(Z)=>{if(!this.registerNewLocation(window.location))return;let{type:$,id:Y,root:z,scroll:J}=Z.state||{},W=window.location.href;K.dispatchEvent(window,"phx:navigate",{detail:{href:W,patch:$==="patch",pop:!0}}),this.requestDOMUpdate(()=>{if(this.main.isConnected()&&($==="patch"&&Y===this.main.id))this.main.pushLinkPatch(W,null,()=>{this.maybeScroll(J)});else this.replaceMain(W,null,()=>{if(z)this.replaceRootHistory();this.maybeScroll(J)})})},!1),window.addEventListener("click",(Z)=>{let $=R0(Z.target,t0),Y=$&&$.getAttribute(t0);if(!Y||!this.isConnected()||!this.main||K.wantsNewTab(Z))return;let z=$.href instanceof SVGAnimatedString?$.href.baseVal:$.href,J=$.getAttribute(P5);if(Z.preventDefault(),Z.stopImmediatePropagation(),this.pendingLink===z)return;this.requestDOMUpdate(()=>{if(Y==="patch")this.pushHistoryPatch(z,J,$);else if(Y==="redirect")this.historyRedirect(z,J);else throw new Error(`expected ${t0} to be "patch" or "redirect", got: ${Y}`);let W=$.getAttribute(this.binding("click"));if(W)this.requestDOMUpdate(()=>this.execJS($,W,"click"))})},!1)}maybeScroll(Q){if(typeof Q==="number")requestAnimationFrame(()=>{window.scrollTo(0,Q)})}dispatchEvent(Q,Z={}){K.dispatchEvent(window,`phx:${Q}`,{detail:Z})}dispatchEvents(Q){Q.forEach(([Z,$])=>this.dispatchEvent(Z,$))}withPageLoading(Q,Z){K.dispatchEvent(window,"phx:page-loading-start",{detail:Q});let $=()=>K.dispatchEvent(window,"phx:page-loading-stop",{detail:Q});return Z?Z($):$}pushHistoryPatch(Q,Z,$){if(!this.isConnected()||!this.main.isMain())return s.redirect(Q);this.withPageLoading({to:Q,kind:"patch"},(Y)=>{this.main.pushLinkPatch(Q,$,(z)=>{this.historyPatch(Q,Z,z),Y()})})}historyPatch(Q,Z,$=this.setPendingLink(Q)){if(!this.commitPendingLink($))return;s.pushState(Z,{type:"patch",id:this.main.id},Q),K.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:Q,pop:!1}}),this.registerNewLocation(window.location)}historyRedirect(Q,Z,$){if(!this.isConnected()||!this.main.isMain())return s.redirect(Q,$);if(/^\/$|^\/[^\/]+.*$/.test(Q)){let{protocol:z,host:J}=window.location;Q=`${z}//${J}${Q}`}let Y=window.scrollY;this.withPageLoading({to:Q,kind:"redirect"},(z)=>{this.replaceMain(Q,$,(J)=>{if(J===this.linkRef)s.pushState(Z,{type:"redirect",id:this.main.id,scroll:Y},Q),K.dispatchEvent(window,"phx:navigate",{detail:{href:Q,patch:!1,pop:!1}}),this.registerNewLocation(window.location);z()})})}replaceRootHistory(){s.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(Q){let{pathname:Z,search:$}=this.currentLocation;if(Z+$===Q.pathname+Q.search)return!1;else return this.currentLocation=p0(Q),!0}bindForms(){let Q=0,Z=!1;this.on("submit",($)=>{let Y=$.target.getAttribute(this.binding("submit")),z=$.target.getAttribute(this.binding("change"));if(!Z&&z&&!Y)Z=!0,$.preventDefault(),this.withinOwners($.target,(J)=>{J.disableForm($.target),window.requestAnimationFrame(()=>{if(K.isUnloadableFormSubmit($))this.unload();$.target.submit()})})},!0),this.on("submit",($)=>{let Y=$.target.getAttribute(this.binding("submit"));if(!Y){if(K.isUnloadableFormSubmit($))this.unload();return}$.preventDefault(),$.target.disabled=!0,this.withinOwners($.target,(z)=>{T.exec("submit",Y,z,$.target,["push",{submitter:$.submitter}])})},!1);for(let $ of["change","input"])this.on($,(Y)=>{let z=this.binding("change"),J=Y.target,W=J.getAttribute(z),q=J.form&&J.form.getAttribute(z),G=W||q;if(!G)return;if(J.type==="number"&&J.validity&&J.validity.badInput)return;let j=W?J:J.form,B=Q;Q++;let{at:U,type:V}=K.private(J,"prev-iteration")||{};if(U===B-1&&$==="change"&&V==="input")return;K.putPrivate(J,"prev-iteration",{at:B,type:$}),this.debounce(J,Y,$,()=>{this.withinOwners(j,(X)=>{if(K.putPrivate(J,B1,!0),!K.isTextualInput(J))this.setActiveElement(J);T.exec("change",G,X,J,["push",{_target:Y.target.name,dispatcher:j}])})})},!1);this.on("reset",($)=>{let Y=$.target;K.resetForm(Y,this.binding(m0),this.binding(c0));let z=Array.from(Y.elements).find((J)=>J.type==="reset");if(z)window.requestAnimationFrame(()=>{z.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(Q,Z,$,Y){if($==="blur"||$==="focusout")return Y();let z=this.binding(b5),J=this.binding(g5),W=this.defaults.debounce.toString(),q=this.defaults.throttle.toString();this.withinOwners(Q,(G)=>{let j=()=>!G.isDestroyed()&&document.body.contains(Q);K.debounce(Q,Z,z,W,J,q,j,()=>{Y()})})}silenceEvents(Q){this.silenced=!0,Q(),this.silenced=!1}on(Q,Z){window.addEventListener(Q,($)=>{if(!this.silenced)Z($)})}},V9=class{constructor(){this.transitions=new Set,this.pendingOps=[]}reset(){this.transitions.forEach((Q)=>{clearTimeout(Q),this.transitions.delete(Q)}),this.flushPendingOps()}after(Q){if(this.size()===0)Q();else this.pushPendingOp(Q)}addTransition(Q,Z,$){Z();let Y=setTimeout(()=>{this.transitions.delete(Y),$(),this.flushPendingOps()},Q);this.transitions.add(Y)}pushPendingOp(Q){this.pendingOps.push(Q)}size(){return this.transitions.size}flushPendingOps(){if(this.size()>0)return;let Q=this.pendingOps.shift();if(Q)Q(),this.flushPendingOps()}};var n0=M5(J5(),1),X9=document.querySelector("meta[name='csrf-token']").getAttribute("content"),L9=document.querySelector("meta[name='socket-path']").getAttribute("content"),F9=document.querySelector("meta[name='socket-transport']").getAttribute("content"),D9=F9=="longpoll"?z0:WebSocket,I9={JsonPrettyPrint:{mounted(){this.formatJson()},updated(){this.formatJson()},formatJson(){try{const Q=this.el.textContent.trim(),Z=JSON.stringify(JSON.parse(Q),null,2);this.el.textContent=Z}catch(Q){console.error("Error formatting JSON:",Q)}}}},W5=new Y5(L9,x1,{transport:D9,params:{_csrf_token:X9},hooks:I9});n0.default.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",(Q)=>n0.default.show(300));window.addEventListener("phx:page-loading-stop",(Q)=>n0.default.hide());W5.connect();window.liveSocket=W5;