!function(A,B){"object"==typeof exports&&"undefined"!=typeof module?B(exports,require("whynot")):"function"==typeof define&&define.amd?define(["exports","whynot"],B):B((A="undefined"!=typeof globalThis?globalThis:A||self).xspattern={},A.whynot)}(this,(function(A,B){"use strict";function a(A){return B=>B===A}function n(A,B){if(null===A||null===B)throw new Error("unescaped hyphen may not be used as a range endpoint");if(BA<=a&&a<=B}function e(A){return!0}function t(){return!1}function G(A,B){return a=>A(a)||B(a)}function i(A,B){switch(B.kind){case"predicate":return void A.test(B.value);case"regexp":return void o(A,B.value,!1)}}function r(A,B){B.forEach(B=>{!function(A,B){const[a,{min:n,max:e}]=B;if(null!==e){for(let B=0;B0){for(let B=0;B!0),A.jump([n]));const t=[];if(B.forEach(B=>{e.data.push(A.program.length),r(A,B),t.push(A.jump([]))}),t.forEach(B=>{B.data.push(A.program.length)}),a){const B=A.program.length,a=A.jump([]);a.data.push(A.program.length),A.test(()=>!0),A.jump([B]),a.data.push(A.program.length)}}function l(A,B){return{success:!0,offset:A,value:B}}function H(A){return l(A,void 0)}function u(A,B,a=!1){return{success:!1,offset:A,expected:B,fatal:a}}function C(A){return(B,a)=>{const n=a+A.length;return B.slice(a,n)===A?l(n,A):u(a,[A])}}function s(A,B){return(a,n)=>{const e=A(a,n);return e.success?l(e.offset,B(e.value)):e}}function c(A,B,a,n){return(e,t)=>{const G=A(e,t);return G.success?B(G.value)?G:u(t,a,n):G}}function D(A,B){return(a,n)=>{let e=null;for(const t of A){const A=t(a,n);if(A.success)return A;if(null===e||A.offset>e.offset?e=A:A.offset===e.offset&&void 0===B&&(e.expected=e.expected.concat(A.expected)),A.fatal)return A}return B=B||(null==e?void 0:e.expected)||[],e&&(e.expected=B),e||u(n,B)}}function m(A){return(B,a)=>{const n=A(B,a);return n.success||n.fatal?n:l(a,null)}}function d(A){return(B,a)=>{let n=[],e=a;for(;;){const a=A(B,e);if(!a.success){if(a.fatal)return a;break}if(n.push(a.value),a.offset===e)break;e=a.offset}return l(e,n)}}function I(A,B,a){return(n,e)=>{const t=A(n,e);if(!t.success)return t;const G=B(n,t.offset);return G.success?l(G.offset,a(t.value,G.value)):G}}function h(A){return I(A,d(A),(A,B)=>[A].concat(B))}function p(A,B){return A}function T(A,B){return B}function f(A,B){return I(A,B,T)}function F(A,B){return I(A,B,p)}function E(A,B,a,n=!1){return f(A,n?M(F(B,a)):F(B,a))}function g(A,B){return(a,n)=>A(a,n).success?u(n,B):H(n)}function M(A){return(B,a)=>{const n=A(B,a);return n.success?n:u(n.offset,n.expected,!0)}}const P=(A,B)=>A.length===B?H(B):u(B,["end of input"]);const J=["Lu","Ll","Lt","Lm","Lo","Mn","Mc","Me","Nd","Nl","No","Pc","Pd","Ps","Pe","Pi","Pf","Po","Zs","Zl","Zp","Sm","Sc","Sk","So","Cc","Cf","Co","Cn"];const S={};function K(A){return A.codePointAt(0)}"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach((A,B)=>{S[A]=B});const y=A=>-1===A||-2===A;function b(A){return B=>!y(B)&&!A(B)}function x(A,B){return null===B?A:a=>A(a)&&!B(a)}const Q=function(A,B){const a=new Map;let e=0;return A.forEach((A,t)=>{const i=B[t];null!==A&&A.split("|").forEach(A=>{const B=a.get(A),t=n(e,e+i-1);a.set(A,B?G(B,t):t)}),e+=i}),a}(["BasicLatin","Latin-1Supplement","LatinExtended-A","LatinExtended-B","IPAExtensions","SpacingModifierLetters","CombiningDiacriticalMarks","GreekandCoptic|Greek","Cyrillic","CyrillicSupplement","Armenian","Hebrew","Arabic","Syriac","ArabicSupplement","Thaana","NKo","Samaritan","Mandaic","SyriacSupplement","ArabicExtended-B","ArabicExtended-A","Devanagari","Bengali","Gurmukhi","Gujarati","Oriya","Tamil","Telugu","Kannada","Malayalam","Sinhala","Thai","Lao","Tibetan","Myanmar","Georgian","HangulJamo","Ethiopic","EthiopicSupplement","Cherokee","UnifiedCanadianAboriginalSyllabics","Ogham","Runic","Tagalog","Hanunoo","Buhid","Tagbanwa","Khmer","Mongolian","UnifiedCanadianAboriginalSyllabicsExtended","Limbu","TaiLe","NewTaiLue","KhmerSymbols","Buginese","TaiTham","CombiningDiacriticalMarksExtended","Balinese","Sundanese","Batak","Lepcha","OlChiki","CyrillicExtended-C","GeorgianExtended","SundaneseSupplement","VedicExtensions","PhoneticExtensions","PhoneticExtensionsSupplement","CombiningDiacriticalMarksSupplement","LatinExtendedAdditional","GreekExtended","GeneralPunctuation","SuperscriptsandSubscripts","CurrencySymbols","CombiningDiacriticalMarksforSymbols|CombiningMarksforSymbols","LetterlikeSymbols","NumberForms","Arrows","MathematicalOperators","MiscellaneousTechnical","ControlPictures","OpticalCharacterRecognition","EnclosedAlphanumerics","BoxDrawing","BlockElements","GeometricShapes","MiscellaneousSymbols","Dingbats","MiscellaneousMathematicalSymbols-A","SupplementalArrows-A","BraillePatterns","SupplementalArrows-B","MiscellaneousMathematicalSymbols-B","SupplementalMathematicalOperators","MiscellaneousSymbolsandArrows","Glagolitic","LatinExtended-C","Coptic","GeorgianSupplement","Tifinagh","EthiopicExtended","CyrillicExtended-A","SupplementalPunctuation","CJKRadicalsSupplement","KangxiRadicals",null,"IdeographicDescriptionCharacters","CJKSymbolsandPunctuation","Hiragana","Katakana","Bopomofo","HangulCompatibilityJamo","Kanbun","BopomofoExtended","CJKStrokes","KatakanaPhoneticExtensions","EnclosedCJKLettersandMonths","CJKCompatibility","CJKUnifiedIdeographsExtensionA","YijingHexagramSymbols","CJKUnifiedIdeographs","YiSyllables","YiRadicals","Lisu","Vai","CyrillicExtended-B","Bamum","ModifierToneLetters","LatinExtended-D","SylotiNagri","CommonIndicNumberForms","Phags-pa","Saurashtra","DevanagariExtended","KayahLi","Rejang","HangulJamoExtended-A","Javanese","MyanmarExtended-B","Cham","MyanmarExtended-A","TaiViet","MeeteiMayekExtensions","EthiopicExtended-A","LatinExtended-E","CherokeeSupplement","MeeteiMayek","HangulSyllables","HangulJamoExtended-B","HighSurrogates","HighPrivateUseSurrogates","LowSurrogates","PrivateUseArea|PrivateUse","CJKCompatibilityIdeographs","AlphabeticPresentationForms","ArabicPresentationForms-A","VariationSelectors","VerticalForms","CombiningHalfMarks","CJKCompatibilityForms","SmallFormVariants","ArabicPresentationForms-B","HalfwidthandFullwidthForms","Specials","LinearBSyllabary","LinearBIdeograms","AegeanNumbers","AncientGreekNumbers","AncientSymbols","PhaistosDisc",null,"Lycian","Carian","CopticEpactNumbers","OldItalic","Gothic","OldPermic","Ugaritic","OldPersian",null,"Deseret","Shavian","Osmanya","Osage","Elbasan","CaucasianAlbanian","Vithkuqi",null,"LinearA","LatinExtended-F",null,"CypriotSyllabary","ImperialAramaic","Palmyrene","Nabataean",null,"Hatran","Phoenician","Lydian",null,"MeroiticHieroglyphs","MeroiticCursive","Kharoshthi","OldSouthArabian","OldNorthArabian",null,"Manichaean","Avestan","InscriptionalParthian","InscriptionalPahlavi","PsalterPahlavi",null,"OldTurkic",null,"OldHungarian","HanifiRohingya",null,"RumiNumeralSymbols","Yezidi","ArabicExtended-C","OldSogdian","Sogdian","OldUyghur","Chorasmian","Elymaic","Brahmi","Kaithi","SoraSompeng","Chakma","Mahajani","Sharada","SinhalaArchaicNumbers","Khojki",null,"Multani","Khudawadi","Grantha",null,"Newa","Tirhuta",null,"Siddham","Modi","MongolianSupplement","Takri",null,"Ahom",null,"Dogra",null,"WarangCiti","DivesAkuru",null,"Nandinagari","ZanabazarSquare","Soyombo","UnifiedCanadianAboriginalSyllabicsExtended-A","PauCinHau","DevanagariExtended-A",null,"Bhaiksuki","Marchen",null,"MasaramGondi","GunjalaGondi",null,"Makasar","Kawi",null,"LisuSupplement","TamilSupplement","Cuneiform","CuneiformNumbersandPunctuation","EarlyDynasticCuneiform",null,"Cypro-Minoan","EgyptianHieroglyphs","EgyptianHieroglyphFormatControls",null,"AnatolianHieroglyphs",null,"BamumSupplement","Mro","Tangsa","BassaVah","PahawhHmong",null,"Medefaidrin",null,"Miao",null,"IdeographicSymbolsandPunctuation","Tangut","TangutComponents","KhitanSmallScript","TangutSupplement",null,"KanaExtended-B","KanaSupplement","KanaExtended-A","SmallKanaExtension","Nushu",null,"Duployan","ShorthandFormatControls",null,"ZnamennyMusicalNotation",null,"ByzantineMusicalSymbols","MusicalSymbols","AncientGreekMusicalNotation",null,"KaktovikNumerals","MayanNumerals","TaiXuanJingSymbols","CountingRodNumerals",null,"MathematicalAlphanumericSymbols","SuttonSignWriting",null,"LatinExtended-G","GlagoliticSupplement","CyrillicExtended-D",null,"NyiakengPuachueHmong",null,"Toto","Wancho",null,"NagMundari",null,"EthiopicExtended-B","MendeKikakui",null,"Adlam",null,"IndicSiyaqNumbers",null,"OttomanSiyaqNumbers",null,"ArabicMathematicalAlphabeticSymbols",null,"MahjongTiles","DominoTiles","PlayingCards","EnclosedAlphanumericSupplement","EnclosedIdeographicSupplement","MiscellaneousSymbolsandPictographs","Emoticons","OrnamentalDingbats","TransportandMapSymbols","AlchemicalSymbols","GeometricShapesExtended","SupplementalArrows-C","SupplementalSymbolsandPictographs","ChessSymbols","SymbolsandPictographsExtended-A","SymbolsforLegacyComputing",null,"CJKUnifiedIdeographsExtensionB",null,"CJKUnifiedIdeographsExtensionC","CJKUnifiedIdeographsExtensionD","CJKUnifiedIdeographsExtensionE","CJKUnifiedIdeographsExtensionF",null,"CJKCompatibilityIdeographsSupplement",null,"CJKUnifiedIdeographsExtensionG","CJKUnifiedIdeographsExtensionH",null,"Tags",null,"VariationSelectorsSupplement",null,"SupplementaryPrivateUseArea-A|PrivateUse","SupplementaryPrivateUseArea-B|PrivateUse"],[128,128,128,208,96,80,112,144,256,48,96,112,256,80,48,64,64,64,32,16,48,96,128,128,128,128,128,128,128,128,128,128,128,128,256,160,96,256,384,32,96,640,32,96,32,32,32,32,128,176,80,80,48,96,32,32,144,80,128,64,64,80,48,16,48,16,48,128,64,64,256,256,112,48,48,48,80,64,112,256,256,64,32,160,128,32,96,256,192,48,16,256,128,128,256,256,96,32,128,48,80,96,32,128,128,224,16,16,64,96,96,48,96,16,32,48,16,256,256,6592,64,20992,1168,64,48,320,96,96,32,224,48,16,64,96,32,48,48,32,96,32,96,32,96,32,48,64,80,64,11184,80,896,128,1024,6400,512,80,688,16,16,16,32,32,144,240,16,128,128,64,80,64,48,128,32,64,32,48,32,48,32,64,32,80,48,48,80,48,64,80,64,384,64,64,64,32,32,48,48,32,32,32,64,32,96,96,32,32,32,64,64,32,32,48,80,80,48,128,64,288,32,64,64,48,64,64,48,32,128,80,48,80,48,96,32,80,48,48,80,128,128,128,96,160,128,96,32,80,48,80,176,80,80,96,96,64,96,80,96,16,64,96,160,112,80,64,96,80,304,32,96,80,16,64,1024,128,208,2624,112,1072,48,4e3,640,8576,576,48,96,48,144,688,96,96,160,64,32,6144,768,512,128,8816,16,256,48,64,400,2304,160,16,4688,208,48,256,256,80,112,32,32,96,32,128,1024,688,1104,256,48,96,112,80,320,48,64,464,48,736,32,224,32,96,784,80,64,80,176,256,256,48,112,96,256,256,768,80,48,128,128,128,256,256,112,144,256,1024,42720,32,4160,224,5776,7488,3088,544,1504,4944,4192,711760,128,128,240,65040,65536,65536]),L=function(A){const B=new Map,e=A.split(""),i=J.map(()=>[]);let r=0,o=0;for(;o{const n=i[a].reduce(G,t);B.set(A,n);const e=A.charAt(0),r=l.get(e)||[];l.set(e,r),r.push(n)}),l.forEach((A,a)=>{B.set(a,A.reduce(G,t))}),B}("bfUATCYATCPAQATAXATAOATBKJTBXCTBCZPATAQAZANAZADZPAXAQAXAbgUATAYDaATAZAaAGARAXAcAaAZAaAXAMBZADATBZAMAGASAMCTACWXACGDXXADHA3DAAPDAAtCAAFDBCAADCAABCCDBCCABCAABCCDCCAABCAAFCAADDAABCAABCBADCBDBGACADCGDCAEADACAEADACAEADAAPDAARDACAEADAABCBA7DFCAABCBDBABCCAJjDBAAGADaFRZDFLZNFEZGFAZAFAZQnvBAAADFAZACADABBFADCTACABDZBCATACCBACABACAABCQBACIDiCADBCCDCAXDDCADAXAABCBDBCyDvAhaAHEJBA1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AhvBAAGsBCHGFGBBKJBDGAaAh/EAAGdHABQGrHDKJBEYAhPHAAGaFAHDKJhlLAAGGBAGDBAGBBAGOBAmEDAABBMIHGBoChDhHGFABDKJBDTBhQMAAM6aAMCYAMDhLBAAMsaAMOhBDAAGDBAGaBAGBBAGABBGABAGJBAGDBAGABAGABFGABDGABAGABAGABAGCBAGBBAGABBGABAGABAGABAGABAGABAGBBAGABBGDBAGGBAGDBAGDBAGABAGJBAGQBEGCBAGEBAGQBzXBhNEAAarBD6jBAABLaOBBaOBAaOBAakBJMM6gCAAB3acBMarBDaIBGaBBNaFhZCAA66DAAZE6XLAABDaQBCaMBC62BAABD6eBAABFaLBDaABOaLBDa3BHaJBFanBHadBBaBhNBAA6TFAABLaNBBaMBCaIBGatBAaGBHaNBDaIBGaIBG6SCAABAa2BkKJhFQAAmfbKABfm5ABABFmdDAABBmBaBABNmw0BAhewAAmdIAAhhXAAmKNBABEmfBBAhQxtCcABd8fBAAh/BAAnvDAAhP4PA99/PABB99/PA");function X(A){return 32===A||9===A||10===A||13===A}const Z=[a(K(":")),n(K("A"),K("Z")),a(K("_")),n(K("a"),K("z")),n(192,214),n(216,246),n(192,214),n(216,246),n(248,767),n(880,893),n(895,8191),n(8204,8205),n(8304,8591),n(11264,12271),n(12289,55295),n(63744,64975),n(65008,65533),n(65536,983039)].reduce(G),O=[Z,a(K("-")),a(K(".")),n(K("0"),K("9")),a(183),n(768,879),n(8255,8256)].reduce(G),k=L.get("Nd"),N=b(k),v=x(n(0,1114111),[L.get("P"),L.get("Z"),L.get("C")].reduce(G)),w=b(v);function Y(A){return 10!==A&&13!==A&&!y(A)}const U={s:X,S:b(X),i:Z,I:b(Z),c:O,C:b(O),d:k,D:N,w:v,W:w},j=C("*"),R=C("\\"),V=C("{"),W=C("}"),q=C("["),z=C("]"),$=C("^"),_=C("$"),AA=C(","),BA=C("-"),aA=C("("),nA=C(")"),eA=C("."),tA=C("|"),GA=C("+"),iA=C("?"),rA=C("-["),oA=K("0");function lA(A){function B(A){return new Set(A.split("").map(A=>K(A)))}function t(A,B){const a=A.codePointAt(B);return void 0===a?u(B,["any character"]):l(B+String.fromCodePoint(a).length,a)}const i="xpath"===A.language?f(R,D([s(C("n"),()=>10),s(C("r"),()=>13),s(C("t"),()=>9),s(D([R,tA,eA,BA,$,iA,j,GA,V,W,_,aA,nA,q,z]),A=>K(A))])):f(R,D([s(C("n"),()=>10),s(C("r"),()=>13),s(C("t"),()=>9),s(D([R,tA,eA,BA,$,iA,j,GA,V,W,aA,nA,q,z]),A=>K(A))]));function r(A,a){const n=B(a);return I(C(A),m(c(t,A=>n.has(A),a.split(""))),(A,B)=>function(A){const B=L.get(A);if(null==B)throw new Error(A+" is not a valid unicode category");return B}(null===B?A:A+String.fromCodePoint(B)))}const o=D([r("L","ultmo"),r("M","nce"),r("N","dlo"),r("P","cdseifo"),r("Z","slp"),r("S","mcko"),r("C","cfon")]),H=[n(K("a"),K("z")),n(K("A"),K("Z")),n(K("0"),K("9")),a(45)].reduce(G),T=D([o,s(f(C("Is"),function(A){return(B,a)=>{const n=A(B,a);return n.success?l(n.offset,B.slice(a,n.offset)):n}}(h(c(t,H,["block identifier"])))),B=>function(A,B){const a=Q.get(A);if(void 0===a){if(B)return e;throw new Error(`The unicode block identifier "${A}" is not known.`)}return a}(B,"xpath"!==A.language))]),J=E(C("\\p{"),T,W,!0),S=s(E(C("\\P{"),T,W,!0),b),y=f(R,s(D("sSiIcCdDwW".split("").map(A=>C(A))),A=>U[A])),X=s(eA,()=>Y),Z=D([y,J,S]),O=B("\\[]"),k=D([i,c(t,A=>!O.has(A),["unescaped character"])]),N=D([s(BA,()=>null),k]),v=I(N,f(BA,N),n);function w(A,B){return[A].concat(B||[])}const lA=s(function(A){return(B,a)=>{const n=A(B,a);return n.success?l(a,n.value):n}}(D([z,rA])),()=>null),HA=K("-"),uA=D([s(F(F(BA,g(q,["not ["])),lA),()=>HA),f(g(BA,["not -"]),k)]),CA=D([I(s(uA,a),D([function(A,B){return CA(A,B)},lA]),w),I(D([v,Z]),D([cA,lA]),w)]);const sA=D([I(s(k,a),D([CA,lA]),w),I(D([v,Z]),D([cA,lA]),w)]);function cA(A,B){return sA(A,B)}const DA=s(sA,A=>A.reduce(G)),mA=s(f($,DA),b),dA=I(D([f(g($,["not ^"]),DA),mA]),m(f(BA,(function(A,B){return IA(A,B)}))),x),IA=E(q,dA,z,!0);const hA="xpath"===A.language?D([s(i,a),Z,IA,X,s($,()=>A=>-1===A),s(_,()=>A=>-2===A)]):D([s(i,a),Z,IA,X]),pA="xpath"===A.language?B(".\\?*+{}()|^$[]"):B(".\\?*+{}()|[]"),TA=c(t,A=>!pA.has(A),["NormalChar"]),fA=s(f(R,I(s(c(t,n(K("1"),K("9")),["digit"]),A=>A-oA),d(s(c(t,n(oA,K("9")),["digit"]),A=>A-oA)),(A,B)=>{B.reduce((A,B)=>10*A+B,A)})),A=>{throw new Error("Backreferences in XPath patterns are not yet implemented.")}),FA="xpath"===A.language?D([s(TA,A=>({kind:"predicate",value:a(A)})),s(hA,A=>({kind:"predicate",value:A})),s(E(aA,f(m(C("?:")),SA),nA,!0),A=>({kind:"regexp",value:A})),fA]):D([s(TA,A=>({kind:"predicate",value:a(A)})),s(hA,A=>({kind:"predicate",value:A})),s(E(aA,SA,nA,!0),A=>({kind:"regexp",value:A}))]),EA=s(h(s(c(t,n(oA,K("9")),["digit"]),A=>A-oA)),A=>A.reduce((A,B)=>10*A+B)),gA=D([I(EA,f(AA,EA),(A,B)=>{if(B({min:A,max:null})),s(EA,A=>({min:A,max:A}))]),MA="xpath"===A.language?I(D([s(iA,()=>({min:0,max:1})),s(j,()=>({min:0,max:null})),s(GA,()=>({min:1,max:null})),E(V,gA,W,!0)]),m(iA),(A,B)=>A):D([s(iA,()=>({min:0,max:1})),s(j,()=>({min:0,max:null})),s(GA,()=>({min:1,max:null})),E(V,gA,W,!0)]),PA=d(I(FA,s(m(MA),A=>null===A?{min:1,max:1}:A),(A,B)=>[A,B])),JA=I(PA,d(f(tA,M(PA))),(A,B)=>[A].concat(B));function SA(A,B){return JA(A,B)}const KA=function(A){return I(A,P,p)}(JA);return function(A){let B;try{B=KA(A,0)}catch(B){throw new Error(`Error parsing pattern "${A}": ${B instanceof Error?B.message:B}`)}return B.success?B.value:function(A,B,a){const n=a.map(A=>`"${A}"`);throw new Error(`Error parsing pattern "${A}" at offset ${B}: expected ${n.length>1?"one of "+n.join(", "):n[0]} but found "${A.slice(B,B+1)}"`)}(A,B.offset,B.expected)}}function HA(A){return[...A].map(A=>A.codePointAt(0))}A.compile=function(A,a={language:"xsd"}){const n=lA(a)(A),e=B.compileVM(A=>{o(A,n,"xpath"===a.language),A.accept()});return function(A){const B="xpath"===a.language?[-1,...HA(A),-2]:HA(A);return e.execute(B).success}},Object.defineProperty(A,"__esModule",{value:!0})})); //# sourceMappingURL=xspattern.umd.cjs.map