1(function(c,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(c=typeof globalThis<"u"?globalThis:c||self,p(c.Maska={}))})(this,function(c){"use strict";var I=Object.defineProperty;var U=(c,p,d)=>p in c?I(c,p,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[p]=d;var g=(c,p,d)=>(U(c,typeof p!="symbol"?p+"":p,d),d);const p={"#":{pattern:/[0-9]/},"@":{pattern:/[a-zA-Z]/},"*":{pattern:/[a-zA-Z0-9]/}};class d{constructor(t={}){g(this,"opts",{});g(this,"memo",new Map);const s={...t};if(s.tokens!=null){s.tokens=s.tokensReplace?{...s.tokens}:{...p,...s.tokens};for(const e of Object.values(s.tokens))typeof e.pattern=="string"&&(e.pattern=new RegExp(e.pattern))}else s.tokens=p;Array.isArray(s.mask)&&(s.mask.length>1?s.mask=[...s.mask].sort((e,a)=>e.length-a.length):s.mask=s.mask[0]??""),s.mask===""&&(s.mask=null),this.opts=s}masked(t){return this.process(t,this.findMask(t))}unmasked(t){return this.process(t,this.findMask(t),!1)}isEager(){return this.opts.eager===!0}isReversed(){return this.opts.reversed===!0}completed(t){const s=this.findMask(t);if(this.opts.mask==null||s==null)return!1;const e=this.process(t,s).length;
1return typeof this.opts.mask=="string"?e>=this.opts.mask.length:typeof this.opts.mask=="function"?e>=s.length:this.opts.mask.filter(a=>e>=a.length).length===this.opts.mask.length}findMask(t){const s=this.opts.mask;if(s==null)return null;if(typeof s=="string")return s;if(typeof s=="function")return s(t);const e=this.process(t,s.slice(-1).pop()??"",!1);return s.find(a=>this.process(t,a,!1).length>=e.length)??""}escapeMask(t){const s=[],e=[];return t.split("").forEach((a,i)=>{a==="!"&&t[i-1]!=="!"?e.push(i-e.length):s.push(a)}),{mask:s.join(""),escaped:e}}process(t,s,e=!0){var V;if(s==null)return t;const a=`value=${t},mask=${s},masked=${e?1:0}`;if(this.memo.has(a))return this.memo.get(a);const{mask:i,escaped:f}=this.escapeMask(s),r=[],u=this.opts.tokens!=null?this.opts.tokens:{},l=this.isReversed()?-1:1,y=this.isReversed()?"unshift":"push",E=this.isReversed()?0:i.length-1,L=this.isReversed()?()=>o>-1&&h>-1:()=>o<i.length&&h<t.length,J=m=>!this.isReversed()&&m<=E||this.isReversed()&&m>=E;let O,M=-1,o=this.isReversed()?i.length-1:0,h=this.isReversed()?t.length-1:0;for(;L();){const m=i.charAt(o),k=u[m],v=(k==null?void 0:k.transform)!=null?k.transform(t.charAt(h)):t.charAt(h);if(!f.includes(o)&&k!=null){if(v.match(k.pattern)!=null)r[y](v),k.repeated?(M===-1?M=o:o===E&&o!==M&&(o=M-l),E===M&&(o-=l)):k.multiple&&(o-=l),o+=l;else if(k.multiple){const N=((V=r[h-l])==null?void 0:V.match(k.pattern))!=null,b=i.charAt(o+l);N&&b!==""&&u[b]==null?(o+=l,h-=l):r[y]("")}else v===O?O=void 0:k.optional&&(o+=l,h-=l);h+=l}else e&&!this.isEager()&&r[y](m),v===m&&!this.isEager()?h+=l:O=m,this.isEager()||(o+=l);if(this.isEager())for(;J(o)&&(u[i.charAt(o)]==null||f.includes(o));)e?r[y](i.charAt(o)):i.charAt(o)===t.charAt(h)&&(h+=l),o+=l}return this.memo.set(a,r.join("")),this.memo.get(a)}}const T=n=>JSON.parse(n.replaceAll("'",'"')),w=(n,t={})=>{const s={...t};return n.dataset.maska!=null&&n.dataset.maska!==""&&(s.mask=C(n.dataset.maska)),n.dataset.maskaEager!=null&&(s.eager=A(n.dataset.maskaEager)),n.dataset.maskaReversed!=null&&(s.reversed=A(n.dataset.maskaReversed)),n.dataset.maskaTokensReplace!=null&&(s.tokensReplace=A(n.dataset.maskaTokensReplace)),n.dataset.maskaTokens!=null&&(s.tokens=P(n.dataset.maskaTokens)),s},A=n=>n!==""?!!JSON.parse(n):!0,C=n=>n.startsWith("[")&&n.endsWith("]")?T(n):n,P=n=>{if(n.startsWith("{")&&n.endsWith("}"))return T(n);const t={};return n.split("|").forEach(s=>{const e=s.split(":");t[e[0]]={pattern:new RegExp(e[1]),optional:e[2]==="optional",multiple:e[2]==="multiple",repeated:e[2]==="repeated"}}),t};class S{constructor(t,s={}){g(this,"items",new Map);g(this,"beforeinputEvent",t=>{const s=t.target,e=this.items.get(s);e.isEager()&&"inputType"in t&&t.inputType.startsWith("delete")&&e.unmasked(s.value).length<=1&&this.setMaskedValue(s,"")});g(this,"inputEvent",t=>{if(t instanceof CustomEvent&&t.type==="input"&&t.detail!=null&&typeof t.detail=="object"&&"masked"in t.detail)return;const s=t.target,e=this.items.get(s),a=s.value,i=s.selectionStart,f=s.selectionEnd;let r=a;if(e.isEager()){const u=e.masked(a),l=e.unmasked(a);l===""&&"data"in t&&t.data!=null?r=t.data:l!==e.unmasked(u)&&(r=l)}if(this.setMaskedValue(s,r),"inputType"in t&&(t.inputType.startsWith("delete")||i!=null&&i<a.length))try{s.setSelectionRange(i,f)}catch{}});this.options=s,typeof t=="string"?this.init(Array.from(document.querySelectorAll(t)),this.getMaskOpts(s)):this.init("length"in t?Array.from(t):[t],this.getMaskOpts(s))}destroy(){for(const t of this.items.keys())t.removeEventListener("input",this.inputEvent),t.removeEventListener("beforeinput",this.beforeinputEvent);this.items.clear()}needUpdateOptions(t,s){const e=this.items.get(t),a=new d(w(t,this.getMaskOpts(s)));return JSON.stringify(e.opts)!==JSON.stringify(a.opts)}needUpdateValue(t){const s=t.dataset.maskaValue;return s==null&&t.value!==""||s!=null&&s!==t.value}getMaskOpts(t){const{onMaska:s,preProcess:e,postProcess:a,...i}=t;return i}init(t,s){for(const e of t){const a=new d(w(e,s));this.items.set(e,a),e.value!==""&&this.setMaskedValue(e,e.value),e.addEventListener("input",this.inputEvent),e.addEventListener("beforeinput",this.beforeinputEvent)}}setMaskedValue(t,s){const e=this.items.get(t);this.options.preProcess!=null&&(s=this.options.preProcess(s));const a=e.masked(s),i=e.unmasked(e.isEager()?a:s),f=e.completed(s),r={masked:a,unmasked:i,completed:f};s=a,this.options.postProcess!=null&&(s=this.options.postProcess(s)),t.value=s,t.dataset.maskaValue=s,this.options.onMaska!=null&&(Array.isArray(this.options.onMaska)?this.options.onMaska.forEac
1h(u=>u(r)):this.options.onMaska(r)),t.dispatchEvent(new CustomEvent("maska",{detail:r})),t.dispatchEvent(new CustomEvent("input",{detail:r}))}}const R=new WeakMap,W=n=>{setTimeout(()=>{var t;((t=R.get(n))==null?void 0:t.needUpdateValue(n))===!0&&n.dispatchEvent(new CustomEvent("input"))})},j=(n,t)=>{const s=n instanceof HTMLInputElement?n:n.querySelector("input"),e={...t.arg};if(s==null||(s==null?void 0:s.type)==="file")return;W(s);const a=R.get(s);if(a!=null){if(!a.needUpdateOptions(s,e))return;a.destroy()}if(t.value!=null){const i=t.value,f=r=>{i.masked=r.masked,i.unmasked=r.unmasked,i.completed=r.completed};e.onMaska=e.onMaska==null?f:Array.isArray(e.onMaska)?[...e.onMaska,f]:[e.onMaska,f]}R.set(s,new S(s,e))};c.Mask=d,c.MaskInput=S,c.tokens=p,c.vMaska=j,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});Maska.create=function(element,options){return new Maska.MaskInput(element,options)};function PhoneMaska(element){if(document.body.hasAttribute("data-kiosk-keyboard"))return;Maska.create(element,{mask:function(value){if(value){let cleanValue=value.replace(/[^\d+]/g,"");if(!cleanValue.startsWith("+")){cleanValue="+"+cleanValue}const masks={"+30":"+30 ### ### ####","+31":"+31 ## ### ####","+32":"+32 ### ## ## ##","+33":"+33 # ## ## ## ##","+34":"+34 ### ### ###","+351":"+351 ### ### ###","+352":"+352 ### ### ###","+353":"+353 ### ### ####","+354":"+354 ### ####","+355":"+355 ### ### ###","+356":"+356 #### ####","+357":"+357 ## ### ###","+358":"+358 ## ### ## ##","+359":"+359 ### ### ###","+36":"+36 ## ### ####","+370":"+370 ### ## ###","+371":"+371 ### #####","+372":"+372 #### ####","+373":"+373 #### ####","+374":"+374 ## ### ###","+375":"+375 ## ### ## ##","+376":"+376 ### ###","+377":"+377 ## ### ###","+378":"+378 #### ####","+380":"+380 ## ### ## ##","+381":"+381 ## ### ####","+382":"+382 ## ### ###","+383":"+383 ## ### ####","+385":"+385 ## ### ###","+386":"+386 ## ### ###","+387":"+387 ## ### ###","+389":"+389 ## ### ###","+39":"+39 ### ### ####","+40":"+40 ## ### ####","+41":"+41 ## ### ## ##","+43":"+43 #### ### ###","+44":"+44 #### ### ###","+45":"+45 ## ## ## ##","+46":"+46 ## ### ## ##","+47":"+47 ### ## ###","+48":"+48 ### ### ###","+500":"+500 ### ####","+501":"+501 ### ###","+1":"+1 ### ### ####","+7":"+7 ### ### ## ##","+20":"+20 ### ### ####","+212":"+212 ### ### ###","+213":"+213 ## ### ####","+216":"+216 ## ### ###","+218":"+218 ## ### ####","+220":"+220 ### ## ##","+221":"+221 ## ### ## ##","+222":"+222 ## ## ## ##","+223":"+223 ## ## ## ##","+224":"+224 ## ### ###","+225":"+225 ## ### ###","+226":"+226 ## ## ## ##","+227":"+227 ## ## ## ##","+228":"+228 ## ### ###","+229":"+229 ## ## ## ##","+230":"+230 ### ### ##","+231":"+231 ## ### ###","+232":"+232 ## ### ###","+233":"+233 ## ### ###","+234":"+234 ## ### ####","+235":"+235 ## ## ## ##","+236":"+236 ## ## ## ##","+237":"+237 ### ## ## ##","+238":"+238 ### ## ##","+239":"+239 ## ## ##","+240":"+240 ## ### ####","+241":"+241 # ## ## ##","+242":"+242 ## ### ###","+243":"+243 ### ### ###","+244":"+244 ### ### ###","+245":"+245 # #### ####","+248":"+248 # ### ###","+249":"+249 ## ### ####","+250":"+250 ### ### ###","+251":"+251 ## ### ####","+252":"+252 ## ### ###","+253":"+253 ## ## ## ##","+254":"+254 ### ### ###","+255":"+255 ## ### ####","+256":"+256 ### ### ###","+257":"+257 ## ## ## ##","+258":"+258 ## ### ####","+260":"+260 ## ### ####","+261":"+261 ## ## ####","+262":"+262 ##### #####","+263":"+263 # ### #####","+264":"+264 ## ### ####","+265":"+265 # ### ####","+266":"+266 # ### ####","+267":"+267 ## ### ###","+268":"+268 ## ## ## ##","+269":"+269 ## ## ##","+27":"+27 ## ### ####","+290":"+290 ####","+291":"+291 # ### ###","+297":"+297 ### ####","+298":"+298 ### ###","+299":"+299 ## ## ##","+90":"+90 ### ### ## ##","+91":"+91 ##### #####","+92":"+92 ### ### ####","+93":"+93 ## ### ####","+94":"+94 ## ### ####","+95":"+95 ## ### ###","+960":"+960 ### ####","+961":"+961 # ### ###","+962":"+962 # #### ####","+963":"+963 ## ### ####","+964":"+964 ## ### ####","+965":"+965 #### ####","+966":"+966 # ### ####","+967":"+967 ### ### ###","+968":"+968 #### ####","+970":"+970 ## ### ####","+971":"+971 # ### ####","+972":"+972 # ### ####","+973":"+973 #### ####","+974":"+974 #### ####","+975":"+975 ## ### ###","+976":"+976 ## ## ####","+977":"+977 ## ### ###","+98":"+98 ### ### ####"};if(cleanValue.indexOf("+49")===0){const germanyMasks=["+49 #### ### ####","+49 ### ### ####","+49 ### ## ####","+49 ### ## ###","+49 ### ## ##","+49 ### ###"].reverse();for(const mask of germanyMasks){if(cleanValue.length<=mask.replace(/[^+#]/g,"").length){return mask}}return germanyMasks[germanyMasks.length-1]}for(const prefix in masks){if(cleanValue.indexOf(prefix)===0){return masks[prefix]}}}return"+###"},preProcess:function(value){return value.replace(/[^\d+]/g,"")},postProcess:function(value){return value}});element.addEventListener("paste",function(event){event.preventDefault();let pasteData=(event.clipboardData||window.clipboardData).getData("text");pasteData=pasteData.replace(/[^\d+]/g,"");if(!pasteData.startsWith("+")){pasteData="+"+pasteData}element.value=pasteData;element.dispatchEvent(new Event("input"))})}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.