Files
bruno/app/dist/spa/assets/LocalStorage-7Uw3xG9P.js
2026-02-18 21:04:57 +01:00

2 lines
13 KiB
JavaScript

import{aY as Se,g as se,r as P,D as J,B as X,f as Ee,al as Te,w as _,o as _e,e as K,y as qe,l as D,aZ as U,z as ue,Y as ke,c as Ce,P as He,s as Me,ax as Pe,H as Be,Q as We,a as T,I as Ae,ay as Ie,R as Le,az as ze,S as Re,aA as $e,a_ as De,a$ as Z,b0 as Fe,C as Ke,b1 as Oe,t as je,b2 as Ne,b3 as Qe,h as ee,b as Ve,aB as Ye,av as Ge,G as Je,n as C,b4 as Xe,b5 as Ue}from"./index-0B2sgEyA.js";function Ze(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),Se.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const et={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},tt={...et,contextMenu:Boolean};function nt({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:i,emit:c}=se(),l=P(null);let s=null;function d(a){return l.value===null?!1:a===void 0||a.touches===void 0||a.touches.length<=1}const u={};o===void 0&&(Object.assign(u,{hide(a){i.hide(a)},toggle(a){i.toggle(a),a.qAnchorHandled=!0},toggleKey(a){Te(a,13)===!0&&u.toggle(a)},contextClick(a){i.hide(a),J(a),Ee(()=>{i.show(a),a.qAnchorHandled=!0})},prevent:J,mobileTouch(a){if(u.mobileCleanup(a),d(a)!==!0)return;i.hide(a),l.value.classList.add("non-selectable");const f=a.target;X(u,"anchor",[[f,"touchmove","mobileCleanup","passive"],[f,"touchend","mobileCleanup","passive"],[f,"touchcancel","mobileCleanup","passive"],[l.value,"contextmenu","prevent","notPassive"]]),s=setTimeout(()=>{s=null,i.show(a),a.qAnchorHandled=!0},300)},mobileCleanup(a){l.value.classList.remove("non-selectable"),s!==null&&(clearTimeout(s),s=null),e.value===!0&&a!==void 0&&Ze()}}),o=function(a=n.contextMenu){if(n.noParentEvent===!0||l.value===null)return;let f;a===!0?i.$q.platform.is.mobile===!0?f=[[l.value,"touchstart","mobileTouch","passive"]]:f=[[l.value,"mousedown","hide","passive"],[l.value,"contextmenu","contextClick","notPassive"]]:f=[[l.value,"click","toggle","passive"],[l.value,"keyup","toggleKey","passive"]],X(u,"anchor",f)});function h(){qe(u,"anchor")}function v(a){for(l.value=a;l.value.classList.contains("q-anchor--skip");)l.value=l.value.parentNode;o()}function x(){if(n.target===!1||n.target===""||i.$el.parentNode===null)l.value=null;else if(n.target===!0)v(i.$el.parentNode);else{let a=n.target;if(typeof n.target=="string")try{a=document.querySelector(n.target)}catch{a=void 0}a!=null?(l.value=a.$el||a,o()):(l.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return _(()=>n.contextMenu,a=>{l.value!==null&&(h(),o(a))}),_(()=>n.target,()=>{l.value!==null&&h(),x()}),_(()=>n.noParentEvent,a=>{l.value!==null&&(a===!0?h():o())}),_e(()=>{x(),t!==!0&&n.modelValue===!0&&l.value===null&&c("update:modelValue",!1)}),K(()=>{s!==null&&clearTimeout(s),h()}),{anchorEl:l,canShow:d,anchorEvents:u}}function ot(e,t){const o=P(null);let n;function i(s,d){const u=`${d!==void 0?"add":"remove"}EventListener`,h=d!==void 0?d:n;s!==window&&s[u]("scroll",h,D.passive),window[u]("scroll",h,D.passive),n=d}function c(){o.value!==null&&(i(o.value),o.value=null)}const l=_(()=>e.noParentEvent,()=>{o.value!==null&&(c(),t())});return K(l),{localScrollTarget:o,unconfigureScrollTarget:c,changeScrollEvent:i}}const{notPassiveCapture:B}=D,S=[];function W(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=U.length-1;for(;o>=0;){const n=U[o].$;if(n.type.name==="QTooltip"){o--;continue}if(n.type.name!=="QDialog")break;if(n.props.seamless!==!0)return;o--}for(let n=S.length-1;n>=0;n--){const i=S[n];if((i.anchorEl.value===null||i.anchorEl.value.contains(t)===!1)&&(t===document.body||i.innerRef.value!==null&&i.innerRef.value.contains(t)===!1))e.qClickOutside=!0,i.onClickOutside(e);else return}}function lt(e){S.push(e),S.length===1&&(document.addEventListener("mousedown",W,B),document.addEventListener("touchstart",W,B))}function te(e){const t=S.findIndex(o=>o===e);t!==-1&&(S.splice(t,1),S.length===0&&(document.removeEventListener("mousedown",W,B),document.removeEventListener("touchstart",W,B)))}let ne,oe;function le(e){const t=e.split(" ");return t.length!==2?!1:["top","center","bottom"].includes(t[0])!==!0?(console.error("Anchor/Self position must start with one of top/center/bottom"),!1):["left","middle","right","start","end"].includes(t[1])!==!0?(console.error("Anchor/Self position must end with one of left/middle/right/start/end"),!1):!0}function it(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const F={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{F[`${e}#ltr`]=e,F[`${e}#rtl`]=e});function ie(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:F[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function at(e,t){let{top:o,left:n,right:i,bottom:c,width:l,height:s}=e.getBoundingClientRect();return t!==void 0&&(o-=t[1],n-=t[0],c+=t[1],i+=t[0],l+=t[0],s+=t[1]),{top:o,bottom:c,height:s,left:n,right:i,width:l,middle:n+(i-n)/2,center:o+(c-o)/2}}function rt(e,t,o){let{top:n,left:i}=e.getBoundingClientRect();return n+=t.top,i+=t.left,o!==void 0&&(n+=o[1],i+=o[0]),{top:n,bottom:n+1,height:1,left:i,right:i+1,width:1,middle:i,center:n}}function st(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function ae(e,t,o,n){return{top:e[o.vertical]-t[n.vertical],left:e[o.horizontal]-t[n.horizontal]}}function ce(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{ce(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:i,anchorOrigin:c,selfOrigin:l,absoluteOffset:s,fit:d,cover:u,maxHeight:h,maxWidth:v}=e;if(ue.is.ios===!0&&window.visualViewport!==void 0){const E=document.body.style,{offsetLeft:b,offsetTop:y}=window.visualViewport;b!==ne&&(E.setProperty("--q-pe-left",b+"px"),ne=b),y!==oe&&(E.setProperty("--q-pe-top",y+"px"),oe=y)}const{scrollLeft:x,scrollTop:a}=o,f=s===void 0?at(i,u===!0?[0,0]:n):rt(i,s,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:v,maxHeight:h,visibility:"visible"});const{offsetWidth:H,offsetHeight:q}=o,{elWidth:M,elHeight:A}=d===!0||u===!0?{elWidth:Math.max(f.width,H),elHeight:u===!0?Math.max(f.height,q):q}:{elWidth:H,elHeight:q};let m={maxWidth:v,maxHeight:h};(d===!0||u===!0)&&(m.minWidth=f.width+"px",u===!0&&(m.minHeight=f.height+"px")),Object.assign(o.style,m);const p=st(M,A);let g=ae(f,p,c,l);if(s===void 0||n===void 0)$(g,f,p,c,l);else{const{top:E,left:b}=g;$(g,f,p,c,l);let y=!1;if(g.top!==E){y=!0;const w=2*n[1];f.center=f.top-=w,f.bottom-=w+2}if(g.left!==b){y=!0;const w=2*n[0];f.middle=f.left-=w,f.right-=w+2}y===!0&&(g=ae(f,p,c,l),$(g,f,p,c,l))}m={top:g.top+"px",left:g.left+"px"},g.maxHeight!==void 0&&(m.maxHeight=g.maxHeight+"px",f.height>g.maxHeight&&(m.minHeight=m.maxHeight)),g.maxWidth!==void 0&&(m.maxWidth=g.maxWidth+"px",f.width>g.maxWidth&&(m.minWidth=m.maxWidth)),Object.assign(o.style,m),o.scrollTop!==a&&(o.scrollTop=a),o.scrollLeft!==x&&(o.scrollLeft=x)}function $(e,t,o,n,i){const c=o.bottom,l=o.right,s=ke(),d=window.innerHeight-s,u=document.body.clientWidth;if(e.top<0||e.top+c>d)if(i.vertical==="center")e.top=t[n.vertical]>d/2?Math.max(0,d-c):0,e.maxHeight=Math.min(c,d);else if(t[n.vertical]>d/2){const h=Math.min(d,n.vertical==="center"?t.center:n.vertical===i.vertical?t.bottom:t.top);e.maxHeight=Math.min(c,h),e.top=Math.max(0,h-c)}else e.top=Math.max(0,n.vertical==="center"?t.center:n.vertical===i.vertical?t.top:t.bottom),e.maxHeight=Math.min(c,d-e.top);if(e.left<0||e.left+l>u)if(e.maxWidth=Math.min(l,u),i.horizontal==="middle")e.left=t[n.horizontal]>u/2?Math.max(0,u-l):0;else if(t[n.horizontal]>u/2){const h=Math.min(u,n.horizontal==="middle"?t.middle:n.horizontal===i.horizontal?t.right:t.left);e.maxWidth=Math.min(l,h),e.left=Math.max(0,h-e.maxWidth)}else e.left=Math.max(0,n.horizontal==="middle"?t.middle:n.horizontal===i.horizontal?t.left:t.right),e.maxWidth=Math.min(l,u-e.left)}const mt=Ce({name:"QMenu",inheritAttrs:!1,props:{...tt,...We,...Be,...Pe,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:le},self:{type:String,validator:le},offset:{type:Array,validator:it},scrollTarget:Me,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...He,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let i=null,c,l,s;const d=se(),{proxy:u}=d,{$q:h}=u,v=P(null),x=P(!1),a=T(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),f=Ae(e,h),{registerTick:H,removeTick:q}=Ie(),{registerTimeout:M}=Le(),{transitionProps:A,transitionStyle:m}=ze(e),{localScrollTarget:p,changeScrollEvent:g,unconfigureScrollTarget:E}=ot(e,Y),{anchorEl:b,canShow:y}=nt({showing:x}),{hide:w}=Re({showing:x,canShow:y,handleShow:ve,handleHide:xe,hideOnRouteChange:a,processOnMount:!0}),{showPortal:O,hidePortal:j,renderPortal:de}=$e(d,v,ye,"menu"),I={anchorEl:b,innerRef:v,onClickOutside(r){if(e.persistent!==!0&&x.value===!0)return w(r),(r.type==="touchstart"||r.target.classList.contains("q-dialog__backdrop"))&&Je(r),!0}},N=T(()=>ie(e.anchor||(e.cover===!0?"center middle":"bottom start"),h.lang.rtl)),he=T(()=>e.cover===!0?N.value:ie(e.self||"top start",h.lang.rtl)),ge=T(()=>(e.square===!0?" q-menu--square":"")+(f.value===!0?" q-menu--dark q-dark":"")),me=T(()=>e.autoClose===!0?{onClick:be}:{}),Q=T(()=>x.value===!0&&e.persistent!==!0);_(Q,r=>{r===!0?(De(z),lt(I)):(Z(z),te(I))});function L(){Ge(()=>{let r=v.value;r&&r.contains(document.activeElement)!==!0&&(r=r.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||r.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||r.querySelector("[autofocus], [data-autofocus]")||r,r.focus({preventScroll:!0}))})}function ve(r){if(i=e.noRefocus===!1?document.activeElement:null,Fe(G),O(),Y(),c=void 0,r!==void 0&&(e.touchPosition||e.contextMenu)){const R=Ke(r);if(R.left!==void 0){const{top:pe,left:we}=b.value.getBoundingClientRect();c={left:R.left-we,top:R.top-pe}}}l===void 0&&(l=_(()=>h.screen.width+"|"+h.screen.height+"|"+e.self+"|"+e.anchor+"|"+h.lang.rtl,k)),e.noFocus!==!0&&document.activeElement.blur(),H(()=>{k(),e.noFocus!==!0&&L()}),M(()=>{h.platform.is.ios===!0&&(s=e.autoClose,v.value.click()),k(),O(!0),o("show",r)},e.transitionDuration)}function xe(r){q(),j(),V(!0),i!==null&&(r===void 0||r.qClickOutside!==!0)&&(((r?.type.indexOf("key")===0?i.closest('[tabindex]:not([tabindex^="-"])'):void 0)||i).focus(),i=null),M(()=>{j(!0),o("hide",r)},e.transitionDuration)}function V(r){c=void 0,l!==void 0&&(l(),l=void 0),(r===!0||x.value===!0)&&(Oe(G),E(),te(I),Z(z)),r!==!0&&(i=null)}function Y(){(b.value!==null||e.scrollTarget!==void 0)&&(p.value=je(b.value,e.scrollTarget),g(p.value,k))}function be(r){s!==!0?(Ne(u,r),o("click",r)):s=!1}function G(r){Q.value===!0&&e.noFocus!==!0&&Qe(v.value,r.target)!==!0&&L()}function z(r){e.noEscDismiss!==!0&&(o("escapeKey"),w(r))}function k(){ce({targetEl:v.value,offset:e.offset,anchorEl:b.value,anchorOrigin:N.value,selfOrigin:he.value,absoluteOffset:c,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function ye(){return ee(Ye,A.value,()=>x.value===!0?ee("div",{role:"menu",...n,ref:v,tabindex:-1,class:["q-menu q-position-engine scroll"+ge.value,n.class],style:[n.style,m.value],...me.value},Ve(t.default)):null)}return K(V),Object.assign(u,{focus:L,updatePosition:k}),de}}),re=["B","KB","MB","GB","TB","PB"];function vt(e,t=1){let o=0;for(;parseInt(e,10)>=1024&&o<re.length-1;)e/=1024,++o;return`${e.toFixed(t)}${re[o]}`}function xt(e,t,o){return o<=t?t:Math.min(o,Math.max(t,e))}function bt(e,t,o){if(o<=t)return t;const n=o-t+1;let i=t+(e-t)%n;return i<t&&(i=n+i),i===0?0:i}function ut(e){return Xe(e)===!0?"__q_date|"+e.getTime():Ue(e)===!0?"__q_expr|"+e.source:typeof e=="number"?"__q_numb|"+e:typeof e=="boolean"?"__q_bool|"+(e?"1":"0"):typeof e=="string"?"__q_strn|"+e:typeof e=="function"?"__q_strn|"+e.toString():e===Object(e)?"__q_objt|"+JSON.stringify(e):e}function ct(e){if(e.length<9)return e;const o=e.substring(0,8),n=e.substring(9);switch(o){case"__q_date":const i=Number(n);return new Date(Number.isNaN(i)===!0?n:i);case"__q_expr":return new RegExp(n);case"__q_numb":return Number(n);case"__q_bool":return n==="1";case"__q_strn":return""+n;case"__q_objt":return JSON.parse(n);default:return e}}function ft(){const e=()=>null;return{has:()=>!1,hasItem:()=>!1,getLength:()=>0,getItem:e,getIndex:e,getKey:e,getAll:()=>{},getAllKeys:()=>[],set:C,setItem:C,remove:C,removeItem:C,clear:C,isEmpty:()=>!0}}function dt(e){const t=window[e+"Storage"],o=l=>{const s=t.getItem(l);return s?ct(s):null},n=l=>t.getItem(l)!==null,i=(l,s)=>{t.setItem(l,ut(s))},c=l=>{t.removeItem(l)};return{has:n,hasItem:n,getLength:()=>t.length,getItem:o,getIndex:l=>l<t.length?o(t.key(l)):null,getKey:l=>l<t.length?t.key(l):null,getAll:()=>{let l;const s={},d=t.length;for(let u=0;u<d;u++)l=t.key(u),s[l]=o(l);return s},getAllKeys:()=>{const l=[],s=t.length;for(let d=0;d<s;d++)l.push(t.key(d));return l},set:i,setItem:i,remove:c,removeItem:c,clear:()=>{t.clear()},isEmpty:()=>t.length===0}}const fe=ue.has.webStorage===!1?ft():dt("local"),ht={install({$q:e}){e.localStorage=fe}};Object.assign(ht,fe);export{ht as P,mt as Q,le as a,xt as b,Ze as c,ot as d,nt as e,lt as f,vt as h,bt as n,ie as p,te as r,ce as s,et as u,it as v};