pdap-design-system 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -18
- package/bin/pdap-design-system-cli.js +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +690 -666
- package/dist/styles.css +1 -1
- package/package.json +9 -4
- package/docs/CONTRIBUTING.md +0 -65
package/README.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
-
# Design System
|
1
|
+
# PDAP Design System
|
2
|
+
_A `Vue` component library, styling system, and image asset repository for PDAP-branded client apps._
|
3
|
+
|
4
|
+
[](https://www.npmjs.com/package/pdap-design-system)
|
5
|
+

|
6
|
+

|
7
|
+

|
8
|
+
|
9
|
+
|
10
|
+
[](https://discord.gg/vKhDv7nC8B)
|
2
11
|
|
3
|
-
This is a `Vue` component library, styling system, and image asset repository for PDAP-branded client apps.
|
4
12
|
|
5
13
|
## Usage
|
6
14
|
|
@@ -43,7 +51,7 @@ module.exports = {
|
|
43
51
|
|
44
52
|
```
|
45
53
|
|
46
|
-
5. If
|
54
|
+
5. If the project is using `TypeScript`, the component props definitions and other types are exposed for import as well.
|
47
55
|
_n.b. This can be particularly useful for composing `Form` schemas, where `Input` schema objects are defined differently depending on the `type` of input desired._
|
48
56
|
|
49
57
|
```
|
@@ -54,7 +62,7 @@ import { PdapInputTypes } from 'pdap-design-system';
|
|
54
62
|
|
55
63
|
### About images
|
56
64
|
|
57
|
-
PDAP image assets contained in this repo are built to the `/dist`
|
65
|
+
PDAP image assets contained in this repo are built to the `/dist` directory. For convenience an importing alias `/images` has been added.
|
58
66
|
|
59
67
|
```
|
60
68
|
import 'pdap-design-system/images/acronym.svg';
|
@@ -68,7 +76,7 @@ import `pdap-design-system/images`;
|
|
68
76
|
|
69
77
|
### Using the CLI to copy assets to your local project directory
|
70
78
|
|
71
|
-
If you want either styles or images copied to a local
|
79
|
+
If you want either styles or images copied to a local directory, you can do so from the root directory of your project.
|
72
80
|
|
73
81
|
Assets can be copied using the `pdap-design-system` command line method exposed by this package.
|
74
82
|
|
@@ -92,16 +100,16 @@ The following argument is optional:
|
|
92
100
|
gh repo clone Police-Data-Accessibility-Project/design-system
|
93
101
|
```
|
94
102
|
|
95
|
-
2. CD into the project
|
103
|
+
2. CD into the project directory and install dependencies
|
96
104
|
|
97
105
|
```
|
98
106
|
cd design-system
|
99
107
|
npm i
|
100
108
|
```
|
101
109
|
|
102
|
-
3. Step 2 should result in the `build` script being run after packages are installed. Check the `dist`
|
110
|
+
3. Step 2 should result in the `build` script being run after packages are installed. Check the `dist` directory for changes. You then may want to take one or both of the following steps:
|
103
111
|
|
104
|
-
- If `build` wasn't called when you installed deps, build styles and images to the `dist`
|
112
|
+
- If `build` wasn't called when you installed deps, build styles and images to the `dist` directory:
|
105
113
|
|
106
114
|
```
|
107
115
|
npm run build
|
@@ -115,7 +123,7 @@ npm run build:watch
|
|
115
123
|
|
116
124
|
4. If you use VS Code as your editor, you may want to install the [tailwind VS Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss), which helps with intellisense and the custom at-rules used by TailwindCSS.
|
117
125
|
|
118
|
-
5. Read the [contributing guide](./
|
126
|
+
5. Read the [contributing guide](./CONTRIBUTING.md) for development requirements and tips.
|
119
127
|
|
120
128
|
## Assets
|
121
129
|
|
@@ -129,16 +137,18 @@ Use this [terminology](https://docs.pdap.io/activities/terms-and-definitions).
|
|
129
137
|
| `_commit` | Create conventional commits |
|
130
138
|
| `build` | Builds the library |
|
131
139
|
| `build:watch` | Builds the library and watches for file changes |
|
132
|
-
| `ci` |
|
133
|
-
| `clean` |
|
134
|
-
| `clean:deps` |
|
135
|
-
| `clean:build` |
|
136
|
-
| `clean:test` |
|
137
|
-
| `lint` |
|
140
|
+
| `ci` | Remove all generated files and re-installs deps |
|
141
|
+
| `clean` | Remove all generated files (except `package-lock.json`) |
|
142
|
+
| `clean:deps` | Remove node_modules directory |
|
143
|
+
| `clean:build` | Remove dist directory |
|
144
|
+
| `clean:test` | Remove testing coverage reports |
|
145
|
+
| `lint` | Lint everything |
|
138
146
|
| `lint:es` | Lint `ts` and `vue` with `eslint` |
|
139
147
|
| `lint:css` | Lint `css` and `vue` with `stylelint` |
|
140
148
|
| `lint:ts` | Lint `ts` with `tsc` |
|
141
|
-
| `test` |
|
142
|
-
| `test:changed` |
|
143
|
-
| `typecheck` |
|
149
|
+
| `test` | Run all test suites |
|
150
|
+
| `test:changed` | Run only test suites affected by changed files |
|
151
|
+
| `typecheck` | Run type check on all `ts` and `vue` files |
|
152
|
+
|
153
|
+
|
144
154
|
_n.b. There are some other scripts defined in the `package.json` `"scripts"` field, but they are mostly for CI or cleanup post-build, etc. You shouldn't need them._
|
package/dist/index.cjs
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),U=require("vue-router"),ce=e.defineComponent({__name:"PdapButton",props:{intent:{default:"primary"},isLoading:{type:Boolean,default:!1}},setup(t){const r=t,n=e.reactive({"pdap-button":!0,[`pdap-button-${r.intent}`]:!!r.intent,"pdap-button-loading":r.isLoading});return(a,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(n)},[e.renderSlot(a.$slots,"default")],2))}});const X=e.defineComponent({__name:"FlexContainer",props:{alignment:{default:"start"},component:{default:"div"}},setup(t){const r=t,n=e.reactive({"pdap-flex-container":!0,[`pdap-flex-container-${r.alignment}`]:!0});return(a,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component),{class:e.normalizeClass(n)},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["class"]))}});const ke={class:"pdap-footer"},Re={class:"pdap-footer-social-links"},Oe=["href"],Ve=e.createElementVNode("p",{class:"pdap-footer-copyright"},[e.createTextVNode(" © 2023 Police Data Accessibility Project"),e.createElementVNode("br")],-1),Be=e.createElementVNode("p",{class:"pdap-footer-copyright"},[e.createTextVNode(" PDAP is a non-profit. EIN: 85-4207132. "),e.createElementVNode("a",{href:"https://docs.pdap.io/meta/policy/pdap-privacy-policy",alt:"Privacy Policy"}," Privacy Policy"),e.createTextVNode(". "),e.createElementVNode("a",{href:"mailto:contact@pdap.io"},"contact@pdap.io")],-1),je={class:"pdap-footer-widget-links"},Te=e.createElementVNode("a",{href:"https://www.guidestar.org/profile/85-4207132",target:"_blank"},[e.createElementVNode("img",{src:"https://widgets.guidestar.org/gximage2?o=9973356&l=v4"})],-1),Se=["href"],Ae=["src"],Ne=["src"],Le=e.defineComponent({__name:"PdapFooter",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/acronym.svg"},logoImageAnchorPath:{default:"/"}},setup(t){const r=t,n=e.inject("footerLinks",[{href:"https://github.com/orgs/Police-Data-Accessibility-Project",text:"Github"},{href:"https://discord.gg/wMqex8nKZJ",text:"Discord"},{href:"https://www.linkedin.com/company/pdap",text:"LinkedIn"},{path:"/jobs",text:"Jobs"}]),a=r.logoImageAnchorPath.startsWith("/");return(o,s)=>{const c=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("footer",ke,[e.createVNode(X,{alignment:"center"},{default:e.withCtx(()=>[e.createElementVNode("ul",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),i=>(e.openBlock(),e.createElementBlock("li",{key:i.text,class:"pdap-footer-link-container"},[i.href?(e.openBlock(),e.createElementBlock("a",{key:0,class:"pdap-footer-social-link",href:i.href,target:"_blank",referrerpolicy:"no-referrer"},e.toDisplayString(i.text),9,Oe)):e.createCommentVNode("",!0),i.path?(e.openBlock(),e.createBlock(c,{key:1,"active-class":"pdap-footer-social-link-current","exact-active-class":"pdap-footer-social-link-current-exact",class:"pdap-footer-social-link",to:i.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.text),1)]),_:2},1032,["to"])):e.createCommentVNode("",!0)]))),128))]),Ve,Be,e.createElementVNode("div",je,[Te,e.unref(a)?(e.openBlock(),e.createBlock(c,{key:1,to:o.logoImageAnchorPath,class:"pdap-footer-logo"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ne)]),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:0,href:o.logoImageAnchorPath,class:"pdap-footer-logo"},[e.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ae)],8,Se))])]),_:1})])}}});function Y(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function P(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Y(Object(n),!0).forEach(function(a){Ie(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Ie(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function ee(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(t).reduce((n,a)=>(r.includes(a)||(n[a]=e.unref(t[a])),n),{})}function L(t){return typeof t=="function"}function ze(t){return e.isReactive(t)||e.isReadonly(t)}function ue(t,r,n){let a=t;const o=r.split(".");for(let s=0;s<o.length;s++){if(!a[o[s]])return n;a=a[o[s]]}return a}function H(t,r,n){return e.computed(()=>t.some(a=>ue(r,a,{[n]:!1})[n]))}function te(t,r,n){return e.computed(()=>t.reduce((a,o)=>{const s=ue(r,o,{[n]:!1})[n]||[];return a.concat(s)},[]))}function de(t,r,n,a){return t.call(a,e.unref(r),e.unref(n),a)}function me(t){return t.$valid!==void 0?!t.$valid:!t}function De(t,r,n,a,o,s,c){let{$lazy:i,$rewardEarly:u}=o,d=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],m=arguments.length>8?arguments[8]:void 0,f=arguments.length>9?arguments[9]:void 0,$=arguments.length>10?arguments[10]:void 0;const h=e.ref(!!a.value),l=e.ref(0);n.value=!1;const p=e.watch([r,a].concat(d,$),()=>{if(i&&!a.value||u&&!f.value&&!n.value)return;let g;try{g=de(t,r,m,c)}catch(v){g=Promise.reject(v)}l.value++,n.value=!!l.value,h.value=!1,Promise.resolve(g).then(v=>{l.value--,n.value=!!l.value,s.value=v,h.value=me(v)}).catch(v=>{l.value--,n.value=!!l.value,s.value=v,h.value=!0})},{immediate:!0,deep:typeof r=="object"});return{$invalid:h,$unwatch:p}}function Me(t,r,n,a,o,s,c,i){let{$lazy:u,$rewardEarly:d}=a;const m=()=>({}),f=e.computed(()=>{if(u&&!n.value||d&&!i.value)return!1;let $=!0;try{const h=de(t,r,c,s);o.value=h,$=me(h)}catch(h){o.value=h}return $});return{$unwatch:m,$invalid:f}}function Fe(t,r,n,a,o,s,c,i,u,d,m){const f=e.ref(!1),$=t.$params||{},h=e.ref(null);let l,p;t.$async?{$invalid:l,$unwatch:p}=De(t.$validator,r,f,n,a,h,o,t.$watchTargets,u,d,m):{$invalid:l,$unwatch:p}=Me(t.$validator,r,n,a,h,o,u,d);const g=t.$message;return{$message:L(g)?e.computed(()=>g(ee({$pending:f,$invalid:l,$params:ee($),$model:r,$response:h,$validator:s,$propertyPath:i,$property:c}))):g||"",$params:$,$pending:f,$invalid:l,$response:h,$unwatch:p}}function qe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=e.unref(t),n=Object.keys(r),a={},o={},s={};let c=null;return n.forEach(i=>{const u=r[i];switch(!0){case L(u.$validator):a[i]=u;break;case L(u):a[i]={$validator:u};break;case i==="$validationGroups":c=u;break;case i.startsWith("$"):s[i]=u;break;default:o[i]=u}}),{rules:a,nestedValidators:o,config:s,validationGroups:c}}const He="__root";function Ge(t,r,n,a,o,s,c,i,u){const d=Object.keys(t),m=a.get(o,t),f=e.ref(!1),$=e.ref(!1),h=e.ref(0);if(m){if(!m.$partial)return m;m.$unwatch(),f.value=m.$dirty.value}const l={$dirty:f,$path:o,$touch:()=>{f.value||(f.value=!0)},$reset:()=>{f.value&&(f.value=!1)},$commit:()=>{}};return d.length?(d.forEach(p=>{l[p]=Fe(t[p],r,l.$dirty,s,c,p,n,o,u,$,h)}),l.$externalResults=e.computed(()=>i.value?[].concat(i.value).map((p,g)=>({$propertyPath:o,$property:n,$validator:"$externalResults",$uid:`${o}-externalResult-${g}`,$message:p,$params:{},$response:null,$pending:!1})):[]),l.$invalid=e.computed(()=>{const p=d.some(g=>e.unref(l[g].$invalid));return $.value=p,!!l.$externalResults.value.length||p}),l.$pending=e.computed(()=>d.some(p=>e.unref(l[p].$pending))),l.$error=e.computed(()=>l.$dirty.value?l.$pending.value||l.$invalid.value:!1),l.$silentErrors=e.computed(()=>d.filter(p=>e.unref(l[p].$invalid)).map(p=>{const g=l[p];return e.reactive({$propertyPath:o,$property:n,$validator:p,$uid:`${o}-${p}`,$message:g.$message,$params:g.$params,$response:g.$response,$pending:g.$pending})}).concat(l.$externalResults.value)),l.$errors=e.computed(()=>l.$dirty.value?l.$silentErrors.value:[]),l.$unwatch=()=>d.forEach(p=>{l[p].$unwatch()}),l.$commit=()=>{$.value=!0,h.value=Date.now()},a.set(o,t,l),l):(m&&a.set(o,t,l),l)}function Ue(t,r,n,a,o,s,c){const i=Object.keys(t);return i.length?i.reduce((u,d)=>(u[d]=G({validations:t[d],state:r,key:d,parentKey:n,resultsCache:a,globalConfig:o,instance:s,externalResults:c}),u),{}):{}}function Xe(t,r,n){const a=e.computed(()=>[r,n].filter(l=>l).reduce((l,p)=>l.concat(Object.values(e.unref(p))),[])),o=e.computed({get(){return t.$dirty.value||(a.value.length?a.value.every(l=>l.$dirty):!1)},set(l){t.$dirty.value=l}}),s=e.computed(()=>{const l=e.unref(t.$silentErrors)||[],p=a.value.filter(g=>(e.unref(g).$silentErrors||[]).length).reduce((g,v)=>g.concat(...v.$silentErrors),[]);return l.concat(p)}),c=e.computed(()=>{const l=e.unref(t.$errors)||[],p=a.value.filter(g=>(e.unref(g).$errors||[]).length).reduce((g,v)=>g.concat(...v.$errors),[]);return l.concat(p)}),i=e.computed(()=>a.value.some(l=>l.$invalid)||e.unref(t.$invalid)||!1),u=e.computed(()=>a.value.some(l=>e.unref(l.$pending))||e.unref(t.$pending)||!1),d=e.computed(()=>a.value.some(l=>l.$dirty)||a.value.some(l=>l.$anyDirty)||o.value),m=e.computed(()=>o.value?u.value||i.value:!1),f=()=>{t.$touch(),a.value.forEach(l=>{l.$touch()})},$=()=>{t.$commit(),a.value.forEach(l=>{l.$commit()})},h=()=>{t.$reset(),a.value.forEach(l=>{l.$reset()})};return a.value.length&&a.value.every(l=>l.$dirty)&&f(),{$dirty:o,$errors:c,$invalid:i,$anyDirty:d,$error:m,$pending:u,$touch:f,$reset:h,$silentErrors:s,$commit:$}}function G(t){let{validations:r,state:n,key:a,parentKey:o,childResults:s,resultsCache:c,globalConfig:i={},instance:u,externalResults:d}=t;const m=o?`${o}.${a}`:a,{rules:f,nestedValidators:$,config:h,validationGroups:l}=qe(r),p=P(P({},i),h),g=a?e.computed(()=>{const y=e.unref(n);return y?e.unref(y[a]):void 0}):n,v=P({},e.unref(d)||{}),B=e.computed(()=>{const y=e.unref(d);return a?y?e.unref(y[a]):void 0:y}),D=Ge(f,g,a,c,m,p,u,B,n),b=Ue($,g,m,c,p,u,B),R={};l&&Object.entries(l).forEach(y=>{let[O,E]=y;R[O]={$invalid:H(E,b,"$invalid"),$error:H(E,b,"$error"),$pending:H(E,b,"$pending"),$errors:te(E,b,"$errors"),$silentErrors:te(E,b,"$silentErrors")}});const{$dirty:x,$errors:A,$invalid:M,$anyDirty:ye,$error:_e,$pending:F,$touch:q,$reset:be,$silentErrors:we,$commit:J}=Xe(D,b,s),xe=a?e.computed({get:()=>e.unref(g),set:y=>{x.value=!0;const O=e.unref(n),E=e.unref(d);E&&(E[a]=v[a]),e.isRef(O[a])?O[a].value=y:O[a]=y}}):null;a&&p.$autoDirty&&e.watch(g,()=>{x.value||q();const y=e.unref(d);y&&(y[a]=v[a])},{flush:"sync"});async function Ee(){return q(),p.$rewardEarly&&(J(),await e.nextTick()),await e.nextTick(),new Promise(y=>{if(!F.value)return y(!M.value);const O=e.watch(F,()=>{y(!M.value),O()})})}function Pe(y){return(s.value||{})[y]}function Ce(){e.isRef(d)?d.value=v:Object.keys(v).length===0?Object.keys(d).forEach(y=>{delete d[y]}):Object.assign(d,v)}return e.reactive(P(P(P({},D),{},{$model:xe,$dirty:x,$error:_e,$errors:A,$invalid:M,$anyDirty:ye,$pending:F,$touch:q,$reset:be,$path:m||He,$silentErrors:we,$validate:Ee,$commit:J},s&&{$getResultsForChild:Pe,$clearExternalResults:Ce,$validationGroups:R}),b))}class We{constructor(){this.storage=new Map}set(r,n,a){this.storage.set(r,{rules:n,result:a})}checkRulesValidity(r,n,a){const o=Object.keys(a),s=Object.keys(n);return s.length!==o.length||!s.every(i=>o.includes(i))?!1:s.every(i=>n[i].$params?Object.keys(n[i].$params).every(u=>e.unref(a[i].$params[u])===e.unref(n[i].$params[u])):!0)}get(r,n){const a=this.storage.get(r);if(!a)return;const{rules:o,result:s}=a,c=this.checkRulesValidity(r,n,o),i=s.$unwatch?s.$unwatch:()=>({});return c?s:{$dirty:s.$dirty,$partial:!0,$unwatch:i}}}const N={COLLECT_ALL:!0,COLLECT_NONE:!1},re=Symbol("vuelidate#injectChildResults"),ne=Symbol("vuelidate#removeChildResults");function Ke(t){let{$scope:r,instance:n}=t;const a={},o=e.ref([]),s=e.computed(()=>o.value.reduce((m,f)=>(m[f]=e.unref(a[f]),m),{}));function c(m,f){let{$registerAs:$,$scope:h,$stopPropagation:l}=f;l||r===N.COLLECT_NONE||h===N.COLLECT_NONE||r!==N.COLLECT_ALL&&r!==h||(a[$]=m,o.value.push($))}n.__vuelidateInjectInstances=[].concat(n.__vuelidateInjectInstances||[],c);function i(m){o.value=o.value.filter(f=>f!==m),delete a[m]}n.__vuelidateRemoveInstances=[].concat(n.__vuelidateRemoveInstances||[],i);const u=e.inject(re,[]);e.provide(re,n.__vuelidateInjectInstances);const d=e.inject(ne,[]);return e.provide(ne,n.__vuelidateRemoveInstances),{childResults:s,sendValidationResultsToParent:u,removeValidationResultsFromParent:d}}function pe(t){return new Proxy(t,{get(r,n){return typeof r[n]=="object"?pe(r[n]):e.computed(()=>r[n])}})}let ae=0;function Qe(t,r){var n;let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(a=t,t=void 0,r=void 0);let{$registerAs:o,$scope:s=N.COLLECT_ALL,$stopPropagation:c,$externalResults:i,currentVueInstance:u}=a;const d=u||((n=e.getCurrentInstance())===null||n===void 0?void 0:n.proxy),m=d?d.$options:{};o||(ae+=1,o=`_vuelidate_${ae}`);const f=e.ref({}),$=new We,{childResults:h,sendValidationResultsToParent:l,removeValidationResultsFromParent:p}=d?Ke({$scope:s,instance:d}):{childResults:e.ref({})};if(!t&&m.validations){const g=m.validations;r=e.ref({}),e.onBeforeMount(()=>{r.value=d,e.watch(()=>L(g)?g.call(r.value,new pe(r.value)):g,v=>{f.value=G({validations:v,state:r,childResults:h,resultsCache:$,globalConfig:a,instance:d,externalResults:i||d.vuelidateExternalResults})},{immediate:!0})}),a=m.validationsConfig||a}else{const g=e.isRef(t)||ze(t)?t:e.reactive(t||{});e.watch(g,v=>{f.value=G({validations:v,state:r,childResults:h,resultsCache:$,globalConfig:a,instance:d??{},externalResults:i})},{immediate:!0})}return d&&(l.forEach(g=>g(f,{$registerAs:o,$scope:s,$stopPropagation:c})),e.onBeforeUnmount(()=>p.forEach(g=>g(o)))),e.computed(()=>P(P({},e.unref(f.value)),h.value))}var w=(t=>(t.CHECKBOX="checkbox",t.TEXT="text",t))(w||{});const Ze=["id","name","placeholder","value"],Je=["id","name","checked","value"],Ye=["id"],et=["for"],fe=e.defineComponent({__name:"PdapInput",props:{error:{},id:{},label:{},name:{},placeholder:{},type:{},value:{},defaultChecked:{type:Boolean}},emits:["change","input"],setup(t,{emit:r}){const n=t,a=r,o=()=>{c.value=!c.value,a("change",c.value.toString())},s=u=>{a("input",u.target.value)},c=e.ref(n.defaultChecked),i=e.computed(()=>`pdap-${n.name}-input-error`);return(u,d)=>{var m;return e.openBlock(),e.createBlock(e.unref(he),{class:e.normalizeClass({"pdap-input":!0,"pdap-input-error":Number((m=u.error)==null?void 0:m.length)>=1})},{default:e.withCtx(()=>[u.type===e.unref(w).TEXT?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,id:u.id,type:"text",name:u.name,placeholder:u.placeholder,value:u.value},u.$attrs,{onInput:s}),null,16,Ze)):u.type===e.unref(w).CHECKBOX?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,id:u.id,class:"pdap-input-checkbox",name:u.name,checked:c.value,type:"checkbox",value:u.value},u.$attrs,{onChange:o}),null,16,Je)):e.createCommentVNode("",!0),u.error?(e.openBlock(),e.createElementBlock("div",{key:2,id:i.value,class:"pdap-input-error-message"},e.toDisplayString(u.error),9,Ye)):e.createCommentVNode("",!0),e.createElementVNode("label",{class:"pdap-input-label",for:u.id},e.toDisplayString(u.label),9,et)]),_:1},8,["class"])}}});function oe(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function j(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?oe(Object(n),!0).forEach(function(a){tt(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function tt(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function T(t){return typeof t=="function"}function I(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function z(t){return T(t.$validator)?j({},t):{$validator:t}}function rt(t){return I(t)&&T(t.then)}function C(t){return typeof t=="object"?t.$valid:t}function V(t){return t.$validator||t}function W(t,r){if(!I(t))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof t}`);if(!I(r)&&!T(r))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=z(r);return n.$params=j(j({},n.$params||{}),t),n}function S(t,r){if(!T(t)&&typeof e.unref(t)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof t}`);if(!I(r)&&!T(r))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=z(r);return n.$message=t,n}function nt(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=z(t);return j(j({},n),{},{$async:!0,$watchTargets:r})}function at(t){return{$validator(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];return e.unref(r).reduce((s,c,i)=>{const u=Object.entries(c).reduce((d,m)=>{let[f,$]=m;const h=t[f]||{},l=Object.entries(h).reduce((p,g)=>{let[v,B]=g;const b=V(B).call(this,$,c,i,...a),R=C(b);if(p.$data[v]=b,p.$data.$invalid=!R||!!p.$data.$invalid,p.$data.$error=p.$data.$invalid,!R){let x=B.$message||"";const A=B.$params||{};typeof x=="function"&&(x=x({$pending:!1,$invalid:!R,$params:A,$model:$,$response:b})),p.$errors.push({$property:f,$message:x,$params:A,$response:b,$model:$,$pending:!1,$validator:v})}return{$valid:p.$valid&&R,$data:p.$data,$errors:p.$errors}},{$valid:!0,$data:{},$errors:[]});return d.$data[f]=l.$data,d.$errors[f]=l.$errors,{$valid:d.$valid&&l.$valid,$data:d.$data,$errors:d.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:s.$valid&&u.$valid,$data:s.$data.concat(u.$data),$errors:s.$errors.concat(u.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:r=>{let{$response:n}=r;return n?n.$errors.map(a=>Object.values(a).map(o=>o.map(s=>s.$message)).reduce((o,s)=>o.concat(s),[])):[]}}}const _=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(t==null)return!1;if(t===!1)return!0;if(t instanceof Date)return!isNaN(t.getTime());if(typeof t=="object"){for(let r in t)return!0;return!1}return!!String(t).length},K=t=>(t=e.unref(t),Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:String(t).length);function k(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return a=>(a=e.unref(a),!_(a)||r.every(o=>(o.lastIndex=0,o.test(a))))}var Q=Object.freeze({__proto__:null,forEach:at,len:K,normalizeValidatorObject:z,regex:k,req:_,unwrap:e.unref,unwrapNormalizedValidator:V,unwrapValidatorResponse:C,withAsync:nt,withMessage:S,withParams:W}),ot=k(/^[a-zA-Z]*$/),st={$validator:ot,$message:"The value is not alphabetical",$params:{type:"alpha"}},lt=k(/^[a-zA-Z0-9]*$/),it={$validator:lt,$message:"The value must be alpha-numeric",$params:{type:"alphaNum"}},ct=k(/^\d*(\.\d+)?$/),ut={$validator:ct,$message:"Value must be numeric",$params:{type:"numeric"}};function dt(t,r){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+e.unref(t)<=+n&&+e.unref(r)>=+n}function mt(t,r){return{$validator:dt(t,r),$message:n=>{let{$params:a}=n;return`The value must be between ${a.min} and ${a.max}`},$params:{min:t,max:r,type:"between"}}}const pt=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;var ft=k(pt),gt={$validator:ft,$message:"Value is not a valid email address",$params:{type:"email"}};function $t(t){if(!_(t))return!0;if(typeof t!="string")return!1;const r=t.split(".");return r.length===4&&r.every(ht)}const ht=t=>{if(t.length>3||t.length===0||t[0]==="0"&&t!=="0"||!t.match(/^\d+$/))return!1;const r=+t|0;return r>=0&&r<=255};var vt={$validator:$t,$message:"The value is not a valid IP address",$params:{type:"ipAddress"}};function yt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return r=>{if(t=e.unref(t),!_(r))return!0;if(typeof r!="string")return!1;const n=typeof t=="string"&&t!==""?r.split(t):r.length===12||r.length===16?r.match(/.{2}/g):null;return n!==null&&(n.length===6||n.length===8)&&n.every(_t)}}const _t=t=>t.toLowerCase().match(/^[0-9a-f]{2}$/);function bt(t){return{$validator:yt(t),$message:"The value is not a valid MAC Address",$params:{type:"macAddress"}}}function wt(t){return r=>!_(r)||K(r)<=e.unref(t)}function xt(t){return{$validator:wt(t),$message:r=>{let{$params:n}=r;return`The maximum length allowed is ${n.max}`},$params:{max:t,type:"maxLength"}}}function Et(t){return r=>!_(r)||K(r)>=e.unref(t)}function Pt(t){return{$validator:Et(t),$message:r=>{let{$params:n}=r;return`This field should be at least ${n.min} characters long`},$params:{min:t,type:"minLength"}}}function Ct(t){return typeof t=="string"&&(t=t.trim()),_(t)}var Z={$validator:Ct,$message:"Value is required",$params:{type:"required"}};const se=(t,r)=>t?_(typeof r=="string"?r.trim():r):!0;function kt(t){return function(r,n){if(typeof t!="function")return se(e.unref(t),r);const a=t.call(this,r,n);return se(a,r)}}function Rt(t){return{$validator:kt(t),$message:"The value is required",$params:{type:"requiredIf",prop:t}}}const le=(t,r)=>t?!0:_(typeof r=="string"?r.trim():r);function Ot(t){return function(r,n){if(typeof t!="function")return le(e.unref(t),r);const a=t.call(this,r,n);return le(a,r)}}function Vt(t){return{$validator:Ot(t),$message:"The value is required",$params:{type:"requiredUnless",prop:t}}}function Bt(t){return r=>e.unref(r)===e.unref(t)}function jt(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"other";return{$validator:Bt(t),$message:n=>`The value must be equal to the ${r} value`,$params:{equalTo:t,otherName:r,type:"sameAs"}}}const Tt=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;var St=k(Tt),At={$validator:St,$message:"The value is not a valid URL address",$params:{type:"url"}};function Nt(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce((o,s)=>C(o)?o:V(s).apply(this,n),!1)}}function Lt(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce(async(o,s)=>{const c=await o;return C(c)?c:V(s).apply(this,n)},Promise.resolve(!1))}}function It(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const a=r.some(c=>c.$async),o=r.reduce((c,i)=>i.$watchTargets?c.concat(i.$watchTargets):c,[]);let s=()=>!1;return r.length&&(s=a?Lt(r):Nt(r)),{$async:a,$validator:s,$watchTargets:o}}function zt(){return W({type:"or"},S("The value does not match any of the provided validators",It(...arguments)))}function Dt(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce((o,s)=>C(o)?V(s).apply(this,n):o,!0)}}function Mt(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce(async(o,s)=>{const c=await o;return C(c)?V(s).apply(this,n):c},Promise.resolve(!0))}}function Ft(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const a=r.some(c=>c.$async),o=r.reduce((c,i)=>i.$watchTargets?c.concat(i.$watchTargets):c,[]);let s=()=>!1;return r.length&&(s=a?Mt(r):Dt(r)),{$async:a,$validator:s,$watchTargets:o}}function qt(){return W({type:"and"},S("The value does not match all of the provided validators",Ft(...arguments)))}function Ht(t){return function(r,n){if(!_(r))return!0;const a=V(t).call(this,r,n);return rt(a)?a.then(o=>!C(o)):!C(a)}}function Gt(t){return{$validator:Ht(t),$message:"The value does not match the provided validator",$params:{type:"not"}}}function Ut(t){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+r>=+e.unref(t)}function Xt(t){return{$validator:Ut(t),$message:r=>{let{$params:n}=r;return`The minimum value allowed is ${n.min}`},$params:{min:t,type:"minValue"}}}function Wt(t){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+r<=+e.unref(t)}var Kt=t=>({$validator:Wt(t),$message:r=>{let{$params:n}=r;return`The maximum value allowed is ${n.max}`},$params:{max:t,type:"maxValue"}}),Qt=k(/(^[0-9]*$)|(^-[0-9]+$)/),Zt={$validator:Qt,$message:"Value is not an integer",$params:{type:"integer"}},Jt=k(/^[-]?\d*(\.\d+)?$/),Yt={$validator:Jt,$message:"Value must be decimal",$params:{type:"decimal"}};function er(t){let{t:r,messagePath:n=o=>{let{$validator:s}=o;return`validations.${s}`},messageParams:a=o=>o}=t;return function(s){let{withArguments:c=!1,messagePath:i=n,messageParams:u=a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function d(m){return r(i(m),u(j({model:m.$model,property:m.$property,pending:m.$pending,invalid:m.$invalid,response:m.$response,validator:m.$validator,propertyPath:m.$propertyPath},m.$params)))}return c&&typeof s=="function"?function(){return S(d,s(...arguments))}:S(d,s)}}const ge=Object.freeze(Object.defineProperty({__proto__:null,alpha:st,alphaNum:it,and:qt,between:mt,createI18nMessage:er,decimal:Yt,email:gt,helpers:Q,integer:Zt,ipAddress:vt,macAddress:bt,maxLength:xt,maxValue:Kt,minLength:Pt,minValue:Xt,not:Gt,numeric:ut,or:zt,required:Z,requiredIf:Rt,requiredUnless:Vt,sameAs:jt,url:At},Symbol.toStringTag,{value:"Module"}));function ie(t){return["maxLength","minLength"].includes(t)}function tr(t,r){return{[t]:ge[t](r)}}function rr(t,r,n){return{[t]:Q.withMessage(n,ge[t](r))}}function nr(){return{required:Z}}function ar(t){return{required:Q.withMessage(t,Z)}}function or(t,r){if(ie(t)&&typeof r.message=="string"&&typeof r.value=="number")return rr(t,r.value,r.message);if(ie(t)&&typeof r.message>"u"&&typeof r.value=="number")return tr(t,r.value);if(t==="required"&&typeof r.message=="string")return ar(r.message);if(t==="required"&&typeof r.message>"u")return nr();throw new Error("No valid rule detected")}const sr={key:0,class:"pdap-form-error-message"},$e=e.defineComponent({__name:"PdapForm",props:{error:{default:null},id:{},name:{},schema:{}},emits:["submit"],setup(t,{emit:r}){const n=t,a=r,o=e.ref(n.schema.reduce((m,f)=>{switch(f.type){case w.CHECKBOX:return{...m,[f.name]:String(f.defaultChecked)};case w.TEXT:default:return{...m,[f.name]:f.value}}},{})),s=n.schema.reduce((m,f)=>{const $=Object.entries(f.validators??{}).reduce((h,[l,p])=>({...h,...or(l,p)}),{});return{...m,[f.name]:{...$}}},{}),c=Qe(s,o,{$autoDirty:!1,$lazy:!0}),i=e.ref(n.error);function u(m,f){o.value[m]=f}e.watchEffect(()=>{n.error?i.value=n.error:i.value&&c.value.$errors.length===0?i.value=null:!i.value&&c.value.$errors.length>0&&(i.value="Please update this form to correct the errors")}),e.watchEffect(()=>{console.debug(`PdapForm ${n.name}
|
2
|
-
`,{errorMessage:
|
3
|
-
`,"Did you forget to inject some linkData for the Nav component?"));const n=e.reactive({isExpanded:!1,isMobile:!0}),a=e.reactive({"pdap-nav":!0});e.onBeforeMount(()=>{o(),window.addEventListener("resize",o)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",o)});async function o(){window.innerWidth<=1024?n.isMobile=!0:n.isMobile=!1,await e.nextTick()}async function s(){var
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("vue-router"),ce=e.defineComponent({__name:"PdapButton",props:{intent:{default:"primary"},isLoading:{type:Boolean,default:!1}},setup(t){const r=t,n=e.reactive({"pdap-button":!0,[`pdap-button-${r.intent}`]:!!r.intent,"pdap-button-loading":r.isLoading});return(a,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(n)},[e.renderSlot(a.$slots,"default")],2))}});const I=e.defineComponent({__name:"FlexContainer",props:{alignment:{default:"start"},component:{default:"div"}},setup(t){const r=t,n=e.reactive({"pdap-flex-container":!0,[`pdap-flex-container-${r.alignment}`]:!0});return(a,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component),{class:e.normalizeClass(n)},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["class"]))}});const ke={class:"pdap-footer"},Re={class:"pdap-footer-social-links"},Ve=["href"],Oe=e.createElementVNode("p",{class:"pdap-footer-copyright"},[e.createTextVNode(" © 2023 Police Data Accessibility Project"),e.createElementVNode("br")],-1),Be=e.createElementVNode("p",{class:"pdap-footer-copyright"},[e.createTextVNode(" PDAP is a non-profit. EIN: 85-4207132. "),e.createElementVNode("a",{href:"https://docs.pdap.io/meta/policy/pdap-privacy-policy",alt:"Privacy Policy",target:"_blank"},[e.createElementVNode("br"),e.createTextVNode(" Privacy Policy "),e.createElementVNode("i",{class:"fa fa-external-link"})]),e.createElementVNode("br"),e.createElementVNode("a",{href:"mailto:contact@pdap.io"},"contact@pdap.io")],-1),je={class:"pdap-footer-widget-links"},Te=e.createElementVNode("a",{href:"https://www.guidestar.org/profile/85-4207132",target:"_blank"},[e.createElementVNode("img",{src:"https://widgets.guidestar.org/gximage2?o=9973356&l=v4"})],-1),Se=["href"],Ne=["src"],Ae=["src"],Ie=e.defineComponent({__name:"PdapFooter",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/acronym.svg"},logoImageAnchorPath:{default:"/"}},setup(t){const r=t,n=e.inject("footerLinks",[{href:"https://github.com/orgs/Police-Data-Accessibility-Project",text:"Github"},{href:"https://discord.gg/wMqex8nKZJ",text:"Discord"},{href:"https://www.linkedin.com/company/pdap",text:"LinkedIn"},{path:"/jobs",text:"Jobs"}]),a=r.logoImageAnchorPath.startsWith("/");return(o,s)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("footer",ke,[e.createVNode(I,{alignment:"center"},{default:e.withCtx(()=>[e.createElementVNode("ul",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),c=>(e.openBlock(),e.createElementBlock("li",{key:c.text,class:"pdap-footer-link-container"},[c.href?(e.openBlock(),e.createElementBlock("a",{key:0,class:"pdap-footer-social-link",href:c.href,target:"_blank",referrerpolicy:"no-referrer"},e.toDisplayString(c.text),9,Ve)):e.createCommentVNode("",!0),c.path?(e.openBlock(),e.createBlock(u,{key:1,"active-class":"pdap-footer-social-link-current","exact-active-class":"pdap-footer-social-link-current-exact",class:"pdap-footer-social-link",to:c.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.text),1)]),_:2},1032,["to"])):e.createCommentVNode("",!0)]))),128))]),Oe,Be,e.createElementVNode("div",je,[Te,e.unref(a)?(e.openBlock(),e.createBlock(u,{key:1,to:o.logoImageAnchorPath,class:"pdap-footer-logo"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ae)]),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:0,href:o.logoImageAnchorPath,class:"pdap-footer-logo"},[e.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ne)],8,Se))])]),_:1})])}}});function Y(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function P(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Y(Object(n),!0).forEach(function(a){Le(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Le(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function ee(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(t).reduce((n,a)=>(r.includes(a)||(n[a]=e.unref(t[a])),n),{})}function L(t){return typeof t=="function"}function ze(t){return e.isReactive(t)||e.isReadonly(t)}function ue(t,r,n){let a=t;const o=r.split(".");for(let s=0;s<o.length;s++){if(!a[o[s]])return n;a=a[o[s]]}return a}function G(t,r,n){return e.computed(()=>t.some(a=>ue(r,a,{[n]:!1})[n]))}function te(t,r,n){return e.computed(()=>t.reduce((a,o)=>{const s=ue(r,o,{[n]:!1})[n]||[];return a.concat(s)},[]))}function de(t,r,n,a){return t.call(a,e.unref(r),e.unref(n),a)}function me(t){return t.$valid!==void 0?!t.$valid:!t}function De(t,r,n,a,o,s,u){let{$lazy:c,$rewardEarly:l}=o,d=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],g=arguments.length>8?arguments[8]:void 0,p=arguments.length>9?arguments[9]:void 0,$=arguments.length>10?arguments[10]:void 0;const h=e.ref(!!a.value),i=e.ref(0);n.value=!1;const m=e.watch([r,a].concat(d,$),()=>{if(c&&!a.value||l&&!p.value&&!n.value)return;let f;try{f=de(t,r,g,u)}catch(v){f=Promise.reject(v)}i.value++,n.value=!!i.value,h.value=!1,Promise.resolve(f).then(v=>{i.value--,n.value=!!i.value,s.value=v,h.value=me(v)}).catch(v=>{i.value--,n.value=!!i.value,s.value=v,h.value=!0})},{immediate:!0,deep:typeof r=="object"});return{$invalid:h,$unwatch:m}}function Me(t,r,n,a,o,s,u,c){let{$lazy:l,$rewardEarly:d}=a;const g=()=>({}),p=e.computed(()=>{if(l&&!n.value||d&&!c.value)return!1;let $=!0;try{const h=de(t,r,u,s);o.value=h,$=me(h)}catch(h){o.value=h}return $});return{$unwatch:g,$invalid:p}}function Fe(t,r,n,a,o,s,u,c,l,d,g){const p=e.ref(!1),$=t.$params||{},h=e.ref(null);let i,m;t.$async?{$invalid:i,$unwatch:m}=De(t.$validator,r,p,n,a,h,o,t.$watchTargets,l,d,g):{$invalid:i,$unwatch:m}=Me(t.$validator,r,n,a,h,o,l,d);const f=t.$message;return{$message:L(f)?e.computed(()=>f(ee({$pending:p,$invalid:i,$params:ee($),$model:r,$response:h,$validator:s,$propertyPath:c,$property:u}))):f||"",$params:$,$pending:p,$invalid:i,$response:h,$unwatch:m}}function qe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=e.unref(t),n=Object.keys(r),a={},o={},s={};let u=null;return n.forEach(c=>{const l=r[c];switch(!0){case L(l.$validator):a[c]=l;break;case L(l):a[c]={$validator:l};break;case c==="$validationGroups":u=l;break;case c.startsWith("$"):s[c]=l;break;default:o[c]=l}}),{rules:a,nestedValidators:o,config:s,validationGroups:u}}const He="__root";function Ge(t,r,n,a,o,s,u,c,l){const d=Object.keys(t),g=a.get(o,t),p=e.ref(!1),$=e.ref(!1),h=e.ref(0);if(g){if(!g.$partial)return g;g.$unwatch(),p.value=g.$dirty.value}const i={$dirty:p,$path:o,$touch:()=>{p.value||(p.value=!0)},$reset:()=>{p.value&&(p.value=!1)},$commit:()=>{}};return d.length?(d.forEach(m=>{i[m]=Fe(t[m],r,i.$dirty,s,u,m,n,o,l,$,h)}),i.$externalResults=e.computed(()=>c.value?[].concat(c.value).map((m,f)=>({$propertyPath:o,$property:n,$validator:"$externalResults",$uid:`${o}-externalResult-${f}`,$message:m,$params:{},$response:null,$pending:!1})):[]),i.$invalid=e.computed(()=>{const m=d.some(f=>e.unref(i[f].$invalid));return $.value=m,!!i.$externalResults.value.length||m}),i.$pending=e.computed(()=>d.some(m=>e.unref(i[m].$pending))),i.$error=e.computed(()=>i.$dirty.value?i.$pending.value||i.$invalid.value:!1),i.$silentErrors=e.computed(()=>d.filter(m=>e.unref(i[m].$invalid)).map(m=>{const f=i[m];return e.reactive({$propertyPath:o,$property:n,$validator:m,$uid:`${o}-${m}`,$message:f.$message,$params:f.$params,$response:f.$response,$pending:f.$pending})}).concat(i.$externalResults.value)),i.$errors=e.computed(()=>i.$dirty.value?i.$silentErrors.value:[]),i.$unwatch=()=>d.forEach(m=>{i[m].$unwatch()}),i.$commit=()=>{$.value=!0,h.value=Date.now()},a.set(o,t,i),i):(g&&a.set(o,t,i),i)}function Ue(t,r,n,a,o,s,u){const c=Object.keys(t);return c.length?c.reduce((l,d)=>(l[d]=U({validations:t[d],state:r,key:d,parentKey:n,resultsCache:a,globalConfig:o,instance:s,externalResults:u}),l),{}):{}}function Xe(t,r,n){const a=e.computed(()=>[r,n].filter(i=>i).reduce((i,m)=>i.concat(Object.values(e.unref(m))),[])),o=e.computed({get(){return t.$dirty.value||(a.value.length?a.value.every(i=>i.$dirty):!1)},set(i){t.$dirty.value=i}}),s=e.computed(()=>{const i=e.unref(t.$silentErrors)||[],m=a.value.filter(f=>(e.unref(f).$silentErrors||[]).length).reduce((f,v)=>f.concat(...v.$silentErrors),[]);return i.concat(m)}),u=e.computed(()=>{const i=e.unref(t.$errors)||[],m=a.value.filter(f=>(e.unref(f).$errors||[]).length).reduce((f,v)=>f.concat(...v.$errors),[]);return i.concat(m)}),c=e.computed(()=>a.value.some(i=>i.$invalid)||e.unref(t.$invalid)||!1),l=e.computed(()=>a.value.some(i=>e.unref(i.$pending))||e.unref(t.$pending)||!1),d=e.computed(()=>a.value.some(i=>i.$dirty)||a.value.some(i=>i.$anyDirty)||o.value),g=e.computed(()=>o.value?l.value||c.value:!1),p=()=>{t.$touch(),a.value.forEach(i=>{i.$touch()})},$=()=>{t.$commit(),a.value.forEach(i=>{i.$commit()})},h=()=>{t.$reset(),a.value.forEach(i=>{i.$reset()})};return a.value.length&&a.value.every(i=>i.$dirty)&&p(),{$dirty:o,$errors:u,$invalid:c,$anyDirty:d,$error:g,$pending:l,$touch:p,$reset:h,$silentErrors:s,$commit:$}}function U(t){let{validations:r,state:n,key:a,parentKey:o,childResults:s,resultsCache:u,globalConfig:c={},instance:l,externalResults:d}=t;const g=o?`${o}.${a}`:a,{rules:p,nestedValidators:$,config:h,validationGroups:i}=qe(r),m=P(P({},c),h),f=a?e.computed(()=>{const y=e.unref(n);return y?e.unref(y[a]):void 0}):n,v=P({},e.unref(d)||{}),w=e.computed(()=>{const y=e.unref(d);return a?y?e.unref(y[a]):void 0:y}),M=Ge(p,f,a,u,g,m,l,w,n),b=Ue($,f,g,u,m,l,w),V={};i&&Object.entries(i).forEach(y=>{let[O,C]=y;V[O]={$invalid:G(C,b,"$invalid"),$error:G(C,b,"$error"),$pending:G(C,b,"$pending"),$errors:te(C,b,"$errors"),$silentErrors:te(C,b,"$silentErrors")}});const{$dirty:E,$errors:N,$invalid:F,$anyDirty:ye,$error:_e,$pending:q,$touch:H,$reset:be,$silentErrors:we,$commit:J}=Xe(M,b,s),xe=a?e.computed({get:()=>e.unref(f),set:y=>{E.value=!0;const O=e.unref(n),C=e.unref(d);C&&(C[a]=v[a]),e.isRef(O[a])?O[a].value=y:O[a]=y}}):null;a&&m.$autoDirty&&e.watch(f,()=>{E.value||H();const y=e.unref(d);y&&(y[a]=v[a])},{flush:"sync"});async function Ee(){return H(),m.$rewardEarly&&(J(),await e.nextTick()),await e.nextTick(),new Promise(y=>{if(!q.value)return y(!F.value);const O=e.watch(q,()=>{y(!F.value),O()})})}function Ce(y){return(s.value||{})[y]}function Pe(){e.isRef(d)?d.value=v:Object.keys(v).length===0?Object.keys(d).forEach(y=>{delete d[y]}):Object.assign(d,v)}return e.reactive(P(P(P({},M),{},{$model:xe,$dirty:E,$error:_e,$errors:N,$invalid:F,$anyDirty:ye,$pending:q,$touch:H,$reset:be,$path:g||He,$silentErrors:we,$validate:Ee,$commit:J},s&&{$getResultsForChild:Ce,$clearExternalResults:Pe,$validationGroups:V}),b))}class We{constructor(){this.storage=new Map}set(r,n,a){this.storage.set(r,{rules:n,result:a})}checkRulesValidity(r,n,a){const o=Object.keys(a),s=Object.keys(n);return s.length!==o.length||!s.every(c=>o.includes(c))?!1:s.every(c=>n[c].$params?Object.keys(n[c].$params).every(l=>e.unref(a[c].$params[l])===e.unref(n[c].$params[l])):!0)}get(r,n){const a=this.storage.get(r);if(!a)return;const{rules:o,result:s}=a,u=this.checkRulesValidity(r,n,o),c=s.$unwatch?s.$unwatch:()=>({});return u?s:{$dirty:s.$dirty,$partial:!0,$unwatch:c}}}const A={COLLECT_ALL:!0,COLLECT_NONE:!1},re=Symbol("vuelidate#injectChildResults"),ne=Symbol("vuelidate#removeChildResults");function Ke(t){let{$scope:r,instance:n}=t;const a={},o=e.ref([]),s=e.computed(()=>o.value.reduce((g,p)=>(g[p]=e.unref(a[p]),g),{}));function u(g,p){let{$registerAs:$,$scope:h,$stopPropagation:i}=p;i||r===A.COLLECT_NONE||h===A.COLLECT_NONE||r!==A.COLLECT_ALL&&r!==h||(a[$]=g,o.value.push($))}n.__vuelidateInjectInstances=[].concat(n.__vuelidateInjectInstances||[],u);function c(g){o.value=o.value.filter(p=>p!==g),delete a[g]}n.__vuelidateRemoveInstances=[].concat(n.__vuelidateRemoveInstances||[],c);const l=e.inject(re,[]);e.provide(re,n.__vuelidateInjectInstances);const d=e.inject(ne,[]);return e.provide(ne,n.__vuelidateRemoveInstances),{childResults:s,sendValidationResultsToParent:l,removeValidationResultsFromParent:d}}function pe(t){return new Proxy(t,{get(r,n){return typeof r[n]=="object"?pe(r[n]):e.computed(()=>r[n])}})}let ae=0;function Qe(t,r){var n;let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(a=t,t=void 0,r=void 0);let{$registerAs:o,$scope:s=A.COLLECT_ALL,$stopPropagation:u,$externalResults:c,currentVueInstance:l}=a;const d=l||((n=e.getCurrentInstance())===null||n===void 0?void 0:n.proxy),g=d?d.$options:{};o||(ae+=1,o=`_vuelidate_${ae}`);const p=e.ref({}),$=new We,{childResults:h,sendValidationResultsToParent:i,removeValidationResultsFromParent:m}=d?Ke({$scope:s,instance:d}):{childResults:e.ref({})};if(!t&&g.validations){const f=g.validations;r=e.ref({}),e.onBeforeMount(()=>{r.value=d,e.watch(()=>L(f)?f.call(r.value,new pe(r.value)):f,v=>{p.value=U({validations:v,state:r,childResults:h,resultsCache:$,globalConfig:a,instance:d,externalResults:c||d.vuelidateExternalResults})},{immediate:!0})}),a=g.validationsConfig||a}else{const f=e.isRef(t)||ze(t)?t:e.reactive(t||{});e.watch(f,v=>{p.value=U({validations:v,state:r,childResults:h,resultsCache:$,globalConfig:a,instance:d??{},externalResults:c})},{immediate:!0})}return d&&(i.forEach(f=>f(p,{$registerAs:o,$scope:s,$stopPropagation:u})),e.onBeforeUnmount(()=>m.forEach(f=>f(o)))),e.computed(()=>P(P({},e.unref(p.value)),h.value))}var x=(t=>(t.CHECKBOX="checkbox",t.TEXT="text",t))(x||{});const Ze=["id","name","placeholder","value"],Je=["id","name","checked","value"],Ye=["id"],et=["for"],fe=e.defineComponent({__name:"PdapInput",props:{error:{},id:{},label:{},name:{},placeholder:{},type:{},value:{},defaultChecked:{type:Boolean}},emits:["change","input"],setup(t,{emit:r}){const n=t,a=r,o=()=>{u.value=!u.value,a("change",u.value.toString())},s=l=>{a("input",l.target.value)},u=e.ref(n.defaultChecked),c=e.computed(()=>`pdap-${n.name}-input-error`);return(l,d)=>{var g;return e.openBlock(),e.createBlock(e.unref($e),{class:e.normalizeClass({"pdap-input":!0,"pdap-input-error":Number((g=l.error)==null?void 0:g.length)>=1})},{default:e.withCtx(()=>[l.type===e.unref(x).TEXT?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,id:l.id,type:"text",name:l.name,placeholder:l.placeholder,value:l.value},l.$attrs,{onInput:s}),null,16,Ze)):l.type===e.unref(x).CHECKBOX?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,id:l.id,class:"pdap-input-checkbox",name:l.name,checked:u.value,type:"checkbox",value:l.value},l.$attrs,{onChange:o}),null,16,Je)):e.createCommentVNode("",!0),l.error?(e.openBlock(),e.createElementBlock("div",{key:2,id:c.value,class:"pdap-input-error-message"},e.toDisplayString(l.error),9,Ye)):e.createCommentVNode("",!0),e.createElementVNode("label",{class:"pdap-input-label",for:l.id},e.toDisplayString(l.label),9,et)]),_:1},8,["class"])}}});function oe(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function j(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?oe(Object(n),!0).forEach(function(a){tt(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function tt(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function T(t){return typeof t=="function"}function z(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function D(t){return T(t.$validator)?j({},t):{$validator:t}}function rt(t){return z(t)&&T(t.then)}function k(t){return typeof t=="object"?t.$valid:t}function B(t){return t.$validator||t}function W(t,r){if(!z(t))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof t}`);if(!z(r)&&!T(r))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=D(r);return n.$params=j(j({},n.$params||{}),t),n}function S(t,r){if(!T(t)&&typeof e.unref(t)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof t}`);if(!z(r)&&!T(r))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=D(r);return n.$message=t,n}function nt(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=D(t);return j(j({},n),{},{$async:!0,$watchTargets:r})}function at(t){return{$validator(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];return e.unref(r).reduce((s,u,c)=>{const l=Object.entries(u).reduce((d,g)=>{let[p,$]=g;const h=t[p]||{},i=Object.entries(h).reduce((m,f)=>{let[v,w]=f;const b=B(w).call(this,$,u,c,...a),V=k(b);if(m.$data[v]=b,m.$data.$invalid=!V||!!m.$data.$invalid,m.$data.$error=m.$data.$invalid,!V){let E=w.$message||"";const N=w.$params||{};typeof E=="function"&&(E=E({$pending:!1,$invalid:!V,$params:N,$model:$,$response:b})),m.$errors.push({$property:p,$message:E,$params:N,$response:b,$model:$,$pending:!1,$validator:v})}return{$valid:m.$valid&&V,$data:m.$data,$errors:m.$errors}},{$valid:!0,$data:{},$errors:[]});return d.$data[p]=i.$data,d.$errors[p]=i.$errors,{$valid:d.$valid&&i.$valid,$data:d.$data,$errors:d.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:s.$valid&&l.$valid,$data:s.$data.concat(l.$data),$errors:s.$errors.concat(l.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:r=>{let{$response:n}=r;return n?n.$errors.map(a=>Object.values(a).map(o=>o.map(s=>s.$message)).reduce((o,s)=>o.concat(s),[])):[]}}}const _=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(t==null)return!1;if(t===!1)return!0;if(t instanceof Date)return!isNaN(t.getTime());if(typeof t=="object"){for(let r in t)return!0;return!1}return!!String(t).length},K=t=>(t=e.unref(t),Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:String(t).length);function R(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return a=>(a=e.unref(a),!_(a)||r.every(o=>(o.lastIndex=0,o.test(a))))}var Q=Object.freeze({__proto__:null,forEach:at,len:K,normalizeValidatorObject:D,regex:R,req:_,unwrap:e.unref,unwrapNormalizedValidator:B,unwrapValidatorResponse:k,withAsync:nt,withMessage:S,withParams:W}),ot=R(/^[a-zA-Z]*$/),st={$validator:ot,$message:"The value is not alphabetical",$params:{type:"alpha"}},lt=R(/^[a-zA-Z0-9]*$/),it={$validator:lt,$message:"The value must be alpha-numeric",$params:{type:"alphaNum"}},ct=R(/^\d*(\.\d+)?$/),ut={$validator:ct,$message:"Value must be numeric",$params:{type:"numeric"}};function dt(t,r){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+e.unref(t)<=+n&&+e.unref(r)>=+n}function mt(t,r){return{$validator:dt(t,r),$message:n=>{let{$params:a}=n;return`The value must be between ${a.min} and ${a.max}`},$params:{min:t,max:r,type:"between"}}}const pt=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;var ft=R(pt),gt={$validator:ft,$message:"Value is not a valid email address",$params:{type:"email"}};function ht(t){if(!_(t))return!0;if(typeof t!="string")return!1;const r=t.split(".");return r.length===4&&r.every($t)}const $t=t=>{if(t.length>3||t.length===0||t[0]==="0"&&t!=="0"||!t.match(/^\d+$/))return!1;const r=+t|0;return r>=0&&r<=255};var vt={$validator:ht,$message:"The value is not a valid IP address",$params:{type:"ipAddress"}};function yt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return r=>{if(t=e.unref(t),!_(r))return!0;if(typeof r!="string")return!1;const n=typeof t=="string"&&t!==""?r.split(t):r.length===12||r.length===16?r.match(/.{2}/g):null;return n!==null&&(n.length===6||n.length===8)&&n.every(_t)}}const _t=t=>t.toLowerCase().match(/^[0-9a-f]{2}$/);function bt(t){return{$validator:yt(t),$message:"The value is not a valid MAC Address",$params:{type:"macAddress"}}}function wt(t){return r=>!_(r)||K(r)<=e.unref(t)}function xt(t){return{$validator:wt(t),$message:r=>{let{$params:n}=r;return`The maximum length allowed is ${n.max}`},$params:{max:t,type:"maxLength"}}}function Et(t){return r=>!_(r)||K(r)>=e.unref(t)}function Ct(t){return{$validator:Et(t),$message:r=>{let{$params:n}=r;return`This field should be at least ${n.min} characters long`},$params:{min:t,type:"minLength"}}}function Pt(t){return typeof t=="string"&&(t=t.trim()),_(t)}var Z={$validator:Pt,$message:"Value is required",$params:{type:"required"}};const se=(t,r)=>t?_(typeof r=="string"?r.trim():r):!0;function kt(t){return function(r,n){if(typeof t!="function")return se(e.unref(t),r);const a=t.call(this,r,n);return se(a,r)}}function Rt(t){return{$validator:kt(t),$message:"The value is required",$params:{type:"requiredIf",prop:t}}}const le=(t,r)=>t?!0:_(typeof r=="string"?r.trim():r);function Vt(t){return function(r,n){if(typeof t!="function")return le(e.unref(t),r);const a=t.call(this,r,n);return le(a,r)}}function Ot(t){return{$validator:Vt(t),$message:"The value is required",$params:{type:"requiredUnless",prop:t}}}function Bt(t){return r=>e.unref(r)===e.unref(t)}function jt(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"other";return{$validator:Bt(t),$message:n=>`The value must be equal to the ${r} value`,$params:{equalTo:t,otherName:r,type:"sameAs"}}}const Tt=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;var St=R(Tt),Nt={$validator:St,$message:"The value is not a valid URL address",$params:{type:"url"}};function At(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce((o,s)=>k(o)?o:B(s).apply(this,n),!1)}}function It(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce(async(o,s)=>{const u=await o;return k(u)?u:B(s).apply(this,n)},Promise.resolve(!1))}}function Lt(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const a=r.some(u=>u.$async),o=r.reduce((u,c)=>c.$watchTargets?u.concat(c.$watchTargets):u,[]);let s=()=>!1;return r.length&&(s=a?It(r):At(r)),{$async:a,$validator:s,$watchTargets:o}}function zt(){return W({type:"or"},S("The value does not match any of the provided validators",Lt(...arguments)))}function Dt(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce((o,s)=>k(o)?B(s).apply(this,n):o,!0)}}function Mt(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t.reduce(async(o,s)=>{const u=await o;return k(u)?B(s).apply(this,n):u},Promise.resolve(!0))}}function Ft(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const a=r.some(u=>u.$async),o=r.reduce((u,c)=>c.$watchTargets?u.concat(c.$watchTargets):u,[]);let s=()=>!1;return r.length&&(s=a?Mt(r):Dt(r)),{$async:a,$validator:s,$watchTargets:o}}function qt(){return W({type:"and"},S("The value does not match all of the provided validators",Ft(...arguments)))}function Ht(t){return function(r,n){if(!_(r))return!0;const a=B(t).call(this,r,n);return rt(a)?a.then(o=>!k(o)):!k(a)}}function Gt(t){return{$validator:Ht(t),$message:"The value does not match the provided validator",$params:{type:"not"}}}function Ut(t){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+r>=+e.unref(t)}function Xt(t){return{$validator:Ut(t),$message:r=>{let{$params:n}=r;return`The minimum value allowed is ${n.min}`},$params:{min:t,type:"minValue"}}}function Wt(t){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+r<=+e.unref(t)}var Kt=t=>({$validator:Wt(t),$message:r=>{let{$params:n}=r;return`The maximum value allowed is ${n.max}`},$params:{max:t,type:"maxValue"}}),Qt=R(/(^[0-9]*$)|(^-[0-9]+$)/),Zt={$validator:Qt,$message:"Value is not an integer",$params:{type:"integer"}},Jt=R(/^[-]?\d*(\.\d+)?$/),Yt={$validator:Jt,$message:"Value must be decimal",$params:{type:"decimal"}};function er(t){let{t:r,messagePath:n=o=>{let{$validator:s}=o;return`validations.${s}`},messageParams:a=o=>o}=t;return function(s){let{withArguments:u=!1,messagePath:c=n,messageParams:l=a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function d(g){return r(c(g),l(j({model:g.$model,property:g.$property,pending:g.$pending,invalid:g.$invalid,response:g.$response,validator:g.$validator,propertyPath:g.$propertyPath},g.$params)))}return u&&typeof s=="function"?function(){return S(d,s(...arguments))}:S(d,s)}}const ge=Object.freeze(Object.defineProperty({__proto__:null,alpha:st,alphaNum:it,and:qt,between:mt,createI18nMessage:er,decimal:Yt,email:gt,helpers:Q,integer:Zt,ipAddress:vt,macAddress:bt,maxLength:xt,maxValue:Kt,minLength:Ct,minValue:Xt,not:Gt,numeric:ut,or:zt,required:Z,requiredIf:Rt,requiredUnless:Ot,sameAs:jt,url:Nt},Symbol.toStringTag,{value:"Module"}));function ie(t){return["maxLength","minLength"].includes(t)}function tr(t,r){return{[t]:ge[t](r)}}function rr(t,r,n){return{[t]:Q.withMessage(n,ge[t](r))}}function nr(){return{required:Z}}function ar(t){return{required:Q.withMessage(t,Z)}}function or(t,r){if(ie(t)&&typeof r.message=="string"&&typeof r.value=="number")return rr(t,r.value,r.message);if(ie(t)&&typeof r.message>"u"&&typeof r.value=="number")return tr(t,r.value);if(t==="required"&&typeof r.message=="string")return ar(r.message);if(t==="required"&&typeof r.message>"u")return nr();throw new Error("No valid rule detected")}const sr={key:0,class:"pdap-form-error-message"},he=e.defineComponent({__name:"PdapForm",props:{error:{default:null},id:{},name:{},schema:{}},emits:["submit"],setup(t,{emit:r}){const n=t,a=r,o=e.ref(n.schema.map(p=>{const $={...p};return delete $.validators,$})),s=e.ref(n.schema.reduce((p,$)=>{switch($.type){case x.CHECKBOX:return{...p,[$.name]:String($.defaultChecked)};case x.TEXT:default:return{...p,[$.name]:$.value}}},{})),u=n.schema.reduce((p,$)=>{const h=Object.entries($.validators??{}).reduce((i,[m,f])=>({...i,...or(m,f)}),{});return{...p,[$.name]:{...h}}},{}),c=Qe(u,s,{$autoDirty:!1,$lazy:!0}),l=e.ref(n.error);function d(p,$){s.value[p]=$}e.watchEffect(()=>{n.error?l.value=n.error:l.value&&c.value.$errors.length===0?l.value=null:!l.value&&c.value.$errors.length>0&&(l.value="Please update this form to correct the errors")}),e.watchEffect(()=>{console.debug(`PdapForm ${n.name}
|
2
|
+
`,{errorMessage:l.value,props:n,values:s,vuelidate:{rules:u,v$:c}})});async function g(p){if(await c.value.$validate()){a("submit",{...s.value}),c.value.$reset(),p.target.reset(),s.value=Object.entries(s.value).reduce((i,[m,f])=>({...i,[m]:["true","false"].includes(f)?f:""}),{});return}}return(p,$)=>(e.openBlock(),e.createElementBlock("form",{class:"pdap-form",onSubmit:$[0]||($[0]=e.withModifiers(h=>g(h),["prevent"]))},[typeof l.value=="string"?(e.openBlock(),e.createElementBlock("div",sr,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,h=>{var i,m,f,v;return e.openBlock(),e.createBlock(fe,e.mergeProps(h,{key:h.name,error:(i=e.unref(c)[h.name])!=null&&i.$error?(v=(f=(m=e.unref(c)[h.name])==null?void 0:m.$errors)==null?void 0:f[0])==null?void 0:v.$message:"",value:s.value[h.name],onChange:w=>h.type!==e.unref(x).TEXT?d(h.name,w):void 0,onInput:w=>h.type===e.unref(x).TEXT?d(h.name,w):void 0}),null,16,["error","value","onChange","onInput"])}),128)),e.renderSlot(p.$slots,"default")],32))}});const $e=e.defineComponent({__name:"GridContainer",props:{columns:{default:"auto"},component:{default:"div"},rows:{default:"auto"},templateColumns:{},templateRows:{}},setup(t){const r=t,n=e.reactive({"pdap-grid-container":!0,[`pdap-grid-container-column-${r.columns}`]:r.columns!=="auto"}),a=r.templateRows||typeof r.rows=="number",o=r.templateRows??`repeat(${r.rows}, minmax(0, 1fr))`,s=e.reactive({...a&&{gridTemplateRows:o},...r.templateColumns&&{gridTemplateColumns:r.templateColumns}});return(u,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.component),{class:e.normalizeClass(n),style:e.normalizeStyle(s)},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},8,["class","style"]))}});const lr=e.defineComponent({__name:"GridItem",props:{component:{default:"div"},spanColumn:{default:1},spanRow:{default:1}},setup(t){const r=t,n=e.reactive({"pdap-grid-item":!0,[`pdap-grid-item-span-column-${r.spanColumn}`]:r.spanColumn>1}),a=e.reactive({...r.spanRow>1&&{gridRow:`span ${r.spanRow} / span ${r.spanRow}`}});return(o,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),{class:e.normalizeClass(n),style:e.normalizeStyle(a)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});const ir=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},[e.createElementVNode("path",{d:"M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"})],-1),cr=[ir],ur=["aria-expanded"],dr=["href"],ve=e.defineComponent({__name:"PdapNav",props:{topPosition:{}},setup(t){let r=e.inject("navLinks");typeof r>"u"&&(r=[],console.error(`Hey, PDAP developer
|
3
|
+
`,"Did you forget to inject some linkData for the Nav component?"));const n=e.reactive({isExpanded:!1,isMobile:!0}),a=e.reactive({"pdap-nav":!0});e.onBeforeMount(()=>{o(),window.addEventListener("resize",o)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",o)});async function o(){window.innerWidth<=1024?n.isMobile=!0:n.isMobile=!1,await e.nextTick()}async function s(){var c,l;const u=document.querySelector("body");!n.isExpanded&&n.isMobile?(n.isExpanded=!0,u!=null&&u.classList.contains("lock-scroll")||(c=document.querySelector("body"))==null||c.classList.add("lock-scroll")):n.isExpanded&&n.isMobile&&(n.isExpanded=!1,(l=document.querySelector("body"))==null||l.classList.remove("lock-scroll")),await e.nextTick()}return(u,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{"aria-controls":"nav",class:"pdap-nav-open-button",role:"button",onClick:s},cr),e.createElementVNode("nav",{id:"nav","aria-expanded":n.isMobile&&n.isExpanded||!n.isMobile,class:e.normalizeClass(a),style:e.normalizeStyle(n.isMobile?{top:`${u.topPosition}px`}:{})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),l=>(e.openBlock(),e.createElementBlock("li",{key:l.text,class:"pdap-nav-link-container"},[l.href?(e.openBlock(),e.createElementBlock("a",{key:0,class:"pdap-nav-link",href:l.href,target:"_blank",referrerpolicy:"no-referrer",onClick:s},e.toDisplayString(l.text),9,dr)):e.createCommentVNode("",!0),l.path?(e.openBlock(),e.createBlock(e.unref(X.RouterLink),{key:1,"active-class":"pdap-nav-link-current","exact-active-class":"pdap-nav-link-current-exact",class:"pdap-nav-link",to:l.path,onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.text),1)]),_:2},1032,["to"])):e.createCommentVNode("",!0)]))),128))],14,ur)],64))}});const mr=["href"],pr=["src"],fr=["src"],gr=e.defineComponent({__name:"PdapHeader",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/lockup.svg"},logoImageAnchorPath:{default:"/"}},setup(t){const r=t,n=e.ref(),a=e.ref(null),o=r.logoImageAnchorPath.startsWith("/");e.onMounted(()=>{s(),window.addEventListener("resize",s)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",s)});function s(){a.value&&(n.value=a.value.offsetHeight)}return(u,c)=>(e.openBlock(),e.createElementBlock("header",{ref_key:"el",ref:a,class:"pdap-header"},[e.unref(o)?(e.openBlock(),e.createBlock(e.unref(X.RouterLink),{key:1,to:u.logoImageAnchorPath,class:"logo"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:u.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,fr)]),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:0,href:u.logoImageAnchorPath,class:"logo"},[e.createElementVNode("img",{src:u.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,pr)],8,mr)),e.createVNode(ve,{"top-position":n.value},null,8,["top-position"])],512))}});const hr=e.createElementVNode("h2",{class:"mt-0"},"Search our database",-1),$r=e.createElementVNode("p",{class:"pb-4 md:pb-8"},[e.createTextVNode(" If you have a question to answer, we may already know about helpful data in your area. "),e.createElementVNode("a",{href:"https://pdap.io/data"},"Learn more about the data here.")],-1),vr=e.defineComponent({__name:"QuickSearchForm",props:{mode:{default:"prod"}},setup(t){const r=X.useRouter(),n=t,a=[{id:"search-term",name:"searchTerm",label:"What are you looking for?",type:x.TEXT,placeholder:"Enter a keyword, or 'all'",value:""},{id:"location",name:"location",label:"From where?",type:x.TEXT,placeholder:"Enter a place, or 'all'",value:""}],o=e.ref(void 0);function s(u){if(Object.values(u).every(d=>!d)){o.value="Either a search term or a location is required.";return}let{location:c,searchTerm:l}=u;if(c=c&&c.length>0?c:"all",l=l&&l.length>0?l:"all",r.getRoutes().some(d=>d.path.includes("/search/")))r.push(`/search/${l}/${c}`);else{const d=n.mode==="prod"?"https://data-sources.pdap.io":"https://data-sources.pdap.dev";window.location.assign(`${d}/search/${l}/${c}`)}}return(u,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(I,{class:"p-0"},{default:e.withCtx(()=>[hr,$r]),_:1}),e.createVNode(I,{alignment:"center",class:"pdap-quick-search-form h-full max-h-[75-vh] justify-start p-0"},{default:e.withCtx(()=>[e.createVNode(he,{id:"quick-search-form",class:"flex flex-wrap gap-x-4",error:o.value,schema:a,name:"quickSearchForm",onSubmit:s},{default:e.withCtx(()=>[e.createVNode(ce,{type:"submit",class:"flex-grow-0 flex-shrink-0 basis-full max-w-[unset] mt-4"},{default:e.withCtx(()=>[e.createTextVNode("Search Data Sources")]),_:1})]),_:1},8,["error"])]),_:1})],64))}});const yr=["alt","src"],_r=e.defineComponent({__name:"TileIcon",props:{imgAltText:{},imgSrc:{}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("img",{class:"pdap-tile-icon",alt:r.imgAltText,src:r.imgSrc},null,8,yr))}});const br={content:["./src/**/*.vue","./src/**/*.css"],theme:{extend:{colors:{brand:{blue:{light:"rgba(var(--color-brand-blue-light)/<alpha-value>)",medium:"rgba(var(--color-brand-blue-medium)/<alpha-value>)"},gold:"rgba(var(--color-brand-gold)/<alpha-value>)",wine:"rgba(var(--color-brand-wine)/<alpha-value>)"},neutral:{50:"rgba(var(--color-neutral-50)/<alpha-value>)",100:"rgba(var(--color-neutral-100)/<alpha-value>)",200:"rgba(var(--color-neutral-200)/<alpha-value>)",300:"rgba(var(--color-neutral-300)/<alpha-value>)",400:"rgba(var(--color-neutral-400)/<alpha-value>)",500:"rgba(var(--color-neutral-500)/<alpha-value>)",600:"rgba(var(--color-neutral-600)/<alpha-value>)",700:"rgba(var(--color-neutral-700)/<alpha-value>)",800:"rgba(var(--color-neutral-800)/<alpha-value>)",900:"rgba(var(--color-neutral-900)/<alpha-value>)",950:"rgba(var(--color-neutral-950)/<alpha-value>)"}},brightness:{85:".85"},maxWidth:{"4xl":"59rem"},screens:{xs:"500px"}},fontFamily:{sans:['"Libre Franklin"',"ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto","Oxygen","Ubuntu","Cantarell",'"Fira Sans"','"Droid Sans"','"Helvetica Neue"',"sans-serif"],serif:["ui-serif","Georgia"],mono:['"Source Code Pro"',"monospace","ui-monospace","SFMono-Regular"]},fontSize:{xs:"0.75rem",sm:"0.875rem",med:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.75rem","4xl":"2rem","5xl":"2.625rem","6xl":"3rem"}}},wr=Object.freeze(Object.defineProperty({__proto__:null,default:br},Symbol.toStringTag,{value:"Module"}));exports.Button=ce;exports.FlexContainer=I;exports.Footer=Ie;exports.Form=he;exports.GridContainer=$e;exports.GridItem=lr;exports.Header=gr;exports.Input=fe;exports.Nav=ve;exports.PdapInputTypes=x;exports.QuickSearchForm=vr;exports.TileIcon=_r;exports.tailwindConfig=wr;
|