it-tools/dist/client/assets/chunks/chunk-3a3ddd48.js

2 lines
2.2 KiB
JavaScript
Raw Normal View History

2024-04-28 00:48:29 +08:00
import{b}from"./chunk-a740628f.js";import{j as r,D as a,E as c,d as g,r as k,c as P,k as B,l as L,m as t,q as n,S as U,U as m,F as p,_ as C}from"./chunk-449c23a2.js";import{_ as E}from"./chunk-6deddc2e.js";import{_ as s}from"./chunk-3fb34e39.js";import{i as R}from"./chunk-c7e7c785.js";import{w as V}from"./chunk-4d6daddf.js";import{_ as j}from"./chunk-b6d0d6dd.js";import"./chunk-9a43cce8.js";import"./chunk-340feaf0.js";import"./chunk-3db18d93.js";import"./chunk-767079b6.js";import"../entries/src_pages_Home.page.16dc467b.js";import"./chunk-cf010ec4.js";import"./chunk-ee54c1e8.js";import"./chunk-fd51fbd2.js";const N={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},O=c("path",{fill:"currentColor",d:"m20 16l-5.5 5.5l-1.42-1.41L16.17 17H10.5A6.5 6.5 0 0 1 4 10.5V4h2v6.5C6 13 8 15 10.5 15h5.67l-3.08-3.09l1.41-1.41L20 16Z"},null,-1),$=[O];function D(d,o){return r(),a("svg",N,$)}const F={name:"mdi-arrow-right-bottom",render:D},H={style:{flex:"1 0 110px"}},I=g({__name:"url-parser",setup(d){const o=k("https://me:pwd@it-tools.tech:3000/url-parser?key1=value&key2=value2#the-hash"),i=P(()=>V(()=>new URL(o.value),void 0)),h=[{validator:_=>R(()=>new URL(_)),message:"Invalid url"}],v=[{title:"Protocol",key:"protocol"},{title:"Username",key:"username"},{title:"Password",key:"password"},{title:"Hostname",key:"hostname"},{title:"Port",key:"port"},{title:"Path",key:"pathname"},{title:"Params",key:"search"}];return(_,u)=>{const f=E,w=j,y=F,x=b;return r(),B(x,null,{default:L(()=>[t(f,{value:n(o),"onUpdate:value":u[0]||(u[0]=e=>U(o)?o.value=e:null),label:"Your url to parse:",placeholder:"Your url to parse...","raw-text":"","validation-rules":h},null,8,["value"]),t(w),(r(),a(p,null,m(v,({title:e,key:l})=>t(s,{key:l,label:e,value:n(i)?.[l]??"",readonly:"","label-position":"left","label-width":"110px","mb-2":"",placeholder:" "},null,8,["label","value"])),64)),(r(!0),a(p,null,m(Object.entries(Object.fromEntries(n(i)?.searchParams.entries()??[])),([e,l])=>(r(),a("div",{key:e,"mb-2":"","w-full":"",flex:""},[c("div",H,[t(y)]),t(s,{value:e,readonly:""},null,8,["value"]),t(s,{value:l,readonly:""},null,8,["value"])]))),128))]),_:1})}}});const te=C(I,[["__scopeId","data-v-98d1859c"]]);export{te as default};