vue-spear-tip 0.1.7 → 0.1.8-beta.0

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.
Files changed (36) hide show
  1. package/README.md +5 -0
  2. package/dist/.vite/manifest.json +39 -4
  3. package/dist/Button-BASTk6rp.js +105 -0
  4. package/dist/Button-eaKCQUBn.cjs +1 -0
  5. package/dist/Select-BOFrSixX.cjs +40 -0
  6. package/dist/Select-iphKxrd_.js +1550 -0
  7. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  8. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  9. package/dist/components/Elements/Button/ButtonInherited.d.ts +1 -1
  10. package/dist/components/Fields/Select/index.d.ts +2 -0
  11. package/dist/components/LazyComponents.d.ts +2 -1
  12. package/dist/index-BdD-iskN.js +791 -0
  13. package/dist/index-XTHCsE6e.cjs +1 -0
  14. package/dist/kit/fields/index.d.ts +2 -0
  15. package/dist/kit/index.d.ts +1 -0
  16. package/dist/replaceable/Elements/Button/ButtonInherited.d.ts +1 -1
  17. package/dist/replaceable/FieldComponent.vue +2 -0
  18. package/dist/vue-spear-tip.cjs.js +1 -1
  19. package/dist/vue-spear-tip.css +1 -1
  20. package/dist/vue-spear-tip.es.js +12 -784
  21. package/docs/index.html +2 -2
  22. package/docs/static/Button-DzByRuk3.js +1 -0
  23. package/docs/static/Button-q8qOklef.css +1 -0
  24. package/docs/static/Select-CYNOaLC-.css +1 -0
  25. package/docs/static/Select-ogIoYRYo.js +40 -0
  26. package/docs/static/{index-DCJRmjIx.js → index-Dh-gr-lC.js} +2 -2
  27. package/docs/static/index-MQjtTT-l.js +2 -0
  28. package/docs/static/main-B5pIOT1E.css +1 -0
  29. package/docs/static/main-s9ckwI7y.js +17 -0
  30. package/package.json +1 -1
  31. package/dist/Button-Cdk6YfN5.cjs +0 -1
  32. package/dist/Button-nacsZiSC.js +0 -315
  33. package/docs/static/Button-EEyIMj-d.css +0 -1
  34. package/docs/static/Button-Ks5sZmCF.js +0 -1
  35. package/docs/static/main-BjqHPmsz.js +0 -17
  36. package/docs/static/main-DHbU8YnW.css +0 -1
package/README.md CHANGED
@@ -36,6 +36,11 @@ Need enable experimental decorators in `tsconfig.json`:
36
36
  }
37
37
  ```
38
38
 
39
+ #### Add kit components styles
40
+ ```ts
41
+ import 'vue-spear-tip/style'
42
+ ```
43
+
39
44
  #### Use
40
45
 
41
46
  ```vue
@@ -1,11 +1,46 @@
1
1
  {
2
+ "__plugin-vue_export-helper-BHFhmbuH.cjs": {
3
+ "file": "_plugin-vue_export-helper-BHFhmbuH.cjs",
4
+ "name": "_plugin-vue_export-helper"
5
+ },
6
+ "__plugin-vue_export-helper-CHgC5LLL.js": {
7
+ "file": "_plugin-vue_export-helper-CHgC5LLL.js",
8
+ "name": "_plugin-vue_export-helper"
9
+ },
10
+ "_index-BdD-iskN.js": {
11
+ "file": "index-BdD-iskN.js",
12
+ "name": "index",
13
+ "dynamicImports": [
14
+ "src/components/Elements/Button/Button.vue",
15
+ "src/components/Fields/Select/Select.vue"
16
+ ]
17
+ },
18
+ "_index-XTHCsE6e.cjs": {
19
+ "file": "index-XTHCsE6e.cjs",
20
+ "name": "index",
21
+ "dynamicImports": [
22
+ "src/components/Elements/Button/Button.vue",
23
+ "src/components/Fields/Select/Select.vue"
24
+ ]
25
+ },
2
26
  "src/components/Elements/Button/Button.vue": {
3
- "file": "Button-Cdk6YfN5.cjs",
27
+ "file": "Button-eaKCQUBn.cjs",
4
28
  "name": "Button",
5
29
  "src": "src/components/Elements/Button/Button.vue",
6
30
  "isDynamicEntry": true,
7
31
  "imports": [
8
- "src/index.ts"
32
+ "_index-XTHCsE6e.cjs",
33
+ "__plugin-vue_export-helper-BHFhmbuH.cjs"
34
+ ]
35
+ },
36
+ "src/components/Fields/Select/Select.vue": {
37
+ "file": "Select-BOFrSixX.cjs",
38
+ "name": "Select",
39
+ "src": "src/components/Fields/Select/Select.vue",
40
+ "isDynamicEntry": true,
41
+ "imports": [
42
+ "_index-XTHCsE6e.cjs",
43
+ "__plugin-vue_export-helper-BHFhmbuH.cjs"
9
44
  ]
10
45
  },
11
46
  "src/index.ts": {
@@ -13,8 +48,8 @@
13
48
  "name": "index.js",
14
49
  "src": "src/index.ts",
15
50
  "isEntry": true,
16
- "dynamicImports": [
17
- "src/components/Elements/Button/Button.vue"
51
+ "imports": [
52
+ "_index-XTHCsE6e.cjs"
18
53
  ]
19
54
  },
20
55
  "style.css": {
@@ -0,0 +1,105 @@
1
+ import { B as v, V as y } from "./index-BdD-iskN.js";
2
+ import { createElementBlock as a, createCommentVNode as s, openBlock as r, createElementVNode as f, normalizeStyle as k, withKeys as g, normalizeClass as i, renderSlot as C, createBlock as w, toDisplayString as n, resolveDynamicComponent as B, withCtx as $, createTextVNode as m, Fragment as h } from "vue";
3
+ import { _ as T } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ var O = Object.getOwnPropertyDescriptor, R = (e, o, b, u) => {
5
+ for (var l = u > 1 ? void 0 : u ? O(o, b) : o, d = e.length - 1, t; d >= 0; d--)
6
+ (t = e[d]) && (l = t(l) || l);
7
+ return l;
8
+ };
9
+ let p = class extends v {
10
+ };
11
+ p = R([
12
+ y
13
+ ], p);
14
+ const S = ["title", "data-theme", "data-offset", "data-placement"], z = ["title", "data-theme", "data-offset", "data-placement", "disabled", "type"], H = ["href"], M = ["href"];
15
+ function V(e, o, b, u, l, d) {
16
+ return e.showButton ? (r(), a("span", {
17
+ key: 0,
18
+ class: "d-inline-block relative",
19
+ title: e.disabled ? e.disabledTitle : "",
20
+ "data-theme": e.dataThemeInner,
21
+ "data-offset": e.dataOffset,
22
+ "data-placement": e.dataPlacement
23
+ }, [
24
+ f("button", {
25
+ class: i(["relative w100% h100% flex! items-center! justify-center!", {
26
+ shine: e.shine,
27
+ [e.randomClass + (e.isOnHover ? " hover" : "")]: !0
28
+ // mobile: viewPortType == 'mobile',
29
+ // tablet: viewPortType == 'tablet',
30
+ }]),
31
+ title: e.disabled ? "" : e.innerTitle,
32
+ "data-theme": e.dataThemeInner,
33
+ "data-offset": e.dataOffset,
34
+ "data-placement": e.dataPlacement,
35
+ onMouseover: o[0] || (o[0] = (t) => e.isOnHover = !0),
36
+ onMouseout: o[1] || (o[1] = (t) => e.isOnHover = !1),
37
+ onClick: o[2] || (o[2] = (...t) => e.click && e.click(...t)),
38
+ onTouchstart: o[3] || (o[3] = (...t) => e.touchstart && e.touchstart(...t)),
39
+ onTouchend: o[4] || (o[4] = (...t) => e.touchend && e.touchend(...t)),
40
+ onMouseup: o[5] || (o[5] = (...t) => e.mouseup && e.mouseup(...t)),
41
+ onMousedown: o[6] || (o[6] = (...t) => e.mousedown && e.mousedown(...t)),
42
+ onKeydown: o[7] || (o[7] = g((...t) => e.keydownEnter && e.keydownEnter(...t), ["enter"])),
43
+ onMouseleave: o[8] || (o[8] = (t) => e.isButtonActive = !1),
44
+ disabled: e.disabled,
45
+ type: e.type,
46
+ style: k({ fontSize: e.fontSize, fontFamily: e.fontFamily, borderRadius: e.borderRadius, width: e.width, ...e.style }),
47
+ ref: "button"
48
+ }, [
49
+ e.badge ? (r(), a("div", {
50
+ key: 0,
51
+ class: "absolute right--9px top--9px bg-lightblue-400 fw-bold rounded-full z-3 px7px",
52
+ style: k({
53
+ background: e.badgeBg ?? void 0,
54
+ color: e.badgeColor ?? "#ffffff"
55
+ })
56
+ }, n(e.badge), 5)) : s("", !0),
57
+ e.icon ? (r(), a("span", {
58
+ key: 1,
59
+ class: i(["left-icon-animate", e.$slots.default && e.$refs?.button?.innerText?.trim?.()?.length ? "left-icon" : ""])
60
+ }, [
61
+ f("i", {
62
+ class: i(["fa", e.icon])
63
+ }, null, 2)
64
+ ], 2)) : s("", !0),
65
+ C(e.$slots, "default", {}, void 0, !0),
66
+ e.iconRight ? (r(), a("span", {
67
+ key: 2,
68
+ class: i(["right-icon-animate", e.$slots.default && e.$refs?.button?.innerText?.trim?.()?.length ? "right-icon" : ""])
69
+ }, [
70
+ f("i", {
71
+ class: i(["fa", e.iconRight])
72
+ }, null, 2)
73
+ ], 2)) : s("", !0),
74
+ (r(), w(B("style"), null, {
75
+ default: $(() => [
76
+ m("." + n(e.randomClass) + " { background: " + n(e.style?.bacground ?? e.currentBg + "!important") + "; box-shadow: none !important; color: " + n(e.currentColor) + " !important; border-color: " + n(e.currentBorderColor) + " !important; }", 1),
77
+ e.currentColorHover ? (r(), a(h, { key: 0 }, [
78
+ m("." + n(e.randomClass) + ":hover { color: " + n(e.style?.color ?? e.currentColorHover + "!important") + "; }", 1)
79
+ ], 64)) : s("", !0),
80
+ e.disabled ? s("", !0) : (r(), a(h, { key: 1 }, [
81
+ m("." + n(e.randomClass) + ":active { background: " + n(e.currentBgActive) + " !important; border-color: " + n(e.currentBorderColorActive) + " !important; color: " + n(e.currentColorActive) + " !important; opacity: 1 !important; " + n(e.boxShadowCss) + " !important; }", 1)
82
+ ], 64))
83
+ ]),
84
+ _: 1
85
+ })),
86
+ e.link && e.link?.startsWith("http") || e.link?.startsWith("//") ? (r(), a("a", {
87
+ key: 3,
88
+ class: "d-none",
89
+ ref: "link",
90
+ href: e.link,
91
+ target: "_blank"
92
+ }, " ", 8, H)) : !e.link && e.linkRevert && !e.linkRevert?.startsWith("http") && !e.linkRevert?.startsWith("//") ? (r(), a("a", {
93
+ key: 4,
94
+ class: "d-none",
95
+ ref: "link",
96
+ href: e.linkRevert,
97
+ target: "_blank"
98
+ }, " ", 8, M)) : s("", !0)
99
+ ], 46, z)
100
+ ], 8, S)) : s("", !0);
101
+ }
102
+ const P = /* @__PURE__ */ T(p, [["render", V], ["__scopeId", "data-v-dc6f3d3d"]]);
103
+ export {
104
+ P as default
105
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-XTHCsE6e.cjs"),t=require("vue"),u=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");var m=Object.getOwnPropertyDescriptor,p=(e,o,i,a)=>{for(var r=a>1?void 0:a?m(o,i):o,l=e.length-1,n;l>=0;l--)(n=e[l])&&(r=n(r)||r);return r};let s=class extends d.ButtonInherited{};s=p([d.VST],s);const f=["title","data-theme","data-offset","data-placement"],k=["title","data-theme","data-offset","data-placement","disabled","type"],y=["href"],g=["href"];function b(e,o,i,a,r,l){return e.showButton?(t.openBlock(),t.createElementBlock("span",{key:0,class:"d-inline-block relative",title:e.disabled?e.disabledTitle:"","data-theme":e.dataThemeInner,"data-offset":e.dataOffset,"data-placement":e.dataPlacement},[t.createElementVNode("button",{class:t.normalizeClass(["relative w100% h100% flex! items-center! justify-center!",{shine:e.shine,[e.randomClass+(e.isOnHover?" hover":"")]:!0}]),title:e.disabled?"":e.innerTitle,"data-theme":e.dataThemeInner,"data-offset":e.dataOffset,"data-placement":e.dataPlacement,onMouseover:o[0]||(o[0]=n=>e.isOnHover=!0),onMouseout:o[1]||(o[1]=n=>e.isOnHover=!1),onClick:o[2]||(o[2]=(...n)=>e.click&&e.click(...n)),onTouchstart:o[3]||(o[3]=(...n)=>e.touchstart&&e.touchstart(...n)),onTouchend:o[4]||(o[4]=(...n)=>e.touchend&&e.touchend(...n)),onMouseup:o[5]||(o[5]=(...n)=>e.mouseup&&e.mouseup(...n)),onMousedown:o[6]||(o[6]=(...n)=>e.mousedown&&e.mousedown(...n)),onKeydown:o[7]||(o[7]=t.withKeys((...n)=>e.keydownEnter&&e.keydownEnter(...n),["enter"])),onMouseleave:o[8]||(o[8]=n=>e.isButtonActive=!1),disabled:e.disabled,type:e.type,style:t.normalizeStyle({fontSize:e.fontSize,fontFamily:e.fontFamily,borderRadius:e.borderRadius,width:e.width,...e.style}),ref:"button"},[e.badge?(t.openBlock(),t.createElementBlock("div",{key:0,class:"absolute right--9px top--9px bg-lightblue-400 fw-bold rounded-full z-3 px7px",style:t.normalizeStyle({background:e.badgeBg??void 0,color:e.badgeColor??"#ffffff"})},t.toDisplayString(e.badge),5)):t.createCommentVNode("",!0),e.icon?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["left-icon-animate",e.$slots.default&&e.$refs?.button?.innerText?.trim?.()?.length?"left-icon":""])},[t.createElementVNode("i",{class:t.normalizeClass(["fa",e.icon])},null,2)],2)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",{},void 0,!0),e.iconRight?(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass(["right-icon-animate",e.$slots.default&&e.$refs?.button?.innerText?.trim?.()?.length?"right-icon":""])},[t.createElementVNode("i",{class:t.normalizeClass(["fa",e.iconRight])},null,2)],2)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent("style"),null,{default:t.withCtx(()=>[t.createTextVNode("."+t.toDisplayString(e.randomClass)+" { background: "+t.toDisplayString(e.style?.bacground??e.currentBg+"!important")+"; box-shadow: none !important; color: "+t.toDisplayString(e.currentColor)+" !important; border-color: "+t.toDisplayString(e.currentBorderColor)+" !important; }",1),e.currentColorHover?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("."+t.toDisplayString(e.randomClass)+":hover { color: "+t.toDisplayString(e.style?.color??e.currentColorHover+"!important")+"; }",1)],64)):t.createCommentVNode("",!0),e.disabled?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("."+t.toDisplayString(e.randomClass)+":active { background: "+t.toDisplayString(e.currentBgActive)+" !important; border-color: "+t.toDisplayString(e.currentBorderColorActive)+" !important; color: "+t.toDisplayString(e.currentColorActive)+" !important; opacity: 1 !important; "+t.toDisplayString(e.boxShadowCss)+" !important; }",1)],64))]),_:1})),e.link&&e.link?.startsWith("http")||e.link?.startsWith("//")?(t.openBlock(),t.createElementBlock("a",{key:3,class:"d-none",ref:"link",href:e.link,target:"_blank"}," ",8,y)):!e.link&&e.linkRevert&&!e.linkRevert?.startsWith("http")&&!e.linkRevert?.startsWith("//")?(t.openBlock(),t.createElementBlock("a",{key:4,class:"d-none",ref:"link",href:e.linkRevert,target:"_blank"}," ",8,g)):t.createCommentVNode("",!0)],46,k)],8,f)):t.createCommentVNode("",!0)}const v=u._export_sfc(s,[["render",b],["__scopeId","data-v-dc6f3d3d"]]);exports.default=v;
@@ -0,0 +1,40 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mt=require("./index-XTHCsE6e.cjs"),X=require("vue"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");var st="&#8203;";function $(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function at(t){return(function(e){if(Array.isArray(e))return $(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,i){if(e){if(typeof e=="string")return $(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,i)}})(t)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}var C={isEnabled:function(){var t;return(t=window.TAGIFY_DEBUG)===null||t===void 0||t},log:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n;this.isEnabled()&&(n=console).log.apply(n,["[Tagify]:"].concat(at(e)))},warn:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n;this.isEnabled()&&(n=console).warn.apply(n,["[Tagify]:"].concat(at(e)))}},H=function(t,e,i,n){return t=""+t,e=""+e,n&&(t=t.trim(),e=e.trim()),i?t==e:t.toLowerCase()==e.toLowerCase()},rt=function(t,e){return t&&Array.isArray(t)&&t.map((function(i){return et(i,e)}))};function et(t,e){var i,n={};for(i in t)e.indexOf(i)<0&&(n[i]=t[i]);return n}function J(t){return new DOMParser().parseFromString(t.trim(),"text/html").body.firstElementChild}function ot(t,e){for(e=e||"previous";t=t[e+"Sibling"];)if(t.nodeType==3)return t}function j(t){return typeof t=="string"?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/`|'/g,"&#039;"):t}function M(t){var e=Object.prototype.toString.call(t).split(" ")[1].slice(0,-1);return t===Object(t)&&e!="Array"&&e!="Function"&&e!="RegExp"&&e!="HTMLUnknownElement"}function w(t,e,i){var n,s;function a(r,o){for(var l in o)if(o.hasOwnProperty(l)){if(M(o[l])){M(r[l])?a(r[l],o[l]):r[l]=Object.assign({},o[l]);continue}if(Array.isArray(o[l])){r[l]=Object.assign([],o[l]);continue}r[l]=o[l]}}return n=t,((s=Object)!=null&&typeof Symbol<"u"&&s[Symbol.hasInstance]?s[Symbol.hasInstance](n):n instanceof s)||(t={}),a(t,e),i&&a(t,i),t}function lt(){var t=[],e={},i=!0,n=!1,s=void 0;try{for(var a,r=arguments[Symbol.iterator]();!(i=(a=r.next()).done);i=!0){var o=a.value,l=!0,d=!1,u=void 0;try{for(var c,g=o[Symbol.iterator]();!(l=(c=g.next()).done);l=!0){var p=c.value;M(p)?e[p.value]||(t.push(p),e[p.value]=1):t.includes(p)||t.push(p)}}catch(h){d=!0,u=h}finally{try{l||g.return==null||g.return()}finally{if(d)throw u}}}}catch(h){n=!0,s=h}finally{try{i||r.return==null||r.return()}finally{if(n)throw s}}return t}function W(t){return String.prototype.normalize?typeof t=="string"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:t}var dt=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function ut(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}function V(t){var e,i=vt.call(this,t),n=t==null||(e=t.classList)===null||e===void 0?void 0:e.contains(this.settings.classNames.tag);return i&&n}function ct(t){return vt.call(this,t)&&t?.closest(this.settings.classNames.tagSelector)}function vt(t){var e;return(t==null||(e=t.closest)===null||e===void 0?void 0:e.call(t,this.settings.classNames.namespaceSelector))===this.DOM.scope}function bt(t,e){var i=window.getSelection();return e=e||i.getRangeAt(0),typeof t=="string"&&(t=document.createTextNode(t)),e&&(e.deleteContents(),e.insertNode(t)),t}function v(t,e,i){return t?(e&&(t.__tagifyTagData=i?e:w({},t.__tagifyTagData||{},e)),t.__tagifyTagData):(C.warn("tag element doesn't exist",{tagElm:t,data:e}),e)}function A(t){if(t&&t.parentNode){var e=t,i=window.getSelection(),n=i.getRangeAt(0);i.rangeCount&&(n.setStartAfter(e),n.collapse(!0),i.removeAllRanges(),i.addRange(n))}}function wt(t,e){t.forEach((function(i){if(v(i.previousSibling)||!i.previousSibling){var n=document.createTextNode("​");i.before(n),e&&A(n)}}))}var G={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,focusInputOnRemove:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function Tt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ot(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{},n=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})))),n.forEach((function(s){Tt(t,s,i[s])}))}return t}function Dt(t,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):(function(i,n){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);s.push.apply(s,a)}return s})(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})),t}function Q(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function St(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function xt(t){return(function(e){if(Array.isArray(e))return Q(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,i){if(e){if(typeof e=="string")return Q(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,i)}})(t)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function It(){for(var t in this.dropdown={},this._dropdown)this.dropdown[t]=typeof this._dropdown[t]=="function"?this._dropdown[t].bind(this):this._dropdown[t];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var q,R,Et=(q=(function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{},n=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})))),n.forEach((function(s){St(t,s,i[s])}))}return t})({},{events:{binding:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e=this.dropdown.events.callbacks,i=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:e.onKeyDown.bind(this),onMouseOver:e.onMouseOver.bind(this),onMouseLeave:e.onMouseLeave.bind(this),onClick:e.onClick.bind(this),onScroll:e.onScroll.bind(this)},n=t?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[n]("scroll",i.position,!0),window[n]("resize",i.position),window[n]("keydown",i.onKeyDown)),this.DOM.dropdown[n]("mouseover",i.onMouseOver),this.DOM.dropdown[n]("mouseleave",i.onMouseLeave),this.DOM.dropdown[n]("mousedown",i.onClick),this.DOM.dropdown.content[n]("scroll",i.onScroll)},callbacks:{onKeyDown:function(t){var e=this;if(this.state.hasFocus&&!this.state.composing){var i=this.settings,n=i.dropdown.includeSelectedTags,s=this.DOM.dropdown.querySelector(i.classNames.dropdownItemActiveSelector),a=this.dropdown.getSuggestionDataByNode(s),r=i.mode=="mix",o=i.mode=="select";i.hooks.beforeKeyDown(t,{tagify:this}).then((function(l){switch(t.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":t.preventDefault();var d=e.dropdown.getAllSuggestionsRefs(),u=t.key=="ArrowUp"||t.key=="Up";s&&(s=e.dropdown.getNextOrPrevOption(s,!u)),s&&s.matches(i.classNames.dropdownItemSelector)||(s=d[u?d.length-1:0]),e.dropdown.highlightOption(s,!0);break;case"PageUp":case"PageDown":var c;t.preventDefault();var g=e.dropdown.getAllSuggestionsRefs(),p=Math.floor(e.DOM.dropdown.content.clientHeight/((c=g[0])===null||c===void 0?void 0:c.offsetHeight))||1,h=t.key==="PageUp";if(s){var f=g.indexOf(s),m=h?Math.max(0,f-p):Math.min(g.length-1,f+p);s=g[m]}else s=g[0];e.dropdown.highlightOption(s,!0);break;case"Home":case"End":t.preventDefault();var y=e.dropdown.getAllSuggestionsRefs();s=y[t.key==="Home"?0:y.length-1],e.dropdown.highlightOption(s,!0);break;case"Escape":case"Esc":e.dropdown.hide();break;case"ArrowRight":if(e.state.actions.ArrowLeft||i.autoComplete.rightKey)return;case"Tab":var S=!i.autoComplete.rightKey||!i.autoComplete.tabKey;if(!r&&!o&&s&&S&&!e.state.editing&&a){t.preventDefault();var x=e.dropdown.getMappedValue(a);return e.state.autoCompleteData=a,e.input.autocomplete.set.call(e,x),!1}return!0;case"Enter":t.preventDefault(),e.state.actions.selectOption=!0,setTimeout((function(){return e.state.actions.selectOption=!1}),100),i.hooks.suggestionClick(t,{tagify:e,tagData:a,suggestionElm:s}).then((function(){if(s){var b=n?s:e.dropdown.getNextOrPrevOption(s,!u);e.dropdown.selectOption(s,t,(function(){if(b){var _=b.getAttribute("value");b=e.dropdown.getSuggestionNodeByValue(_),e.dropdown.highlightOption(b)}}))}else e.dropdown.hide(),r||e.addTags(e.state.inputText.trim(),!0)})).catch((function(b){return C.warn(b)}));break;case"Backspace":if(r||e.state.editing.scope)return;var I=e.input.raw.call(e);I!=""&&I.charCodeAt(0)!=8203||(i.backspace===!0?e.removeTags():i.backspace=="edit"&&setTimeout(e.editTag.bind(e),0))}}))}},onMouseOver:function(t){var e=t.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(e)},onMouseLeave:function(t){this.dropdown.highlightOption()},onClick:function(t){var e=this;if(t.button==0&&t.target!=this.DOM.dropdown&&t.target!=this.DOM.dropdown.content){var i=t.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(i);this.state.actions.selectOption=!0,setTimeout((function(){return e.state.actions.selectOption=!1}),100),this.settings.hooks.suggestionClick(t,{tagify:this,tagData:n,suggestionElm:i}).then((function(){i?e.dropdown.selectOption(i,t):e.dropdown.hide()})).catch((function(s){return C.warn(s)}))}},onScroll:function(t){var e=t.target,i=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(i)})}}},refilter:function(t){t=t||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(t),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(t){for(var e,i=t&&t.getAttribute("value"),n=this.suggestedListItems.length;n--;){if(M(e=this.suggestedListItems[n])&&e.value==i)return e;if(e==i)return{value:e}}},getSuggestionNodeByValue:function(t){return this.dropdown.getAllSuggestionsRefs().find((function(e){return e.getAttribute("value")===t}))},getNextOrPrevOption:function(t){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.dropdown.getAllSuggestionsRefs(),n=i.findIndex((function(s){return s===t}));return e?i[n+1]:i[n-1]},highlightOption:function(t,e){var i,n=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(n),this.state.ddItemElm.removeAttribute("aria-selected")),!t)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);i=this.dropdown.getSuggestionDataByNode(t),this.state.ddItemData=i,this.state.ddItemElm=t,t.classList.add(n),t.setAttribute("aria-selected",!0),e&&(t.parentNode.scrollTop=t.clientHeight+t.offsetTop-t.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,i),this.dropdown.position())},selectOption:function(t,e,i){var n=this,s=this.settings,a=s.dropdown.includeSelectedTags,r=s.dropdown,o=r.clearOnSelect,l=r.closeOnSelect;if(!t)return this.addTags(this.state.inputText,!0),void(l&&this.dropdown.hide());e=e||{};var d=t.getAttribute("value"),u=d=="noMatch",c=s.mode=="mix",g=this.suggestedListItems.find((function(h){var f;return((f=h.value)!==null&&f!==void 0?f:h)==d}));if(this.trigger("dropdown:select",{data:g,elm:t,event:e}),g||u){if(this.state.editing){var p=this.normalizeTags([g])[0];g=s.transformTag.call(this,p)||p,this.onEditTagDone(null,w({__isValid:!0},g))}else this[c?"addMixTags":"addTags"]([g||this.input.raw.call(this)],o);(c||this.DOM.input.parentNode)&&(setTimeout((function(){n.DOM.input.focus(),n.toggleFocusClass(!0)})),l&&setTimeout(this.dropdown.hide.bind(this)),a?i&&i():(t.addEventListener("transitionend",(function(){n.dropdown.fillHeaderFooter(),setTimeout((function(){t.remove(),n.dropdown.refilter(),i&&i()}),100)}),{once:!0}),t.classList.add(this.settings.classNames.dropdownItemHidden)))}else l&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(t){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var e=this.dropdown.filterListItems("");return t||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems:function(t,e){var i,n,s,a,r,o,l=function(){var b,_,k=void 0,L=void 0;b=h[x],n=((_=Object)!=null&&typeof Symbol<"u"&&_[Symbol.hasInstance]?_[Symbol.hasInstance](b):b instanceof _)?h[x]:{value:h[x]};var T,O=Object.keys(n).some((function(D){return S.includes(D)}))?S:["value"];c.fuzzySearch&&!e.exact?(a=O.reduce((function(D,E){return D+" "+(n[E]||"")}),"").toLowerCase().trim(),c.accentedSearch&&(a=W(a),o=W(o)),k=a.indexOf(o)==0,L=a===o,T=a,s=o.toLowerCase().split(" ").every((function(D){return T.includes(D.toLowerCase())}))):(k=!0,s=O.some((function(D){var E=""+(n[D]||"");return c.accentedSearch&&(E=W(E),o=W(o)),c.caseSensitive||(E=E.toLowerCase()),L=E===o,e.exact?E===o:E.indexOf(o)==0}))),r=!c.includeSelectedTags&&i.isTagDuplicate(M(n)?n.value:n),s&&!r&&(L&&k?p.push(n):c.sortby=="startsWith"&&k?g.unshift(n):g.push(n))},d=this,u=this.settings,c=u.dropdown,g=(e=e||{},[]),p=[],h=u.whitelist,f=c.maxItems>=0?c.maxItems:1/0,m=c.includeSelectedTags,y=typeof c.sortby=="function",S=c.searchKeys,x=0;if(!(t=u.mode=="select"&&this.value.length&&this.value[0][u.tagTextProp]==t?"":t)||!S.length){g=m?h:h.filter((function(b){return!d.isTagDuplicate(M(b)?b.value:b)}));var I=y?c.sortby(g,o):g.slice(0,f);return this.state.dropdown.suggestions=I,I}for(o=c.caseSensitive?""+t:(""+t).toLowerCase();x<h.length;x++)i=this,l();return this.state.dropdown.suggestions=p.concat(g),I=y?c.sortby(p.concat(g),o):p.concat(g).slice(0,f),this.state.dropdown.suggestions=I,I},getMappedValue:function(t){var e=this.settings.dropdown.mapValueTo;return e?typeof e=="function"?e(t):t[e]||t.value:t.value},createListHTML:function(t){var e=this;return w([],t).map((function(i,n){typeof i!="string"&&typeof i!="number"||(i={value:i});var s=e.dropdown.getMappedValue(i);return s=typeof s=="string"&&e.settings.dropdown.escapeHTML?j(s):s,e.settings.templates.dropdownItem.apply(e,[Dt(Ot({},i),{mappedValue:s}),e])})).join("")}}),R=(R={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return xt(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(t){var e,i,n,s=this,a=this.settings,r=a.mode=="mix"&&!a.enforceWhitelist,o=!a.whitelist||!a.whitelist.length,l=a.dropdown.position=="manual";if(t=t===void 0?this.state.inputText:t,!(o&&!r&&!a.templates.dropdownItemNoMatch||a.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(t),t&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",t),a.templates.dropdownItemNoMatch&&(n=a.templates.dropdownItemNoMatch.call(this,{value:t}))),!n){if(this.suggestedListItems.length)t&&r&&!this.state.editing.scope&&!H(this.suggestedListItems[0].value,t)&&this.suggestedListItems.unshift({value:t});else{if(!t||!r||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:t}]}i=""+(M(e=this.suggestedListItems[0])?e.value:e),a.autoComplete&&i&&i.indexOf(t)==0&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(n),a.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(a.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=t||!0,this.state.dropdown.query=t,this.setStateSelection(),l||setTimeout((function(){s.dropdown.position(),s.dropdown.render()})),setTimeout((function(){s.trigger("dropdown:show",s.DOM.dropdown)}))}},hide:function(t){var e=this,i=this.DOM,n=i.scope,s=i.dropdown,a=this.settings.dropdown.position=="manual"&&!t;if(s&&document.body.contains(s)&&!a)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),s.parentNode.removeChild(s),setTimeout((function(){e.state.dropdown.visible=!1}),100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",s),this},toggle:function(t){this.dropdown[this.state.dropdown.visible&&!t?"hide":"show"]()},getAppendTarget:function(){var t=this.settings.dropdown;return typeof t.appendTarget=="function"?t.appendTarget():t.appendTarget},render:function(){var t,e,i,n=this,s=(t=this.DOM.dropdown,(i=t.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(i),e=i.clientHeight,i.parentNode.removeChild(i),e),a=this.settings,r=this.dropdown.getAppendTarget();return a.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(a.classNames.dropdownInital),this.dropdown.position(s),r.appendChild(this.DOM.dropdown),setTimeout((function(){return n.DOM.dropdown.classList.remove(a.classNames.dropdownInital)})))),this},fill:function(t){t=typeof t=="string"?t:this.dropdown.createListHTML(t||this.suggestedListItems);var e,i=this.settings.templates.dropdownContent.call(this,t);this.DOM.dropdown.content.innerHTML=(e=i)?e.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var t=this.dropdown.filterListItems(this.state.dropdown.query),e=this.parseTemplate("dropdownHeader",[t]),i=this.parseTemplate("dropdownFooter",[t]),n=this.dropdown.getHeaderRef(),s=this.dropdown.getFooterRef();e&&n?.parentNode.replaceChild(e,n),i&&s?.parentNode.replaceChild(i,s)},position:function(t){var e=this.settings.dropdown,i=this.dropdown.getAppendTarget();if(e.position!="manual"&&i){var n,s,a,r,o,l,d,u,c,g,p=this.DOM.dropdown,h=e.RTL,f=i===document.body,m=i===this.DOM.scope,y=f?window.pageYOffset:i.scrollTop,S=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,x=S.clientHeight,I=Math.max(S.clientWidth||0,window.innerWidth||0),b=I>480?e.position:"all",_=this.DOM[b=="input"?"input":"scope"];if(t=t||p.clientHeight,this.state.dropdown.visible){if(b=="text"?(a=(n=(function(){var T=document.getSelection();if(T.rangeCount){var O,D,E=T.getRangeAt(0),B=E.startContainer,K=E.startOffset;if(K>0)return(D=document.createRange()).setStart(B,K-1),D.setEnd(B,K),{left:(O=D.getBoundingClientRect()).right,top:O.top,bottom:O.bottom};if(B.getBoundingClientRect)return B.getBoundingClientRect()}return{left:-9999,top:-9999}})()).bottom,s=n.top,r=n.left,o="auto"):(l=(function(T){var O=0,D=0;for(T=T.parentNode;T&&T!=S;)O+=T.offsetTop||0,D+=T.offsetLeft||0,T=T.parentNode;return{top:O,left:D}})(i),n=_.getBoundingClientRect(),s=m?-1:n.top-l.top,a=(m?n.height:n.bottom-l.top)-1,r=m?-1:n.left-l.left,o=n.width+"px"),!f){var k=(function(){for(var T=0,O=e.appendTarget.parentNode;O;)T+=O.scrollTop||0,O=O.parentNode;return T})();s+=k,a+=k}var L;s=Math.floor(s),a=Math.ceil(a),u=I-r<120,c=((d=(L=e.placeAbove)!==null&&L!==void 0?L:x-n.bottom<t)?s:a)+y,g=r+(h&&n.width||0)+window.pageXOffset,g=b=="text"&&u?"right: 0;":"left: ".concat(g,"px;"),p.style.cssText="".concat(g," top: ").concat(c,"px; min-width: ").concat(o,"; max-width: ").concat(o),p.setAttribute("placement",d?"top":"bottom"),p.setAttribute("position",b)}}}})!=null?R:{},Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors(R)):(function(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i.push.apply(i,n)}return i})(Object(R)).forEach((function(t){Object.defineProperty(q,t,Object.getOwnPropertyDescriptor(R,t))})),q),F="@yaireo/tagify/",Mt={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},Nt={wrapper:function(t,e){return'<tags class="'.concat(e.classNames.namespace," ").concat(e.mode?"".concat(e.classNames[e.mode+"Mode"]):""," ").concat(t.className,`"
2
+ `).concat(e.readonly?"readonly":"",`
3
+ `).concat(e.disabled?"disabled":"",`
4
+ `).concat(e.required?"required":"",`
5
+ `).concat(e.mode==="select"?"spellcheck='false'":"",`
6
+ tabIndex="-1">
7
+ `).concat(this.settings.templates.input.call(this),`
8
+ `).concat(st,`
9
+ </tags>`)},input:function(){var t=this.settings,e=t.placeholder||st;return"<span ".concat(!t.readonly&&t.userInput?"contenteditable":"",' data-can-editable tabIndex="0" data-placeholder="').concat(e,'" aria-placeholder="').concat(t.placeholder||"",`"
10
+ class="`).concat(t.classNames.input,`"
11
+ role="textbox"
12
+ autocapitalize="false"
13
+ autocorrect="off"
14
+ aria-autocomplete="both"
15
+ aria-multiline="`).concat(t.mode=="mix",'"></span>')},tag:function(t,e){var i=e.settings;return'<tag title="'.concat(t.title||t.value,`"
16
+ contenteditable='false'
17
+ tabIndex="`).concat(i.a11y.focusableTags?0:-1,`"
18
+ class="`).concat(i.classNames.tag," ").concat(t.class||"",`"
19
+ `).concat(this.getAttributes(t),`>
20
+ <x title='' tabIndex="`).concat(i.a11y.focusableTags?0:-1,'" class="').concat(i.classNames.tagX,`" role='button' aria-label='remove tag'></x>
21
+ <div>
22
+ <span `).concat(i.mode==="select"&&i.userInput?"contenteditable='true'":"",` autocapitalize="false" autocorrect="off" spellcheck='false' class="`).concat(i.classNames.tagText,'">').concat(t[i.tagTextProp]||t.value,`</span>
23
+ </div>
24
+ </tag>`)},dropdown:function(t){var e=t.dropdown,i=e.position=="manual";return'<div class="'.concat(i?"":t.classNames.dropdown," ").concat(e.classname,'" role="listbox" aria-labelledby="dropdown" dir="').concat(e.RTL?"rtl":"",`">
25
+ <div data-selector='tagify-suggestions-wrapper' class="`).concat(t.classNames.dropdownWrapper,`"></div>
26
+ </div>`)},dropdownContent:function(t){var e=this.settings.templates,i=this.state.dropdown.suggestions;return`
27
+ `.concat(e.dropdownHeader.call(this,i),`
28
+ `).concat(t,`
29
+ `).concat(e.dropdownFooter.call(this,i),`
30
+ `)},dropdownItem:function(t){return"<div ".concat(this.getAttributes(t),`
31
+ class='`).concat(this.settings.classNames.dropdownItem," ").concat(this.isTagDuplicate(t.value)?this.settings.classNames.dropdownItemSelected:""," ").concat(t.class||"",`'
32
+ tabindex="0"
33
+ role="option">`).concat(t.mappedValue||t.value,"</div>")},dropdownHeader:function(t){return`<header data-selector='tagify-suggestions-header' class="`.concat(this.settings.classNames.dropdownHeader,'"></header>')},dropdownFooter:function(t){var e=t.length-this.settings.dropdown.maxItems;return e>0?`<footer data-selector='tagify-suggestions-footer' class="`.concat(this.settings.classNames.dropdownFooter,`">
34
+ `).concat(e,` more items. Refine your search.
35
+ </footer>`):""},dropdownItemNoMatch:null};function gt(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function ht(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function _t(t,e){return(function(i){if(Array.isArray(i))return i})(t)||(function(i,n){var s=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(s!=null){var a,r,o=[],l=!0,d=!1;try{for(s=s.call(i);!(l=(a=s.next()).done)&&(o.push(a.value),!n||o.length!==n);l=!0);}catch(u){d=!0,r=u}finally{try{l||s.return==null||s.return()}finally{if(d)throw r}}return o}})(t,e)||(function(i,n){if(i){if(typeof i=="string")return gt(i,n);var s=Object.prototype.toString.call(i).slice(8,-1);if(s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set")return Array.from(s);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return gt(i,n)}})(t,e)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function Y(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function P(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function pt(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function At(t,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):(function(i,n){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);s.push.apply(s,a)}return s})(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})),t}function Z(t){return(function(e){if(Array.isArray(e))return Y(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,i){if(e){if(typeof e=="string")return Y(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y(e,i)}})(t)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}var Ct={customBinding:function(){var t=this;this.customEventsList.forEach((function(e){t.on(e,t.settings.callbacks[e])}))},binding:function(){var t,e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],i=this.settings,n=this.events.callbacks,s=e?"addEventListener":"removeEventListener";if(!(this.state.mainEvents&&e||i.disabled||i.readonly)){for(var a in this.state.mainEvents=e,e&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),t=this.listeners.main=this.listeners.main||{keydown:["input",n.onKeydown.bind(this)],click:["scope",n.onClickScope.bind(this)],dblclick:i.mode!="select"&&["scope",n.onDoubleClickScope.bind(this)],paste:["input",n.onPaste.bind(this)],drop:["input",n.onDrop.bind(this)],compositionstart:["input",n.onCompositionStart.bind(this)],compositionend:["input",n.onCompositionEnd.bind(this)]})t[a]&&this.DOM[t[a][0]][s](a,t[a][1]);var r=this.listeners.main.inputMutationObserver||new MutationObserver(n.onInputDOMChange.bind(this));r.disconnect(),i.mode=="mix"&&r.observe(this.DOM.input,{childList:!0}),this.events.bindOriginaInputListener.call(this),e&&(this.listeners.main=void 0)}},bindOriginaInputListener:function(t){var e=(t||0)+500;this.listeners.main&&(clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(this.events.callbacks.observeOriginalInputValue.bind(this),e))},bindGlobal:function(t){var e,i=this.events.callbacks,n=t?"removeEventListener":"addEventListener";if(this.listeners&&(t||!this.listeners.global)){this.listeners.global=this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:i[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:i.onWindowKeyDown.bind(this)},{type:"focusin",target:this.DOM.scope,cb:i.onFocusBlur.bind(this)},{type:"focusout",target:this.DOM.scope,cb:i.onFocusBlur.bind(this)},{type:"click",target:document,cb:i.onClickAnywhere.bind(this),useCapture:!0}];var s=!0,a=!1,r=void 0;try{for(var o,l=this.listeners.global[Symbol.iterator]();!(s=(o=l.next()).done);s=!0)(e=o.value).target[n](e.type,e.cb,!!e.useCapture)}catch(d){a=!0,r=d}finally{try{s||l.return==null||l.return()}finally{if(a)throw r}}t&&(this.listeners.global=void 0)}},unbindGlobal:function(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur:function(t){var e,i,n=this.settings,s=ct.call(this,t.relatedTarget),a=V.call(this,t.target),r=t.target.classList.contains(n.classNames.tagX),o=t.type=="focusin",l=t.type=="focusout";r&&n.mode!="mix"&&n.focusInputOnRemove&&this.DOM.input.focus(),s&&o&&!a&&!r&&this.toggleFocusClass(this.state.hasFocus=+new Date);var d=t.target?this.trim(this.DOM.input.textContent):"",u=(i=this.value)===null||i===void 0||(e=i[0])===null||e===void 0?void 0:e[n.tagTextProp],c=n.dropdown.enabled>=0,g={relatedTarget:t.relatedTarget},p=this.state.actions.selectOption&&(c||!n.dropdown.closeOnSelect),h=this.state.actions.addNew&&c;if(l){if(t.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),n.onChangeAfterBlur&&this.triggerChangeEvent()}if(!(p||h||r))if(this.state.hasFocus=!(!o&&!s)&&+new Date,this.toggleFocusClass(this.state.hasFocus),n.mode!="mix"){if(o){if(!n.focusable)return;var f=n.dropdown.enabled===0&&!this.state.dropdown.visible,m=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector);return this.trigger("focus",g),void(f&&!a&&(this.dropdown.show(this.value.length?"":void 0),n.mode==="select"&&this.setRangeAtStartEnd(!1,m)))}if(l){if(this.trigger("blur",g),this.loading(!1),n.mode=="select"){if(this.value.length){var y=this.getTagElms()[0];d=this.trim(y.textContent)}u===d&&(d="")}d&&!this.state.actions.selectOption&&n.addTagOnBlur&&n.addTagOn.includes("blur")&&this.addTags(d,!0)}s||(this.DOM.input.removeAttribute("style"),this.dropdown.hide())}else o?this.trigger("focus",g):l&&(this.trigger("blur",g),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart:function(t){this.state.composing=!0},onCompositionEnd:function(t){this.state.composing=!1},onWindowKeyDown:function(t){var e,i=this.settings,n=document.activeElement,s=ct.call(this,n)&&this.DOM.scope.contains(n),a=n===this.DOM.input,r=s&&n.hasAttribute("readonly"),o=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector),l=this.state.dropdown.visible;if((t.key==="Tab"&&l||this.state.hasFocus||s&&!r)&&!a){e=n.nextElementSibling;var d=t.target.classList.contains(i.classNames.tagX);switch(t.key){case"Backspace":i.readonly||this.state.editing||(this.removeTags(n),(e||this.DOM.input).focus());break;case"Enter":if(d)return void this.removeTags(t.target.parentNode);i.a11y.focusableTags&&V.call(this,n)&&setTimeout(this.editTag.bind(this),0,n);break;case"ArrowDown":this.state.dropdown.visible||i.mode=="mix"||this.dropdown.show();break;case"Tab":o?.focus()}}},onKeydown:function(t){var e=this,i=this.settings;if(!this.state.composing&&i.userInput){i.mode=="select"&&i.enforceWhitelist&&this.value.length&&t.key!="Tab"&&t.preventDefault();var n=this.trim(t.target.textContent);this.trigger("keydown",{event:t}),i.hooks.beforeKeyDown(t,{tagify:this}).then((function(s){if(i.mode=="mix"){switch(t.key){case"Left":case"ArrowLeft":e.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(e.state.editing)return;var a=document.getSelection(),r=t.key=="Delete"&&a.anchorOffset==(a.anchorNode.length||0),o=a.anchorNode.previousSibling,l=a.anchorNode.nodeType==1||!a.anchorOffset&&o&&o.nodeType==1&&a.anchorNode.previousSibling;(function(S){var x=document.createElement("div");S.replace(/\&#?[0-9a-z]+;/gi,(function(I){return x.innerHTML=I,x.innerText}))})(e.DOM.input.innerHTML);var d,u,c,g=e.getTagElms(),p=a.anchorNode.length===1&&a.anchorNode.nodeValue=="​";if(i.backspace=="edit"&&l)return d=a.anchorNode.nodeType==1?null:a.anchorNode.previousElementSibling,setTimeout(e.editTag.bind(e),0,d),void t.preventDefault();if(dt()&&pt(l,Element))return c=ot(l),l.hasAttribute("readonly")||l.remove(),e.DOM.input.focus(),void setTimeout((function(){A(c),e.DOM.input.click()}));if(a.anchorNode.nodeName=="BR")return;if((r||l)&&a.anchorNode.nodeType==1?u=a.anchorOffset==0?r?g[0]:null:g[Math.min(g.length,a.anchorOffset)-1]:r?u=a.anchorNode.nextElementSibling:pt(l,Element)&&(u=l),a.anchorNode.nodeType==3&&!a.anchorNode.nodeValue&&a.anchorNode.previousElementSibling&&t.preventDefault(),(l||r)&&!i.backspace||a.type!="Range"&&!a.anchorOffset&&a.anchorNode==e.DOM.input&&t.key!="Delete")return void t.preventDefault();if(a.type!="Range"&&u&&u.hasAttribute("readonly"))return void A(ot(u));t.key=="Delete"&&p&&v(a.anchorNode.nextSibling)&&e.removeTags(a.anchorNode.nextSibling);break;case"Enter":if(t.preventDefault(),e.state.tag)return;var h=window.getSelection();h.getRangeAt(0).insertNode(document.createElement("br")),h.collapseToEnd()}return!0}var f=i.dropdown.position=="manual";switch(t.key){case"Backspace":i.mode=="select"&&i.enforceWhitelist&&e.value.length?e.removeTags():e.state.dropdown.visible&&i.dropdown.position!="manual"||t.target.textContent!=""&&n.charCodeAt(0)!=8203||(i.backspace===!0?e.removeTags():i.backspace=="edit"&&setTimeout(e.editTag.bind(e),0));break;case"Esc":case"Escape":if(e.state.dropdown.visible)return;t.target.blur();break;case"Down":case"ArrowDown":e.state.dropdown.visible||e.dropdown.show();break;case"ArrowRight":var m=e.state.inputSuggestion||e.state.ddItemData;if(m&&i.autoComplete.rightKey)return void e.addTags([m],!0);break;case"Tab":return!0;case"Enter":if(e.state.dropdown.visible&&!f)return;t.preventDefault();var y=e.state.autoCompleteData||n;setTimeout((function(){e.state.dropdown.visible&&!f||e.state.actions.selectOption||!i.addTagOn.includes(t.key.toLowerCase())||(e.addTags([y],!0),e.state.autoCompleteData=null)}))}})).catch((function(s){return s}))}},onInput:function(t){this.postUpdate();var e=this.settings;if(e.mode=="mix")return this.events.callbacks.onMixTagsInput.call(this,t);var i=this.input.normalize.call(this,void 0,{trim:!1}),n=i.length>=e.dropdown.enabled,s={value:i,inputElm:this.DOM.input},a=this.validateTag({value:i});e.mode=="select"&&this.toggleScopeValidation(a),s.isValid=a,this.state.inputText!=i&&(this.input.set.call(this,i,!1),i.search(e.delimiters)!=-1?this.addTags(i)&&this.input.set.call(this):e.dropdown.enabled>=0&&this.dropdown[n?"show":"hide"](i),this.trigger("input",s))},onMixTagsInput:function(t){var e,i,n,s,a,r,o,l,d=this,u=this.settings,c=this.value.length,g=this.getTagElms(),p=document.createDocumentFragment(),h=window.getSelection().getRangeAt(0),f=[].map.call(g,(function(m){return v(m).value}));if(t.inputType=="deleteContentBackward"&&dt()&&this.events.callbacks.onKeydown.call(this,{target:t.target,key:"Backspace"}),wt(this.getTagElms()),this.value.slice().forEach((function(m){m.readonly&&!f.includes(m.value)&&p.appendChild(d.createTagElem(m))})),p.childNodes.length&&(h.insertNode(p),this.setRangeAtStartEnd(!1,p.lastChild)),g.length!=c)return this.value=[].map.call(this.getTagElms(),(function(m){return v(m)})),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(r=window.getSelection()).rangeCount>0&&r.anchorNode.nodeType==3){if((h=r.getRangeAt(0).cloneRange()).collapse(!0),h.setStart(r.focusNode,0),n=(e=h.toString().slice(0,h.endOffset)).split(u.pattern).length-1,(i=e.match(u.pattern))&&(s=e.slice(e.lastIndexOf(i[i.length-1]))),s){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:s.match(u.pattern)[0],value:s.replace(u.pattern,"")},this.state.tag.baseOffset=r.baseOffset-this.state.tag.value.length,l=this.state.tag.value.match(u.delimiters))return this.state.tag.value=this.state.tag.value.replace(u.delimiters,""),this.state.tag.delimiters=l[0],this.addTags(this.state.tag.value,u.dropdown.clearOnSelect),void this.dropdown.hide();a=this.state.tag.value.length>=u.dropdown.enabled;try{o=(o=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&o.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch{}(o||n<this.state.mixMode.matchedPatternCount)&&(a=!1)}else this.state.flaggedTags={};this.state.mixMode.matchedPatternCount=n}setTimeout((function(){d.update({withoutChangeEvent:!0}),d.trigger("input",w({},d.state.tag,{textContent:d.DOM.input.textContent})),d.state.tag&&d.dropdown[a?"show":"hide"](d.state.tag.value)}),10)},onInputIE:function(t){var e=this;setTimeout((function(){e.events.callbacks.onInput.call(e,t)}))},observeOriginalInputValue:function(){this.DOM.originalInput.parentNode||this.destroy(),this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickAnywhere:function(t){if(t.target!=this.DOM.scope&&!this.DOM.scope.contains(t.target)){this.toggleFocusClass(!1),this.state.hasFocus=!1;var e=t.target.closest(this.settings.classNames.dropdownSelector);e?.__tagify!=this&&this.dropdown.hide()}},onClickScope:function(t){var e=this.settings,i=t.target.closest("."+e.classNames.tag);t.target,this.DOM.scope;var n=+new Date-this.state.hasFocus;if(!t.target.classList.contains(e.classNames.tagX))return i&&!this.state.editing?(this.trigger("click",{tag:i,index:this.getNodeIndex(i),data:v(i),event:t}),void(e.editTags!==1&&e.editTags.clicks!==1&&e.mode!="select"||this.events.callbacks.onDoubleClickScope.call(this,t))):void(t.target==this.DOM.input&&(e.mode=="mix"&&this.fixFirefoxLastTagNoCaret(),n>500||!e.focusable)?this.state.dropdown.visible?this.dropdown.hide():e.dropdown.enabled===0&&e.mode!="mix"&&this.dropdown.show(this.value.length?"":void 0):e.mode!="select"||e.dropdown.enabled!==0||this.state.dropdown.visible||(this.events.callbacks.onDoubleClickScope.call(this,At((function(s){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{},o=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})))),o.forEach((function(l){P(s,l,r[l])}))}return s})({},t),{target:this.getTagElms()[0]})),!e.userInput&&this.dropdown.show()));this.removeTags(t.target.parentNode)},onPaste:function(t){var e=this;t.preventDefault();var i,n,s,a=this.settings;if(!a.userInput)return!1;a.readonly||(n=t.clipboardData||window.clipboardData,s=n.getData("Text"),a.hooks.beforePaste(t,{tagify:this,pastedText:s,clipboardData:n}).then((function(r){r===void 0&&(r=s),r&&(e.injectAtCaret(r,window.getSelection().getRangeAt(0)),e.settings.mode=="mix"?e.events.callbacks.onMixTagsInput.call(e,t):e.settings.pasteAsTags?i=e.addTags(e.state.inputText+r,!0):(e.state.inputText=r,e.dropdown.show(r))),e.trigger("paste",{event:t,pastedText:s,clipboardData:n,tagsElems:i})})).catch((function(r){return r})))},onDrop:function(t){t.preventDefault()},onEditTagInput:function(t,e){var i,n=t.closest("."+this.settings.classNames.tag),s=this.getNodeIndex(n),a=v(n),r=this.input.normalize.call(this,t),o=(P(i={},this.settings.tagTextProp,r),P(i,"__tagId",a.__tagId),i),l=this.validateTag(o);this.editTagChangeDetected(w(a,o))||t.originalIsValid!==!0||(l=!0),n.classList.toggle(this.settings.classNames.tagInvalid,l!==!0),a.__isValid=l,n.title=l===!0?a.title||a.value:l,r.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=r),this.dropdown.show(r)),this.trigger("edit:input",{tag:n,index:s,data:w({},this.value[s],{newValue:r}),event:e})},onEditTagPaste:function(t,e){var i=(e.clipboardData||window.clipboardData).getData("Text");e.preventDefault();var n=bt(i);this.setRangeAtStartEnd(!1,n)},onEditTagClick:function(t,e){this.events.callbacks.onClickScope.call(this,e)},onEditTagFocus:function(t){this.state.editing={scope:t,input:t.querySelector("[contenteditable]")}},onEditTagBlur:function(t,e){var i=V.call(this,e.relatedTarget);if(this.settings.mode=="select"&&i&&e.relatedTarget.contains(e.target))this.dropdown.hide();else if(this.state.editing&&(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(document.activeElement)||this.trigger("blur",{}),this.DOM.scope.contains(t))){var n,s,a,r=this.settings,o=t.closest("."+r.classNames.tag),l=v(o),d=this.input.normalize.call(this,t),u=(P(n={},r.tagTextProp,d),P(n,"__tagId",l.__tagId),n),c=l.__originalData,g=this.editTagChangeDetected(w(l,u)),p=this.validateTag(u);if(d)if(g){var h;if(s=this.hasMaxTags(),a=w({},c,(P(h={},r.tagTextProp,this.trim(d)),P(h,"__isValid",p),h)),r.transformTag.call(this,a,c),(p=(!s||c.__isValid===!0)&&this.validateTag(a))!==!0){if(this.trigger("invalid",{data:a,tag:o,message:p}),r.editTags.keepInvalid)return;r.keepInvalidTags?a.__isValid=p:a=c}else r.keepInvalidTags&&(delete a.title,delete a["aria-invalid"],delete a.class);this.onEditTagDone(o,a)}else this.onEditTagDone(o,c);else this.onEditTagDone(o)}},onEditTagkeydown:function(t,e){if(!this.state.composing)switch(this.trigger("edit:keydown",{event:t}),t.key){case"Esc":case"Escape":this.state.editing=!1,e.__tagifyTagData.__originalData.value?e.parentNode.replaceChild(e.__tagifyTagData.__originalHTML,e):e.remove();break;case"Enter":case"Tab":t.preventDefault(),setTimeout((function(){return t.target.blur()}),0)}},onDoubleClickScope:function(t){var e=t.target.closest("."+this.settings.classNames.tag);if(e){var i,n,s=v(e),a=this.settings;s?.editable!==!1&&(i=e.classList.contains(this.settings.classNames.tagEditing),n=e.hasAttribute("readonly"),a.readonly||i||n||!this.settings.editTags||!a.userInput||(this.events.callbacks.onEditTagFocus.call(this,e),this.editTag(e)),this.toggleFocusClass(!0),a.mode!="select"&&this.trigger("dblclick",{tag:e,index:this.getNodeIndex(e),data:v(e)}))}},onInputDOMChange:function(t){var e=this;t.forEach((function(n){n.addedNodes.forEach((function(s){if(s.outerHTML=="<div><br></div>")s.replaceWith(document.createElement("br"));else if(s.nodeType==1&&s.querySelector(e.settings.classNames.tagSelector)){var a,r=document.createTextNode("");s.childNodes[0].nodeType==3&&s.previousSibling.nodeName!="BR"&&(r=document.createTextNode(`
36
+ `)),(a=s).replaceWith.apply(a,Z([r].concat(Z(Z(s.childNodes).slice(0,-1))))),A(r)}else if(V.call(e,s)){var o;if(((o=s.previousSibling)===null||o===void 0?void 0:o.nodeType)!=3||s.previousSibling.textContent||s.previousSibling.remove(),s.previousSibling&&s.previousSibling.nodeName=="BR"){s.previousSibling.replaceWith(`
37
+ ​`);for(var l=s.nextSibling,d="";l;)d+=l.textContent,l=l.nextSibling;d.trim()&&A(s.previousSibling)}else s.previousSibling&&!v(s.previousSibling)||s.before("​")}})),n.removedNodes.forEach((function(s){s&&s.nodeName=="BR"&&V.call(e,i)&&(e.removeTags(i),e.fixFirefoxLastTagNoCaret())}))}));var i=this.DOM.input.lastChild;i&&i.nodeValue==""&&i.remove(),i&&i.nodeName=="BR"||this.DOM.input.appendChild(document.createElement("br"))}}};function tt(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function it(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function N(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function ft(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{},n=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})))),n.forEach((function(s){it(t,s,i[s])}))}return t}function U(t){return(function(e){if(Array.isArray(e))return tt(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,i){if(e){if(typeof e=="string")return tt(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tt(e,i)}})(t)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function z(t,e){if(!t){C.warn("input element not found",t);var i=new Proxy(this,{get:function(){return function(){return i}}});return i}if(t.__tagify)return C.warn("input element is already Tagified - Same instance is returned.",t),t.__tagify;var n;w(this,(function(s){var a=document.createTextNode(""),r={};function o(l,d,u){u&&d.split(/\s+/g).forEach((function(c){return a[l+"EventListener"].call(a,c,u)}))}return{removeAllCustomListeners:function(){Object.entries(r).forEach((function(l){var d=_t(l,2),u=d[0];d[1].forEach((function(c){return o("remove",u,c)}))})),r={}},off:function(l,d){return l&&(d?o("remove",l,d):l.split(/\s+/g).forEach((function(u){var c;(c=r[u])===null||c===void 0||c.forEach((function(g){return o("remove",u,g)})),delete r[u]}))),this},on:function(l,d){return d&&typeof d=="function"&&(l.split(/\s+/g).forEach((function(u){Array.isArray(r[u])?r[u].push(d):r[u]=[d]})),o("add",l,d)),this},trigger:function(l,d,u){var c;if(u=u||{cloneData:!0},l)if(s.settings.isJQueryPlugin)l=="remove"&&(l="removeTag"),jQuery(s.DOM.originalInput).triggerHandler(l,[d]);else{try{var g=typeof d=="object"?d:{value:d};if((g=u.cloneData?w({},g):g).tagify=this,d.event&&(g.event=this.cloneEvent(d.event)),ht(d,Object))for(var p in d)ht(d[p],HTMLElement)&&(g[p]=d[p]);c=new CustomEvent(l,{detail:g})}catch(h){C.warn(h)}a.dispatchEvent(c)}}}})(this)),this.isFirefox=/firefox|fxios/i.test(navigator.userAgent)&&!/seamonkey/i.test(navigator.userAgent),this.isIE=window.document.documentMode,e=e||{},this.getPersistedData=(n=e.id,function(s){var a;if(n){var r,o="/"+s;if(((a=localStorage)===null||a===void 0?void 0:a.getItem(F+n+"/v"))===1)try{r=JSON.parse(localStorage[F+n+o])}catch{}return r}}),this.setPersistedData=(function(s){var a;return s?((a=localStorage)===null||a===void 0||a.setItem(F+s+"/v",1),function(r,o){var l,d="/"+o,u=JSON.stringify(r);r&&o&&((l=localStorage)===null||l===void 0||l.setItem(F+s+d,u),dispatchEvent(new Event("storage")))}):function(){}})(e.id),this.clearPersistedData=(function(s){return function(a){var r=F+"/"+s+"/";if(a)localStorage.removeItem(r+a);else for(var o in localStorage)o.includes(r)&&localStorage.removeItem(o)}})(e.id),this.applySettings(t,e),this.state={inputText:"",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(t),It.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),t.autofocus&&this.DOM.input.focus(),t.__tagify=this}z.prototype={_dropdown:Et,placeCaretAfterNode:A,getSetTagData:v,helpers:{sameStr:H,removeCollectionProp:rt,omit:et,isObject:M,parseHTML:J,escapeHTML:j,extend:w,concatWithoutDups:lt,getUID:ut,isNodeTag:V},customEventsList:["change","add","remove","invalid","input","paste","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim:function(t){return this.settings.trim&&t&&typeof t=="string"?t.trim():t},parseHTML:J,templates:Nt,parseTemplate:function(t,e){return J((t=this.settings.templates[t]||t).apply(this,e))},set whitelist(t){var e=t&&Array.isArray(t);this.settings.whitelist=e?t:[],this.setPersistedData(e?t:[],"whitelist")},get whitelist(){return this.settings.whitelist},set userInput(t){this.settings.userInput=!!t,this.setContentEditable(!!t)},get userInput(){return this.settings.userInput},generateClassSelectors:function(t){var e=function(n){var s=n;Object.defineProperty(t,s+"Selector",{get:function(){return"."+this[s].split(" ")[0]}})};for(var i in t)e(i)},applySettings:function(t,e){var i,n;G.templates=this.templates;var s=w({},G,e.mode=="mix"?{dropdown:{position:"text"}}:{}),a=this.settings=w({},s,e);if(a.disabled=t.hasAttribute("disabled"),a.readonly=a.readonly||t.hasAttribute("readonly"),a.placeholder=j(t.getAttribute("placeholder")||a.placeholder||""),a.required=t.hasAttribute("required"),this.generateClassSelectors(a.classNames),this.isIE&&(a.autoComplete=!1),["whitelist","blacklist"].forEach((function(o){var l=t.getAttribute("data-"+o);l&&N(l=l.split(a.delimiters),Array)&&(a[o]=l)})),"autoComplete"in e&&!M(e.autoComplete)&&(a.autoComplete=G.autoComplete,a.autoComplete.enabled=e.autoComplete),a.mode=="mix"&&(a.pattern=a.pattern||/@/,a.autoComplete.rightKey=!0,a.delimiters=e.delimiters||null,a.tagTextProp&&!a.dropdown.searchKeys.includes(a.tagTextProp)&&a.dropdown.searchKeys.push(a.tagTextProp)),t.pattern)try{a.pattern=new RegExp(t.pattern)}catch{}if(a.delimiters){a._delimiters=a.delimiters;try{a.delimiters=new RegExp(this.settings.delimiters,"g")}catch{}}(a.disabled||a.readonly)&&(a.userInput=!1),this.TEXTS=ft({},Mt,a.texts||{}),a.mode=="select"&&(a.dropdown.includeSelectedTags=!0),(a.mode!="select"||!((i=e.dropdown)===null||i===void 0)&&i.enabled)&&a.userInput||(a.dropdown.enabled=0),a.disabled&&(a.dropdown.enabled=!1),a.dropdown.appendTarget=((n=e.dropdown)===null||n===void 0?void 0:n.appendTarget)||document.body,a.dropdown.includeSelectedTags===void 0&&(a.dropdown.includeSelectedTags=a.duplicates);var r=this.getPersistedData("whitelist");Array.isArray(r)&&(this.whitelist=Array.isArray(a.whitelist)?lt(a.whitelist,r):r)},getAttributes:function(t){var e,i=this.getCustomAttributes(t),n="";for(e in i)n+=" "+e+(t[e]!==void 0?'="'.concat(i[e],'"'):"");return n},getCustomAttributes:function(t){if(!M(t))return"";var e,i={};for(e in t)e.slice(0,2)!="__"&&e!="class"&&t.hasOwnProperty(e)&&t[e]!==void 0&&(i[e]=j(t[e]));return i},setStateSelection:function(){var t=window.getSelection(),e={anchorOffset:t.anchorOffset,anchorNode:t.anchorNode,range:t.getRangeAt&&t.rangeCount&&t.getRangeAt(0)};return this.state.selection=e,e},getCSSVars:function(){var t,e,i,n=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(t=(function(s){if(!s)return{};var a=(s=s.trim().split(" ")[0]).split(/\d+/g).filter((function(r){return r})).pop().trim();return{value:+s.split(a).filter((function(r){return r}))[0].trim(),unit:a}})((i="tag-hide-transition",n.getPropertyValue("--"+i))),e=t.value,t.unit=="s"?1e3*e:e)}},build:function(t){var e=this.DOM,i=t.closest("label");this.settings.mixMode.integrated?(e.originalInput=null,e.scope=t,e.input=t):(e.originalInput=t,e.originalInput_tabIndex=t.tabIndex,e.scope=this.parseTemplate("wrapper",[t,this.settings]),e.input=e.scope.querySelector(this.settings.classNames.inputSelector),t.parentNode.insertBefore(e.scope,t),t.tabIndex=-1),i&&i.setAttribute("for","")},destroy:function(){var t,e,i;this.events.unbindGlobal.call(this),(t=this.DOM.scope.parentNode)===null||t===void 0||t.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),this.removeAllCustomListeners(),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval((i=this.listeners)===null||i===void 0||(e=i.main)===null||e===void 0?void 0:e.originalInputValueObserverInterval)},loadOriginalValues:function(t){var e,i=this.settings;if(this.state.blockChangeEvent=!0,t===void 0){var n=this.getPersistedData("value");t=n&&!this.DOM.originalInput.value?n:i.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),t)if(i.mode=="mix")this.parseMixTags(t),(e=this.DOM.input.lastChild)&&e.tagName=="BR"||this.DOM.input.insertAdjacentHTML("beforeend","<br>");else{try{N(JSON.parse(t),Array)&&(t=JSON.parse(t))}catch{}this.addTags(t,!0).forEach((function(s){return s&&s.classList.add(i.classNames.tagNoAnimation)}))}else this.postUpdate();this.state.lastOriginalValueReported=i.mixMode.integrated?"":this.DOM.originalInput.value},cloneEvent:function(t){var e={};for(var i in t)i!="path"&&(e[i]=t[i]);return e},loading:function(t){return this.state.isLoading=t,this.DOM.scope.classList[t?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading:function(t,e){return t&&t.classList[e?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass:function(t,e){typeof t=="string"&&this.DOM.scope.classList.toggle(t,e)},toggleScopeValidation:function(t){var e=t===!0||t===void 0;!this.settings.required&&t&&t===this.TEXTS.empty&&(e=!0),this.toggleClass(this.settings.classNames.tagInvalid,!e),this.DOM.scope.title=e?"":t},toggleFocusClass:function(t){this.toggleClass(this.settings.classNames.focus,!!t)},setPlaceholder:function(t){var e=this;["data","aria"].forEach((function(i){return e.DOM.input.setAttribute("".concat(i,"-placeholder"),t)}))},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var t=this.DOM.originalInput,e=this.state.lastOriginalValueReported!==t.value,i=new CustomEvent("change",{bubbles:!0});e&&(this.state.lastOriginalValueReported=t.value,i.simulated=!0,t._valueTracker&&t._valueTracker.setValue(Math.random()),t.dispatchEvent(i),this.trigger("change",this.state.lastOriginalValueReported),t.value=this.state.lastOriginalValueReported)}},events:Ct,fixFirefoxLastTagNoCaret:function(){},setRangeAtStartEnd:function(t,e){if(e){t=typeof t=="number"?t:!!t,e=e.lastChild||e;var i=document.getSelection();if(N(i.focusNode,Element)&&!this.DOM.input.contains(i.focusNode))return!0;try{i.rangeCount>=1&&["Start","End"].forEach((function(n){return i.getRangeAt(0)["set"+n](e,t||e.length)}))}catch(n){console.warn(n)}}},insertAfterTag:function(t,e){if(e=e||this.settings.mixMode.insertAfterTag,t&&t.parentNode&&e)return e=typeof e=="string"?document.createTextNode(e):e,t.parentNode.insertBefore(e,t.nextSibling),e},editTagChangeDetected:function(t){var e=t.__originalData;for(var i in e)if(!this.dataProps.includes(i)&&t[i]!=e[i])return!0;return!1},getTagTextNode:function(t){return t.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode:function(t,e){this.getTagTextNode(t).innerHTML=j(e)},editTag:function(t,e){var i=this;t=t||this.getLastTag(),e=e||{};var n=this.settings,s=this.getTagTextNode(t),a=this.getNodeIndex(t),r=v(t),o=this.events.callbacks,l=!0,d=n.mode=="select";if(!d&&this.dropdown.hide(),s){if(!N(r,Object)||!("editable"in r)||r.editable)return r=v(t,{__originalData:w({},r),__originalHTML:t.cloneNode(!0)}),v(r.__originalHTML,r.__originalData),s.setAttribute("contenteditable",!0),t.classList.add(n.classNames.tagEditing),this.events.callbacks.onEditTagFocus.call(this,t),s.addEventListener("click",o.onEditTagClick.bind(this,t)),s.addEventListener("blur",o.onEditTagBlur.bind(this,this.getTagTextNode(t))),s.addEventListener("input",o.onEditTagInput.bind(this,s)),s.addEventListener("paste",o.onEditTagPaste.bind(this,s)),s.addEventListener("keydown",(function(u){return o.onEditTagkeydown.call(i,u,t)})),s.addEventListener("compositionstart",o.onCompositionStart.bind(this)),s.addEventListener("compositionend",o.onCompositionEnd.bind(this)),e.skipValidation||(l=this.editTagToggleValidity(t)),s.originalIsValid=l,this.trigger("edit:start",{tag:t,index:a,data:r,isValid:l}),s.focus(),!d&&this.setRangeAtStartEnd(!1,s),n.dropdown.enabled===0&&!d&&this.dropdown.show(),this.state.hasFocus=!0,this}else C.warn("Cannot find element in Tag template: .",n.classNames.tagTextSelector)},editTagToggleValidity:function(t,e){var i;if(e=e||v(t))return(i=!("__isValid"in e)||e.__isValid===!0)||this.removeTagsFromValue(t),this.update(),t.classList.toggle(this.settings.classNames.tagNotAllowed,!i),e.__isValid=i,e.__isValid;C.warn("tag has no data: ",t,e)},onEditTagDone:function(t,e){t=t||this.state.editing.scope,e=e||{};var i,n,s=this.settings,a={tag:t,index:this.getNodeIndex(t),previousData:v(t),data:e};this.trigger("edit:beforeUpdate",a,{cloneData:!1}),this.state.editing=!1,delete e.__originalData,delete e.__originalHTML,t&&t.parentNode&&(((n=e[s.tagTextProp])!==void 0?!((i=(n+="").trim)===null||i===void 0)&&i.call(n):!(s.tagTextProp in e)&&e.value)?(t=this.replaceTag(t,e),this.editTagToggleValidity(t,e),s.a11y.focusableTags?t.focus():s.mode!="select"&&A(t)):this.removeTags(t)),this.trigger("edit:updated",a),s.dropdown.closeOnSelect&&this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag:function(t,e){e&&e.value!==""&&e.value!==void 0||(e=t.__tagifyTagData),e.__isValid&&e.__isValid!=1&&w(e,this.getInvalidTagAttrs(e,e.__isValid));var i=this.createTagElem(e);return t.parentNode.replaceChild(i,t),this.updateValueByDOMTags(),i},updateValueByDOMTags:function(){var t=this;this.value.length=0;var e=this.settings.classNames,i=[e.tagNotAllowed.split(" ")[0],e.tagHide];[].forEach.call(this.getTagElms(),(function(n){U(n.classList).some((function(s){return i.includes(s)}))||t.value.push(v(n))})),this.update(),this.dropdown.refilter()},injectAtCaret:function(t,e){var i;if(e=e||((i=this.state.selection)===null||i===void 0?void 0:i.range),typeof t=="string"&&(t=document.createTextNode(t)),!e&&t)return this.appendMixTags(t),this;if(!this.DOM.scope.contains(e?.startContainer))return this;var n=bt(t,e);return this.setRangeAtStartEnd(!1,n),this.updateValueByDOMTags(),this.update(),this},input:{set:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.settings,n=i.dropdown.closeOnSelect;this.state.inputText=t,e&&(this.DOM.input.innerHTML=j(""+t),t&&this.toggleClass(i.classNames.empty,!this.DOM.input.innerHTML)),!t&&n&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw:function(){return this.DOM.input.textContent},validate:function(){var t=!this.state.inputText||this.validateTag({value:this.state.inputText})===!0;return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!t),t},normalize:function(t,e){var i=t||this.DOM.input,n=[];i.childNodes.forEach((function(s){return s.nodeType==3&&n.push(s.nodeValue)})),n=n.join(`
38
+ `);try{n=n.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch{}return n=n.replace(/\s/g," "),e?.trim?this.trim(n):n},autocomplete:{suggest:function(t){if(this.settings.autoComplete.enabled){typeof(t=t||{value:""})!="object"&&(t={value:t});var e=this.dropdown.getMappedValue(t);if(typeof e!="number"){var i=this.state.inputText.toLowerCase(),n=e.substr(0,this.state.inputText.length).toLowerCase(),s=e.substring(this.state.inputText.length);e&&this.state.inputText&&n==i?(this.DOM.input.setAttribute("data-suggest",s),this.state.inputSuggestion=t):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}}},set:function(t){var e=this.DOM.input.getAttribute("data-suggest"),i=t||(e?this.state.inputText+e:null);return!!i&&(this.settings.mode=="mix"?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+i)):(this.input.set.call(this,i),this.setRangeAtStartEnd(!1,this.DOM.input)),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx:function(t){return this.value.findIndex((function(e){return e.__tagId==(t||{}).__tagId}))},getNodeIndex:function(t){var e=0;if(t)for(;t=t.previousElementSibling;)e++;return e},getTagElms:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var n="."+U(this.settings.classNames.tag.split(" ")).concat(U(e)).join(".");return[].slice.call(this.DOM.scope.querySelectorAll(n))},getLastTag:function(){var t=this.settings.classNames,e=this.DOM.scope.querySelectorAll("".concat(t.tagSelector,":not(.").concat(t.tagHide,"):not([readonly])"));return e[e.length-1]},isTagDuplicate:function(t,e,i){var n=0,s=!0,a=!1,r=void 0;try{for(var o,l=this.value[Symbol.iterator]();!(s=(o=l.next()).done);s=!0){var d=o.value;H(this.trim(""+t),d.value,e)&&i!=d.__tagId&&n++}}catch(u){a=!0,r=u}finally{try{s||l.return==null||l.return()}finally{if(a)throw r}}return n},getTagIndexByValue:function(t){var e=this,i=[],n=this.settings.dropdown.caseSensitive;return this.getTagElms().forEach((function(s,a){s.__tagifyTagData&&H(e.trim(s.__tagifyTagData.value),t,n)&&i.push(a)})),i},getTagElmByValue:function(t){var e=this.getTagIndexByValue(t)[0];return this.getTagElms()[e]},flashTag:function(t){var e=this;t&&(t.classList.add(this.settings.classNames.tagFlash),setTimeout((function(){t.classList.remove(e.settings.classNames.tagFlash)}),100))},isTagBlacklisted:function(t){return t=this.trim(t.toLowerCase()),this.settings.blacklist.filter((function(e){return(""+e).toLowerCase()==t})).length},isTagWhitelisted:function(t){return!!this.getWhitelistItem(t)},getWhitelistItem:function(t,e,i){e=e||"value";var n,s=this.settings;return(i=i||s.whitelist).some((function(a){var r=typeof a=="object"?a[e]||a.value:a;if(H(r,t,s.dropdown.caseSensitive,s.trim))return n=typeof a=="object"?a:{value:a},!0})),n||e!="value"||s.tagTextProp=="value"||(n=this.getWhitelistItem(t,s.tagTextProp,i)),n},validateTag:function(t){var e=this.settings,i="value"in t?"value":e.tagTextProp,n=this.trim(t[i]+"");return(t[i]+"").trim()?e.mode!="mix"&&e.pattern&&N(e.pattern,RegExp)&&!e.pattern.test(n)?this.TEXTS.pattern:!e.duplicates&&this.isTagDuplicate(n,e.dropdown.caseSensitive,t.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(n)||e.enforceWhitelist&&!this.isTagWhitelisted(n)?this.TEXTS.notAllowed:!e.validate||e.validate(t):this.TEXTS.empty},getInvalidTagAttrs:function(t,e){return{"aria-invalid":!0,class:"".concat(t.class||""," ").concat(this.settings.classNames.tagNotAllowed).trim(),title:e}},hasMaxTags:function(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly:function(t,e){var i=this.settings;this.DOM.scope.contains(document.activeElement)&&document.activeElement.blur(),i[e||"readonly"]=t,this.DOM.scope[(t?"set":"remove")+"Attribute"](e||"readonly",!0),this.settings.userInput=!0,this.setContentEditable(!t),t||(this.events.binding.call(this,!0),this.events.binding.call(this))},setContentEditable:function(t){this.DOM.scope.querySelectorAll("[data-can-editable]").forEach((function(e){e.contentEditable=t,e.tabIndex=t?0:-1}))},setDisabled:function(t){this.setReadonly(t,"disabled")},normalizeTags:function(t){var e=this,i=this.settings,n=i.whitelist,s=i.delimiters,a=i.mode,r=i.tagTextProp,o=[],l=!!n&&N(n[0],Object),d=Array.isArray(t),u=d&&t[0].value,c=function(g){return(g+"").split(s).reduce((function(p,h){var f,m=e.trim(h);return m&&p.push((it(f={},r,m),it(f,"value",m),f)),p}),[])};if(typeof t=="number"&&(t=t.toString()),typeof t=="string"){if(!t.trim())return[];t=c(t)}else d&&(t=t.reduce((function(g,p){if(M(p)){var h=w({},p);r in h||(r="value"),h[r]=e.trim(h[r]),(h[r]||h[r]===0)&&g.push(h)}else if(p!=null&&p!==""&&p!==void 0){var f;(f=g).push.apply(f,U(c(p)))}return g}),[]));return l&&!u&&(t.forEach((function(g){var p=o.map((function(m){return m.value})),h=e.dropdown.filterListItems.call(e,g[r],{exact:!0});e.settings.duplicates||(h=h.filter((function(m){return!p.includes(m.value)})));var f=h.length>1?e.getWhitelistItem(g[r],r,h):h[0];f&&N(f,Object)?o.push(f):a!="mix"&&(g.value==null&&(g.value=g[r]),o.push(g))})),o.length&&(t=o)),t},parseMixTags:function(t){var e=this,i=this.settings,n=i.mixTagsInterpolator,s=i.duplicates,a=i.transformTag,r=i.enforceWhitelist,o=i.maxTags,l=i.tagTextProp,d=[];t=t.split(n[0]).map((function(c,g){var p,h,f,m=c.split(n[1]),y=m[0],S=d.length==o;try{if(y==+y)throw Error;h=JSON.parse(y)}catch{h=e.normalizeTags(y)[0]||{value:y}}if(a.call(e,h),S||!(m.length>1)||r&&!e.isTagWhitelisted(h.value)||!s&&e.isTagDuplicate(h.value)){if(c)return g?n[0]+c:c}else h[p=h[l]?l:"value"]=e.trim(h[p]),f=e.createTagElem(h),d.push(h),f.classList.add(e.settings.classNames.tagNoAnimation),m[0]=f.outerHTML,e.value.push(h);return m.join("")})).join(""),this.DOM.input.innerHTML=t,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize();var u=this.getTagElms();return u.forEach((function(c,g){return v(c,d[g])})),this.update({withoutChangeEvent:!0}),wt(u,this.state.hasFocus),t},replaceTextWithNode:function(t,e){if(this.state.tag||e){e=e||this.state.tag.prefix+this.state.tag.value;var i,n,s=this.state.selection||window.getSelection(),a=s.anchorNode,r=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return a.splitText(s.anchorOffset-r),(i=a.nodeValue.lastIndexOf(e))==-1||(n=a.splitText(i),t&&a.parentNode.replaceChild(t,n)),!0}},prepareNewTagNode:function(t,e){e=e||{};var i=this.settings,n=[],s={},a=Object.assign({},t,{value:t.value+""});if(t=Object.assign({},a),i.transformTag.call(this,t),t.__isValid=this.hasMaxTags()||this.validateTag(t),t.__isValid!==!0){if(e.skipInvalid)return;if(w(s,this.getInvalidTagAttrs(t,t.__isValid),{__preInvalidData:a}),t.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(t.value)),!i.createInvalidTags)return void n.push(t.value)}return"readonly"in t&&(t.readonly?s["aria-readonly"]=!0:delete t.readonly),{tagElm:this.createTagElem(t,s),tagData:t,aggregatedInvalidInput:n}},postProcessNewTagNode:function(t,e){var i=this,n=this.settings,s=e.__isValid;s&&s===!0?this.value.push(e):(this.trigger("invalid",{data:e,index:this.value.length,tag:t,message:s}),n.keepInvalidTags||setTimeout((function(){return i.removeTags(t,!0)}),1e3)),this.dropdown.position()},selectTag:function(t,e){var i=this;if(!this.settings.enforceWhitelist||this.isTagWhitelisted(e.value)){this.state.actions.selectOption&&setTimeout((function(){return i.setRangeAtStartEnd(!1,i.DOM.input)}));var n=this.getLastTag();return n?this.replaceTag(n,e):this.appendTag(t),this.value[0]=e,this.update(),this.trigger("add",{tag:t,data:e}),[t]}},addEmptyTag:function(t){var e=w({value:""},t||{}),i=this.createTagElem(e);v(i,e),this.appendTag(i),this.editTag(i,{skipValidation:!0}),this.toggleFocusClass(!0)},addTags:function(t,e,i){var n=this,s=[],a=this.settings,r=[],o=document.createDocumentFragment(),l=[];if(!t||t.length==0)return s;switch(t=this.normalizeTags(t),a.mode){case"mix":return this.addMixTags(t);case"select":e=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),t.forEach((function(d){var u=n.prepareNewTagNode(d,{skipInvalid:i||a.skipInvalid});if(u){var c=u.tagElm;if(d=u.tagData,r=u.aggregatedInvalidInput,s.push(c),a.mode=="select")return n.selectTag(c,d);o.appendChild(c),n.postProcessNewTagNode(c,d),l.push({tagElm:c,tagData:d})}})),this.appendTag(o),l.forEach((function(d){var u=d.tagElm,c=d.tagData;return n.trigger("add",{tag:u,index:n.getTagIdx(c),data:c})})),this.update(),t.length&&e&&(this.input.set.call(this,a.createInvalidTags?"":r.join(a._delimiters)),this.setRangeAtStartEnd(!1,this.DOM.input)),this.dropdown.refilter(),s},addMixTags:function(t){var e=this;if((t=this.normalizeTags(t))[0].prefix||this.state.tag)return this.prefixedTextToTag(t[0]);var i=document.createDocumentFragment(),n=[];return t.forEach((function(s){var a=e.prepareNewTagNode(s);i.appendChild(a.tagElm),e.insertAfterTag(a.tagElm),e.postProcessNewTagNode(a.tagElm,a.tagData),n.push({tagElm:a.tagElm,tagData:a.tagData})})),this.appendMixTags(i,n),i.children},appendMixTags:function(t,e){var i=!!this.state.selection;i?this.injectAtCaret(t):(this.DOM.input.focus(),(i=this.setStateSelection()).range.setStart(this.DOM.input,i.range.endOffset),i.range.setEnd(this.DOM.input,i.range.endOffset),this.DOM.input.appendChild(t),this.updateValueByDOMTags(),this.update(),this.trigger("add",{tags:e||t.children}))},prefixedTextToTag:function(t){var e,i,n,s=this,a=this.settings,r=(e=this.state.tag)===null||e===void 0?void 0:e.delimiters;if(t.prefix=t.prefix||this.state.tag?this.state.tag.prefix:(a.pattern.source||a.pattern)[0],n=this.prepareNewTagNode(t),i=n.tagElm,this.replaceTextWithNode(i)||this.DOM.input.appendChild(i),setTimeout((function(){return i.classList.add(s.settings.classNames.tagNoAnimation)}),300),this.update(),!r){var o=this.insertAfterTag(i)||i;setTimeout(A,0,o)}return this.state.tag=null,this.postProcessNewTagNode(i,n.tagData),this.trigger("add",{tag:n,data:t}),i},appendTag:function(t){var e=this.DOM,i=e.input;e.scope.insertBefore(t,i)},createTagElem:function(t,e){t.__tagId=ut();var i,n=w({},t,ft({value:j(t.value+"")},e));return(function(s){for(var a,r=document.createNodeIterator(s,NodeFilter.SHOW_TEXT,null,!1);a=r.nextNode();)a.textContent.trim()||a.parentNode.removeChild(a)})(i=this.parseTemplate("tag",[n,this])),v(i,t),i},reCheckInvalidTags:function(){var t=this,e=this.settings;this.getTagElms(e.classNames.tagNotAllowed).forEach((function(i,n){var s=v(i),a=t.hasMaxTags(),r=t.validateTag(s),o=r===!0&&!a;if(e.mode=="select"&&t.toggleScopeValidation(r),o)return s=s.__preInvalidData?s.__preInvalidData:{value:s.value},t.replaceTag(i,s);i.title=a||r}))},removeTags:function(t,e,i){var n,s=this,a=this.settings;if(t=t&&N(t,HTMLElement)?[t]:N(t,Array)?t:t?[t]:[this.getLastTag()].filter((function(r){return r})),n=t.reduce((function(r,o){o&&typeof o=="string"&&(o=s.getTagElmByValue(o));var l=v(o);return o&&l&&!l.readonly&&r.push({node:o,idx:s.getTagIdx(l),data:v(o,{__removed:!0})}),r}),[]),i=typeof i=="number"?i:this.CSSVars.tagHideTransition,a.mode=="select"&&(i=0,this.input.set.call(this)),n.length==1&&a.mode!="select"&&n[0].node.classList.contains(a.classNames.tagNotAllowed)&&(e=!0),n.length)return a.hooks.beforeRemoveTag(n,{tagify:this}).then((function(){var r=function(o){o.node.parentNode&&(o.node.parentNode.removeChild(o.node),e?a.keepInvalidTags&&this.trigger("remove",{tag:o.node,index:o.idx}):(this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),a.keepInvalidTags&&this.reCheckInvalidTags(),this.trigger("remove",{tag:o.node,index:o.idx,data:o.data})))};e||(s.removeTagsFromValue(n.map((function(o){return o.node}))),s.update(),a.mode=="select"&&a.userInput&&s.setContentEditable(!0)),i&&i>10&&n.length==1?(function(o){o.node.style.width=parseFloat(window.getComputedStyle(o.node).width)+"px",document.body.clientTop,o.node.classList.add(a.classNames.tagHide),setTimeout(r.bind(this),i,o)}).call(s,n[0]):n.forEach(r.bind(s))})).catch((function(r){}))},removeTagsFromDOM:function(){this.getTagElms().forEach((function(t){return t.remove()}))},removeTagsFromValue:function(t){var e=this;(t=Array.isArray(t)?t:[t]).forEach((function(i){var n=v(i),s=e.getTagIdx(n);s>-1&&e.value.splice(s,1)}))},removeAllTags:function(t){var e=this;t=t||{},this.value=[],this.settings.mode=="mix"?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout((function(){e.DOM.input.focus()})),this.settings.mode=="select"&&(this.input.set.call(this),this.settings.userInput&&this.setContentEditable(!0)),this.update(t,(function(){e.trigger("remove",{})}))},postUpdate:function(){this.state.blockChangeEvent=!1;var t,e,i=this.settings,n=i.classNames,s=i.mode=="mix"?i.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(n.hasMaxTags,this.value.length>=i.maxTags),this.toggleClass(n.hasNoTags,!this.value.length),this.toggleClass(n.empty,!s),i.mode=="select"&&this.toggleScopeValidation((e=this.value)===null||e===void 0||(t=e[0])===null||t===void 0?void 0:t.__isValid)},setOriginalInputValue:function(t){var e=this.DOM.originalInput;this.settings.mixMode.integrated||(e.value=t,e.tagifyValue=e.value)},update:function(t,e){clearTimeout(this.debouncedUpdateTimeout),this.debouncedUpdateTimeout=setTimeout((function(){this.setPersistedData(i,"value"),this.settings.onChangeAfterBlur&&(t||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent(),this.postUpdate(),e?.()}).bind(this),100),this.events.bindOriginaInputListener.call(this,100);var i=this.getInputValue();this.setOriginalInputValue(i)},getInputValue:function(){var t=this.getCleanValue();return this.settings.mode=="mix"?this.getMixedTagsAsString(t):t.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(t):JSON.stringify(t):""},getCleanValue:function(t){return rt(t||this.value,this.dataProps)},getMixedTagsAsString:function(){var t="",e=this,i=this.settings,n=i.originalInputValueFormat||JSON.stringify,s=i.mixTagsInterpolator;return(function a(r){r.childNodes.forEach((function(o){if(o.nodeType==1){var l=v(o);if(o.tagName=="BR"&&(t+=`\r
39
+ `),l&&V.call(e,o)){if(l.__removed)return;t+=s[0]+n(et(l,e.dataProps))+s[1]}else o.getAttribute("style")||["B","I","U"].includes(o.tagName)?t+=o.textContent:o.tagName!="DIV"&&o.tagName!="P"||(t+=`\r
40
+ `,a(o))}else t+=o.textContent}))})(this.DOM.input),t}},z.prototype.removeTag=z.prototype.removeTags;var kt=Object.getOwnPropertyDescriptor,Lt=(t,e,i,n)=>{for(var s=n>1?void 0:n?kt(e,i):e,a=t.length-1,r;a>=0;a--)(r=t[a])&&(s=r(s)||s);return s};let nt=class extends mt.FieldComponent{emits=["click"];tagify;mountedParent(){console.log("Select",this.$refs.selectInput),this.tagify=new z(this.$refs.selectInput,{mode:"select",whitelist:["foo","bar","and baz",0,1,2],placeholder:"Выберите значение"}),this.$refs?.button}onChange(){}};nt=Lt([mt.VST],nt);const Pt={class:"d-inline-block"},jt=["value"];function Vt(t,e,i,n,s,a){return X.openBlock(),X.createElementBlock("div",Pt,[X.createElementVNode("input",{ref:"selectInput",value:t.value,onChange:e[0]||(e[0]=(...r)=>t.onChange&&t.onChange(...r))},null,40,jt)])}const Rt=yt._export_sfc(nt,[["render",Vt]]);exports.default=Rt;