Packages

Toolkit for live CRUD applications and admins

Current section

Files

Jump to
pax priv assets pax_admin.js
Raw

priv/assets/pax_admin.js

(()=>{var E=Object.create;var T=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var M=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);var P=(t,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of x(r))!I.call(t,s)&&s!==n&&T(t,s,{get:()=>r[s],enumerable:!(l=L(r,s))||l.enumerable});return t};var R=(t,r,n)=>(n=t!=null?E(S(t)):{},P(r||!t||!t.__esModule?T(n,"default",{value:t,enumerable:!0}):n,t));var A=M((y,d)=>{(function(t,r){"use strict";(function(){for(var e=0,a=["ms","moz","webkit","o"],o=0;o<a.length&&!t.requestAnimationFrame;++o)t.requestAnimationFrame=t[a[o]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[a[o]+"CancelAnimationFrame"]||t[a[o]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(p,z){var g=new Date().getTime(),v=Math.max(0,16-(g-e)),q=t.setTimeout(function(){p(g+v)},v);return e=g+v,q}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(p){clearTimeout(p)})})();var n,l,s,f=null,u=null,m=null,F=function(e,a,o){e.addEventListener?e.addEventListener(a,o,!1):e.attachEvent?e.attachEvent("on"+a,o):e["on"+a]=o},i={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},b=function(){n.width=t.innerWidth,n.height=i.barThickness*5;var e=n.getContext("2d");e.shadowBlur=i.shadowBlur,e.shadowColor=i.shadowColor;var a=e.createLinearGradient(0,0,n.width,0);for(var o in i.barColors)a.addColorStop(o,i.barColors[o]);e.lineWidth=i.barThickness,e.beginPath(),e.moveTo(0,i.barThickness/2),e.lineTo(Math.ceil(l*n.width),i.barThickness/2),e.strokeStyle=a,e.stroke()},k=function(){n=r.createElement("canvas");var e=n.style;e.position="fixed",e.top=e.left=e.right=e.margin=e.padding=0,e.zIndex=100001,e.display="none",i.className&&n.classList.add(i.className),r.body.appendChild(n),F(t,"resize",b)},c={config:function(e){for(var a in e)i.hasOwnProperty(a)&&(i[a]=e[a])},show:function(e){if(!s)if(e){if(m)return;m=setTimeout(()=>c.show(),e)}else s=!0,u!==null&&t.cancelAnimationFrame(u),n||k(),n.style.opacity=1,n.style.display="block",c.progress(0),i.autoRun&&(function a(){f=t.requestAnimationFrame(a),c.progress("+"+.05*Math.pow(1-Math.sqrt(l),2))})()},progress:function(e){return typeof e=="undefined"||(typeof e=="string"&&(e=(e.indexOf("+")>=0||e.indexOf("-")>=0?l:0)+parseFloat(e)),l=e>1?1:e,b()),l},hide:function(){clearTimeout(m),m=null,s&&(s=!1,f!=null&&(t.cancelAnimationFrame(f),f=null),(function e(){if(c.progress("+.1")>=1&&(n.style.opacity-=.05,n.style.opacity<=.05)){n.style.display="none",u=null;return}u=t.requestAnimationFrame(e)})())}};typeof d=="object"&&typeof d.exports=="object"?d.exports=c:typeof define=="function"&&define.amd?define(function(){return c}):this.topbar=c}).call(y,window,document)});var h=R(A()),_=document.querySelector("meta[name='csrf-token']").getAttribute("content"),C=new LiveView.LiveSocket("/live",Phoenix.Socket,{params:{_csrf_token:_}});h.default.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",t=>h.default.show(300));window.addEventListener("phx:page-loading-stop",t=>h.default.hide());C.connect();window.liveSocket=C;})();
/**
* @license MIT
* topbar 2.0.0, 2023-02-04
* https://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/