@descope/web-components-ui 1.0.303 → 1.0.305

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/dist/cjs/index.cjs.js +15 -95
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +16 -96
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1612.js +1 -1
  6. package/dist/umd/1621.js +2 -2
  7. package/dist/umd/3951.js +1 -1
  8. package/dist/umd/4024.js +1 -1
  9. package/dist/umd/4052.js +1 -1
  10. package/dist/umd/4569.js +1 -0
  11. package/dist/umd/4746.js +1 -1
  12. package/dist/umd/5806.js +1 -1
  13. package/dist/umd/6770.js +1 -1
  14. package/dist/umd/7056.js +1 -1
  15. package/dist/umd/7531.js +1 -1
  16. package/dist/umd/7911.js +1 -1
  17. package/dist/umd/9092.js +2 -2
  18. package/dist/umd/9314.js +1 -1
  19. package/dist/umd/9423.js +2 -2
  20. package/dist/umd/9562.js +1 -1
  21. package/dist/umd/DescopeDev.js +1 -1
  22. package/dist/umd/descope-button-index-js.js +1 -1
  23. package/dist/umd/descope-email-field-index-js.js +1 -1
  24. package/dist/umd/descope-enriched-text-index-js.js +1 -1
  25. package/dist/umd/index.js +1 -1
  26. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  27. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  28. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  29. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  30. package/package.json +3 -3
  31. package/src/components/descope-enriched-text/EnrichedTextClass.js +5 -24
  32. package/src/components/descope-enriched-text/consts.js +11 -72
  33. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +1 -1
  34. package/dist/umd/9927.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9806,9288],{4049:(t,e,r)=>{r.d(e,{H:()=>f,f:()=>s});var o=r(2061),n=r(4567),i=r(4201),a=r(4978);const s=(0,n.iY)("combo-box"),{host:d,inputField:l,inputElement:p,placeholder:u,toggle:c,clearButton:h,label:m,requiredIndicator:y,helperText:b,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.qC)((0,a.yk)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[{},d],fontFamily:[m,u,l,b,v],labelTextColor:[{...m,property:"color"},{...y,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...l,property:"height"},inputBackgroundColor:{...l,property:"background-color"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},labelRequiredIndicator:{...y,property:"content"},inputValueTextColor:{...l,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...c,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...c,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...c,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...c,property:"margin-right"},{...c,property:"margin-left"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineOffset:{...l,property:"outline-offset"},inputHorizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],overlayBackground:{property:()=>f.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>f.cssVarList.overlay.textColor},overlayBorder:{property:()=>f.cssVarList.overlay.border},overlayFontSize:{property:()=>f.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>f.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>f.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>f.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>f.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>f.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(t=>class extends t{#t=({displayName:t,value:e,label:r})=>`<span data-name="${r}" data-id="${e}">${t||r}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(r){if(!e.baseElement.items?.length)return;const o=e.customValueTransformFn(r)||"";o!==this.value&&t.set.call(this,o)}}})}#r(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,r)=>{t.innerHTML=r.item.outerHTML}}#o(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#o(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,a.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,i.bi)(f.cssVarList)}\n\t\t${(0,i.PH)("vaadin-combo-box")}\n\t\t${(0,i.jI)("vaadin-combo-box")}\n\t\t${(0,i.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,i.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,r)=>{r.r(e),r.d(e,{ComboBoxClass:()=>o.H}),r(7583);var o=r(4049);customElements.define(o.f,o.H)},4963:(t,e,r)=>{r.d(e,{Z:()=>m,f:()=>s});var o=r(3878),n=r(4567),i=r(7262),a=r(2485);const s=(0,n.iY)("phone-field-internal"),d=["disabled","size","bordered","invalid","readonly"],l=["country-input-placeholder","default-code","restrict-countries"],p=["phone-input-placeholder","maxlength"],u={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},c=[].concat(d,l,p),h=(0,o.P)({componentName:s,baseSelector:"div"}),m=class extends h{static get observedAttributes(){return[].concat(h.observedAttributes||[],c)}constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n >\n ${i.Z.map((t=>(0,a.V)(t))).join("")}\n </descope-combo-box>\n <div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>\n `,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput],this.countryCodeInput.customValueTransformFn=t=>{const[,e]=t?.split?.(" ")||[];return e}}get value(){return this.phoneNumberValue?`${this.countryCodeInput.value}-${this.phoneNumberInput.value}`:""}set value(t){const[e="",r=""]=t.split("-");if(e){const t=this.getCountryByDialCode(e);t&&(this.countryCodeInput.selectedItem=t)}else this.countryCodeInput.selectedItem=void 0;this.phoneNumberInput.value=r}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const t=this.countryCodeInput.value,e=this.phoneNumberInput.value,r=!t||!e,o=this.phoneNumberInput.value?.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&r?{valueMissing:!0}:o?{tooShort:!0}:e&&!t?{valueMissing:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[1].focus()})),super.init?.(),this.initInputs()}getRestrictedCountries(){return this.getAttribute("restrict-countries")?.split(",")||[]}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-id")===t))}getCountryByCodeId(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}updateCountryCodeItems(t){const e=t.length?i.Z.filter((e=>t.includes(e.code))):i.Z;this.querySelector("descope-combo-box").innerHTML=e.map((t=>(0,a.V)(t))).join("")}handleDefaultCountryCode(t){if(!this.countryCodeInput.value){const e=this.getCountryByCodeId(t);e&&setTimeout((()=>{this.countryCodeInput.selectedItem=e}))}}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{const e=/^\d$/,r=t.target.value.split("").filter((t=>e.test(t))).join("");t.target.value=r})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),e!==r){if("default-code"===t&&r)this.handleDefaultCountryCode(r);else if(c.includes(t)){const e=u[t]||t;d.includes(t)?this.inputs.forEach((t=>t.setAttribute(e,r))):l.includes(t)?this.countryCodeInput.setAttribute(e,r):p.includes(t)&&this.phoneNumberInput.setAttribute(e,r)}"restrict-countries"===t&&this.updateCountryCodeItems(this.getRestrictedCountries())}}}},9240:(t,e,r)=>{r.r(e),r(1294),r(9357);var o=r(4963);customElements.define(o.f,o.Z)},2485:(t,e,r)=>{r.d(e,{V:()=>o});const o=({code:t,dialCode:e,name:r})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${e}"\n\t\tdata-name="${t} ${e} ${r}"\n\t\tdata-country-code="${t}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(t=>`https://static.descope.com/npm/svg-country-flags@1.2.10/svg/${t.toLowerCase()}.svg`)(t)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${r}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${t}</span>\n\t\t\t<span>${e}</span>\n\t\t</div>\n\t</div>\n`},6581:(t,e,r)=>{r.r(e),r.d(e,{PhoneFieldClass:()=>w}),r(9240),r(1294),r(9357);var o=r(4963),n=r(4567),i=r(2061),a=r(4978),s=r(6417),d=r(4049),l=r(7262),p=r(4201);const u=s.z.cssVarList,c=d.H.cssVarList,h=(0,n.iY)("phone-field"),{host:m,label:y,requiredIndicator:b,inputField:v,countryCodeInput:f,phoneInput:g,separator:x,errorMessage:C,helperText:I}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},w=(0,i.qC)((0,a.yk)({mappings:{fontSize:[m,v,{selector:s.z.componentName,property:s.z.cssVarList.fontSize},{selector:d.H.componentName,property:d.H.cssVarList.fontSize}],fontFamily:[y,C,I,{...f,property:d.H.cssVarList.overlay.fontFamily}],hostWidth:[{...m,property:"width"},{...g,property:"width"},{...f,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...m,property:"direction"},inputBorderStyle:[{...v,property:"border-style"},{...x,property:"border-left-style"}],inputBorderWidth:[{...v,property:"border-width"},{...x,property:"border-left-width"}],inputBorderColor:[{...v,property:"border-color"},{...x,property:"border-left-color"}],inputBorderRadius:{...v,property:"border-radius"},countryCodeInputWidth:{...f,property:c.hostWidth},countryCodeDropdownWidth:{...f,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...g,property:"width"},labelTextColor:[{...y,property:"color"},{...b,property:"color"}],labelRequiredIndicator:{...b,property:"content"},errorMessageTextColor:{...C,property:"color"},inputValueTextColor:[{...g,property:u.inputValueTextColor},{...f,property:c.inputValueTextColor}],inputPlaceholderTextColor:{...g,property:u.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:c.overlayItemBackgroundColor},inputOutlineStyle:{...v,property:"outline-style"},inputOutlineColor:{...v,property:"outline-color"},inputOutlineWidth:{...v,property:"outline-width"},inputOutlineOffset:{...v,property:"outline-offset"}}}),a.e4,(0,a.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return l.Z}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,n.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries"]})}}))((0,a.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,p.bi)(w.cssVarList)}\n\t\t\t${(0,p.Pd)("vaadin-text-field")}\n\t\t\t${(0,p.B)("vaadin-text-field")}\n\t\t\t${(0,p.DY)()}\n\n\t\t\tdiv {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-text-field {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\tdescope-phone-field-internal {\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n\t\t\t}\n\t\t\tdescope-phone-field-internal > div {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tdescope-phone-field-internal .separator {\n\t\t\t\tflex: 0;\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t\tdescope-combo-box {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmin-width: 5.75em;\n\t\t\t\t${c.inputOutlineWidth}: 0;\n\t\t\t\t${c.inputOutlineOffset}: 0;\n\t\t\t\t${c.inputBorderWidth}: 0;\n\t\t\t\t${c.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${u.inputOutlineWidth}: 0;\n\t\t\t\t${u.inputOutlineOffset}: 0;\n\t\t\t\t${u.inputBorderWidth}: 0;\n\t\t\t\t${u.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,p.Wf)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:h}));customElements.define(h,w)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9806,9288],{4049:(t,e,r)=>{r.d(e,{H:()=>f,f:()=>s});var o=r(2061),n=r(4567),i=r(4201),a=r(4978);const s=(0,n.iY)("combo-box"),{host:d,inputField:l,inputElement:p,placeholder:u,toggle:c,clearButton:h,label:m,requiredIndicator:y,helperText:b,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},f=(0,o.qC)((0,a.yk)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[{},d],fontFamily:[m,u,l,b,v],labelTextColor:[{...m,property:"color"},{...y,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...l,property:"height"},inputBackgroundColor:{...l,property:"background-color"},inputBorderColor:{...l,property:"border-color"},inputBorderWidth:{...l,property:"border-width"},inputBorderStyle:{...l,property:"border-style"},inputBorderRadius:{...l,property:"border-radius"},labelRequiredIndicator:{...y,property:"content"},inputValueTextColor:{...l,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...c,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...c,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...c,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...c,property:"margin-right"},{...c,property:"margin-left"}],inputOutlineColor:{...l,property:"outline-color"},inputOutlineWidth:{...l,property:"outline-width"},inputOutlineStyle:{...l,property:"outline-style"},inputOutlineOffset:{...l,property:"outline-offset"},inputHorizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],overlayBackground:{property:()=>f.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>f.cssVarList.overlay.textColor},overlayBorder:{property:()=>f.cssVarList.overlay.border},overlayFontSize:{property:()=>f.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>f.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>f.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>f.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>f.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>f.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(t=>class extends t{#t=({displayName:t,value:e,label:r})=>`<span data-name="${r}" data-id="${e}">${t||r}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(r){if(!e.baseElement.items?.length)return;const o=e.customValueTransformFn(r)||"";o!==this.value&&t.set.call(this,o)}}})}#r(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,r)=>{t.innerHTML=r.item.outerHTML}}#o(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#o(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,a.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,i.bi)(f.cssVarList)}\n\t\t${(0,i.PH)("vaadin-combo-box")}\n\t\t${(0,i.jI)("vaadin-combo-box")}\n\t\t${(0,i.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,i.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,r)=>{r.r(e),r.d(e,{ComboBoxClass:()=>o.H}),r(7583);var o=r(4049);customElements.define(o.f,o.H)},4963:(t,e,r)=>{r.d(e,{Z:()=>m,f:()=>s});var o=r(3878),n=r(4567),i=r(7262),a=r(2485);const s=(0,n.iY)("phone-field-internal"),d=["disabled","size","bordered","invalid","readonly"],l=["country-input-placeholder","default-code","restrict-countries"],p=["phone-input-placeholder","maxlength"],u={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},c=[].concat(d,l,p),h=(0,o.P)({componentName:s,baseSelector:"div"}),m=class extends h{static get observedAttributes(){return[].concat(h.observedAttributes||[],c)}constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n >\n ${i.Z.map((t=>(0,a.V)(t))).join("")}\n </descope-combo-box>\n <div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>\n `,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput],this.countryCodeInput.customValueTransformFn=t=>{const[,e]=t?.split?.(" ")||[];return e}}get value(){return this.phoneNumberValue?`${this.countryCodeInput.value}-${this.phoneNumberInput.value}`:""}set value(t){const[e="",r=""]=t.split("-");if(e){const t=this.getCountryByDialCode(e);t&&(this.countryCodeInput.selectedItem=t)}else this.countryCodeInput.selectedItem=void 0;this.phoneNumberInput.value=this.phoneNumberInput.value||r}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const t=this.countryCodeInput.value,e=this.phoneNumberInput.value,r=!t||!e,o=this.phoneNumberInput.value?.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&r?{valueMissing:!0}:o?{tooShort:!0}:e&&!t?{valueMissing:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[1].focus()})),super.init?.(),this.initInputs()}getRestrictedCountries(){return this.getAttribute("restrict-countries")?.split(",")||[]}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-id")===t))}getCountryByCodeId(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}updateCountryCodeItems(t){const e=t.length?i.Z.filter((e=>t.includes(e.code))):i.Z;this.querySelector("descope-combo-box").innerHTML=e.map((t=>(0,a.V)(t))).join("")}handleDefaultCountryCode(t){if(!this.countryCodeInput.value){const e=this.getCountryByCodeId(t);e&&setTimeout((()=>{this.countryCodeInput.selectedItem=e}))}}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{const e=/^\d$/,r=t.target.value.split("").filter((t=>e.test(t))).join("");t.target.value=r})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),e!==r){if("default-code"===t&&r)this.handleDefaultCountryCode(r);else if(c.includes(t)){const e=u[t]||t;d.includes(t)?this.inputs.forEach((t=>t.setAttribute(e,r))):l.includes(t)?this.countryCodeInput.setAttribute(e,r):p.includes(t)&&this.phoneNumberInput.setAttribute(e,r)}"restrict-countries"===t&&this.updateCountryCodeItems(this.getRestrictedCountries())}}}},9240:(t,e,r)=>{r.r(e),r(1294),r(9357);var o=r(4963);customElements.define(o.f,o.Z)},2485:(t,e,r)=>{r.d(e,{V:()=>o});const o=({code:t,dialCode:e,name:r})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${e}"\n\t\tdata-name="${t} ${e} ${r}"\n\t\tdata-country-code="${t}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(t=>`https://static.descope.com/npm/svg-country-flags@1.2.10/svg/${t.toLowerCase()}.svg`)(t)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${r}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${t}</span>\n\t\t\t<span>${e}</span>\n\t\t</div>\n\t</div>\n`},6581:(t,e,r)=>{r.r(e),r.d(e,{PhoneFieldClass:()=>w}),r(9240),r(1294),r(9357);var o=r(4963),n=r(4567),i=r(2061),a=r(4978),s=r(6417),d=r(4049),l=r(7262),p=r(4201);const u=s.z.cssVarList,c=d.H.cssVarList,h=(0,n.iY)("phone-field"),{host:m,label:y,requiredIndicator:b,inputField:v,countryCodeInput:f,phoneInput:g,separator:x,errorMessage:C,helperText:I}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},w=(0,i.qC)((0,a.yk)({mappings:{fontSize:[m,v,{selector:s.z.componentName,property:s.z.cssVarList.fontSize},{selector:d.H.componentName,property:d.H.cssVarList.fontSize}],fontFamily:[y,C,I,{...f,property:d.H.cssVarList.overlay.fontFamily}],hostWidth:[{...m,property:"width"},{...g,property:"width"},{...f,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...m,property:"direction"},inputBorderStyle:[{...v,property:"border-style"},{...x,property:"border-left-style"}],inputBorderWidth:[{...v,property:"border-width"},{...x,property:"border-left-width"}],inputBorderColor:[{...v,property:"border-color"},{...x,property:"border-left-color"}],inputBorderRadius:{...v,property:"border-radius"},countryCodeInputWidth:{...f,property:c.hostWidth},countryCodeDropdownWidth:{...f,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...g,property:"width"},labelTextColor:[{...y,property:"color"},{...b,property:"color"}],labelRequiredIndicator:{...b,property:"content"},errorMessageTextColor:{...C,property:"color"},inputValueTextColor:[{...g,property:u.inputValueTextColor},{...f,property:c.inputValueTextColor}],inputPlaceholderTextColor:{...g,property:u.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:c.overlayItemBackgroundColor},inputOutlineStyle:{...v,property:"outline-style"},inputOutlineColor:{...v,property:"outline-color"},inputOutlineWidth:{...v,property:"outline-width"},inputOutlineOffset:{...v,property:"outline-offset"}}}),a.e4,(0,a.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return l.Z}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,n.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries"]})}}))((0,a.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,p.bi)(w.cssVarList)}\n\t\t\t${(0,p.Pd)("vaadin-text-field")}\n\t\t\t${(0,p.B)("vaadin-text-field")}\n\t\t\t${(0,p.DY)()}\n\n\t\t\tdiv {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-text-field {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\tdescope-phone-field-internal {\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n\t\t\t}\n\t\t\tdescope-phone-field-internal > div {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tdescope-phone-field-internal .separator {\n\t\t\t\tflex: 0;\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t\tdescope-combo-box {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmin-width: 5.75em;\n\t\t\t\t${c.inputOutlineWidth}: 0;\n\t\t\t\t${c.inputOutlineOffset}: 0;\n\t\t\t\t${c.inputBorderWidth}: 0;\n\t\t\t\t${c.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${u.inputOutlineWidth}: 0;\n\t\t\t\t${u.inputOutlineOffset}: 0;\n\t\t\t\t${u.inputBorderWidth}: 0;\n\t\t\t\t${u.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,p.Wf)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:h}));customElements.define(h,w)}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.303",
3
+ "version": "1.0.305",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -60,8 +60,8 @@
60
60
  "@storybook/addon-links": "^6.4.9",
61
61
  "@storybook/html": "^6.4.9",
62
62
  "@storybook/manager-api": "^7.4.6",
63
+ "@types/markdown-it": "^14.1.1",
63
64
  "@types/node": "^20.8.0",
64
- "@types/remarkable": "^2.0.8",
65
65
  "eslint": "^8.48.0",
66
66
  "eslint-config-airbnb-base": "^15.0.0",
67
67
  "eslint-config-prettier": "^9.0.0",
@@ -102,7 +102,7 @@
102
102
  "element-internals-polyfill": "^1.3.9",
103
103
  "lint-staged": "^15.0.0",
104
104
  "lodash.merge": "4.6.2",
105
- "remarkable": "^2.0.1"
105
+ "markdown-it": "^14.1.0"
106
106
  },
107
107
  "overrides": {
108
108
  "@vaadin/avatar": "24.3.4",
@@ -1,8 +1,8 @@
1
- import { Remarkable } from 'remarkable';
1
+ import MarkdownIt from 'markdown-it';
2
2
  import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
3
3
  import { compose } from '../../helpers';
4
4
  import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
5
- import { ruleSet, textRuleSet } from './consts';
5
+ import { textRuleSet } from './consts';
6
6
  import { createBaseClass } from '../../baseClasses/createBaseClass';
7
7
 
8
8
  export const componentName = getComponentName('enriched-text');
@@ -70,30 +70,13 @@ class EnrichedText extends createBaseClass({ componentName, baseSelector: ':host
70
70
  }
71
71
  }
72
72
 
73
- #disableAllRules() {
74
- if (!this.processor) {
75
- return;
76
- }
77
-
78
- ruleSet?.core && this.processor.core.ruler.disable(ruleSet.core);
79
- ruleSet?.inline && this.processor.inline.ruler.disable(ruleSet.inline);
80
- ruleSet?.block && this.processor.block.ruler.disable(ruleSet.block);
81
-
82
- this.processor.renderer.rules.image = () => {
83
- return '';
84
- };
85
- }
86
-
87
73
  #enableCustomRules() {
88
74
  if (!this.processor) {
89
75
  return;
90
76
  }
91
77
 
92
78
  const customRuleSet = textRuleSet;
93
-
94
- customRuleSet?.core && this.processor?.core.ruler.enable(customRuleSet?.core);
95
- customRuleSet?.inline && this.processor?.inline.ruler.enable(customRuleSet?.inline);
96
- customRuleSet?.block && this.processor?.block.ruler.enable(customRuleSet?.block);
79
+ this.processor.configure(customRuleSet || {});
97
80
 
98
81
  if (customRuleSet?.custom?.includes('image')) {
99
82
  this.processor.renderer.rules.image = this.#origImageRenderer;
@@ -101,13 +84,11 @@ class EnrichedText extends createBaseClass({ componentName, baseSelector: ':host
101
84
  }
102
85
 
103
86
  #updateProcessorRules() {
104
- this.#disableAllRules();
105
87
  this.#enableCustomRules();
106
88
  }
107
89
 
108
90
  #initProcessor() {
109
- this.processor = new Remarkable();
110
- this.#origImageRenderer = this.processor.renderer.rules.image;
91
+ this.processor = new MarkdownIt();
111
92
  this.#updateProcessorRules();
112
93
  }
113
94
 
@@ -123,7 +104,7 @@ class EnrichedText extends createBaseClass({ componentName, baseSelector: ':host
123
104
  let html = this.textContent;
124
105
 
125
106
  try {
126
- const tokens = this.processor.parse(this.textContent);
107
+ const tokens = this.processor.parse(this.textContent, { references: undefined });
127
108
  html = this.processor.renderer.render(tokens, { breaks: true });
128
109
  } catch (e) {
129
110
  // eslint-disable-next-line no-console
@@ -1,74 +1,13 @@
1
- export const ruleSet = {
2
- custom: ['image'],
3
- core: [
4
- 'block',
5
- 'inline',
6
- 'abbr', // Parse abbreviation definitions, i.e. `*[abbr]: description`
7
- 'abbr2', // Enclose abbreviations in <abbr> tags
8
- 'references',
9
- 'footnote_tail',
10
- 'replacements', // Simple typographical replacements
11
- 'smartquotes', // Convert straight quotation marks to typographic ones
12
- ],
13
- inline: [
14
- 'text',
15
- 'newline', // Proceess '\n'
16
- 'backticks', // Parse backticks
17
- 'del', // Process ~~deleted text~~
18
- 'emphasis', // Process *this* and _that_
19
- 'sub', // Process ~subscript~
20
- 'sup', // Process ^superscript^
21
- 'links', // Process [links](<to> "stuff")
22
- 'escape', // Proceess escaped chars and hardbreaks
23
- 'ins', // Process ++inserted text++
24
- 'mark', // Process ==highlighted text==
25
- 'footnote_inline', // Process inline footnotes (^[...])
26
- 'footnote_ref', // Process footnote references ([^...])
27
- 'autolink', // Process autolinks '<protocol:...>'
28
- 'htmltag', // Process html tags
29
- 'entity', // Process html entity - &#123;, &#xAF;, &quot;, ...
30
- ],
31
- block: [
32
- 'code', // Code block (4 spaces padded)
33
- 'fences', // fences (``` lang, ~~~ lang)
34
- 'blockquote', // Block quotes
35
- 'list',
36
- 'heading', // heading (#, ##, ...)
37
- 'paragraph',
38
- 'hr', // Horizontal rule
39
- 'footnote', // Process footnote reference list
40
- 'lheading', // lheading (---, ===)
41
- 'htmlblock', // HTML block
42
- 'table', // GFM table, non-standard
43
- 'deflist', // Definition lists
44
- ],
45
- };
46
-
47
1
  export const textRuleSet = {
48
- core: ['block', 'inline'],
49
- inline: [
50
- 'text',
51
- 'newline', // Proceess '\n'
52
- 'backticks', // Parse backticks
53
- 'del', // Process ~~deleted text~~
54
- 'emphasis', // Process *this* and _that_
55
- 'sub', // Process ~subscript~
56
- 'sup', // Process ^superscript^
57
- 'links', // Process [links](<to> "stuff")
58
- 'escape', // Proceess escaped chars and hardbreaks
59
- 'ins', // Process ++inserted text++
60
- 'footnote_inline', // Process inline footnotes (^[...])
61
- 'footnote_ref', // Process footnote references ([^...])
62
- 'autolink', // Process autolinks '<protocol:...>'
63
- ],
64
- block: [
65
- 'code', // Code block (4 spaces padded)
66
- 'fences', // fences (``` lang, ~~~ lang)
67
- 'blockquote', // Block quotes
68
- 'list',
69
- 'heading', // heading (#, ##, ...)
70
- 'paragraph',
71
- 'footnote', // Process footnote reference list
72
- 'htmlblock', // HTML block
73
- ],
2
+ components: {
3
+ core: {
4
+ rules: ['block', 'inline'],
5
+ },
6
+ block: {
7
+ rules: ['blockquote', 'code', 'heading', 'list', 'paragraph', 'list'],
8
+ },
9
+ inline: {
10
+ rules: ['backticks', 'strikethrough', 'link', 'emphasis', 'strikethrough', 'newline', 'text'],
11
+ },
12
+ },
74
13
  };
@@ -67,7 +67,7 @@ class PhoneFieldInternal extends BaseInputClass {
67
67
  } else {
68
68
  this.countryCodeInput.selectedItem = undefined;
69
69
  }
70
- this.phoneNumberInput.value = phoneNumber;
70
+ this.phoneNumberInput.value = this.phoneNumberInput.value || phoneNumber;
71
71
  }
72
72
 
73
73
  get phoneNumberValue() {
package/dist/umd/9927.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9927],{9927:(e,t,n)=>{var r;function o(e){return(r=r||document.createElement("textarea")).innerHTML="&"+e+";",r.value}n.d(t,{_:()=>Se});var s=Object.prototype.hasOwnProperty;function i(e){return[].slice.call(arguments,1).forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}var l=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function a(e){return e.indexOf("\\")<0?e:e.replace(l,"$1")}function c(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function p(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var h=/&([a-z#][a-z0-9]{1,31});/gi,u=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function f(e,t){var n=0,r=o(t);return t!==r?r:35===t.charCodeAt(0)&&u.test(t)&&c(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?p(n):e}function d(e){return e.indexOf("&")<0?e:e.replace(h,f)}var k=/[&<>"]/,v=/[&<>"]/g,g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function b(e){return g[e]}function _(e){return k.test(e)?e.replace(v,b):e}var m={};function y(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?y(e,t+2):t}m.blockquote_open=function(){return"<blockquote>\n"},m.blockquote_close=function(e,t){return"</blockquote>"+C(e,t)},m.code=function(e,t){return e[t].block?"<pre><code>"+_(e[t].content)+"</code></pre>"+C(e,t):"<code>"+_(e[t].content)+"</code>"},m.fence=function(e,t,n,r,o){var i,l,c,p,h=e[t],u="",f=n.langPrefix;if(h.params){if(l=(i=h.params.split(/\s+/g)).join(" "),c=o.rules.fence_custom,p=i[0],c&&s.call(c,p))return o.rules.fence_custom[i[0]](e,t,n,r,o);u=' class="'+f+_(d(a(l)))+'"'}return"<pre><code"+u+">"+(n.highlight&&n.highlight.apply(n.highlight,[h.content].concat(i))||_(h.content))+"</code></pre>"+C(e,t)},m.fence_custom={},m.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},m.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},m.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+C(e,t)},m.bullet_list_open=function(){return"<ul>\n"},m.bullet_list_close=function(e,t){return"</ul>"+C(e,t)},m.list_item_open=function(){return"<li>"},m.list_item_close=function(){return"</li>\n"},m.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},m.ordered_list_close=function(e,t){return"</ol>"+C(e,t)},m.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},m.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?C(e,t):"")},m.link_open=function(e,t,n){var r=e[t].title?' title="'+_(d(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+_(e[t].href)+'"'+r+o+">"},m.link_close=function(){return"</a>"},m.image=function(e,t,n){var r=' src="'+_(e[t].src)+'"',o=e[t].title?' title="'+_(d(e[t].title))+'"':"";return"<img"+r+' alt="'+(e[t].alt?_(d(a(e[t].alt))):"")+'"'+o+(n.xhtmlOut?" /":"")+">"},m.table_open=function(){return"<table>\n"},m.table_close=function(){return"</table>\n"},m.thead_open=function(){return"<thead>\n"},m.thead_close=function(){return"</thead>\n"},m.tbody_open=function(){return"<tbody>\n"},m.tbody_close=function(){return"</tbody>\n"},m.tr_open=function(){return"<tr>"},m.tr_close=function(){return"</tr>\n"},m.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},m.th_close=function(){return"</th>"},m.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},m.td_close=function(){return"</td>"},m.strong_open=function(){return"<strong>"},m.strong_close=function(){return"</strong>"},m.em_open=function(){return"<em>"},m.em_close=function(){return"</em>"},m.del_open=function(){return"<del>"},m.del_close=function(){return"</del>"},m.ins_open=function(){return"<ins>"},m.ins_close=function(){return"</ins>"},m.mark_open=function(){return"<mark>"},m.mark_close=function(){return"</mark>"},m.sub=function(e,t){return"<sub>"+_(e[t].content)+"</sub>"},m.sup=function(e,t){return"<sup>"+_(e[t].content)+"</sup>"},m.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},m.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},m.text=function(e,t){return _(e[t].content)},m.htmlblock=function(e,t){return e[t].content},m.htmltag=function(e,t){return e[t].content},m.abbr_open=function(e,t){return'<abbr title="'+_(d(e[t].title))+'">'},m.abbr_close=function(){return"</abbr>"},m.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},m.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},m.footnote_block_close=function(){return"</ol>\n</section>\n"},m.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},m.footnote_close=function(){return"</li>\n"},m.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},m.dl_open=function(){return"<dl>\n"},m.dt_open=function(){return"<dt>"},m.dd_open=function(){return"<dd>"},m.dl_close=function(){return"</dl>\n"},m.dt_close=function(){return"</dt>\n"},m.dd_close=function(){return"</dd>\n"};var C=m.getBreak=function(e,t){return(t=y(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};function x(){this.rules=i({},m),this.getBreak=m.getBreak}function A(){this.__rules__=[],this.__cache__=null}function M(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function S(e,t){var n,r,o,s=-1,i=e.posMax,l=e.pos,a=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<i;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0==--n){r=!0;break}e.parser.skipToken(e)}return r?(s=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=l,e.isInLabel=a,s}function I(e,t,n,r){var o,s,i,l,a,c;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if((s=S(o=new M(e,t,n,r,[]),1))<0||58!==e.charCodeAt(s+1))return-1;for(l=o.posMax,i=s+2;i<l&&10!==o.src.charCodeAt(i);i++);return a=e.slice(2,s),0===(c=e.slice(s+2,i).trim()).length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+a]&&(r.abbreviations[":"+a]=c),i)}function w(e){var t=d(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}function E(e,t){var n,r,o,s=t,i=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<i;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return o=w(a(e.src.slice(s+1,t))),!!e.parser.validateLink(o)&&(e.pos=t+1,e.linkContent=o,!0);92===n&&t+1<i?t+=2:t++}return!1}for(r=0;t<i&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<i)t+=2;else{if(40===n&&++r>1)break;if(41===n&&--r<0)break;t++}return s!==t&&(o=a(e.src.slice(s,t)),!!e.parser.validateLink(o)&&(e.linkContent=o,e.pos=t,!0))}function z(e,t){var n,r=t,o=e.posMax,s=e.src.charCodeAt(t);if(34!==s&&39!==s&&40!==s)return!1;for(t++,40===s&&(s=41);t<o;){if((n=e.src.charCodeAt(t))===s)return e.pos=t+1,e.linkContent=a(e.src.slice(r+1,t)),!0;92===n&&t+1<o?t+=2:t++}return!1}function L(e){return e.trim().replace(/\s+/g," ").toUpperCase()}function q(e,t,n,r){var o,s,i,l,a,c,p,h,u;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if((s=S(o=new M(e,t,n,r,[]),0))<0||58!==e.charCodeAt(s+1))return-1;for(l=o.posMax,i=s+2;i<l&&(32===(a=o.src.charCodeAt(i))||10===a);i++);if(!E(o,i))return-1;for(p=o.linkContent,c=i=o.pos,i+=1;i<l&&(32===(a=o.src.charCodeAt(i))||10===a);i++);for(i<l&&c!==i&&z(o,i)?(h=o.linkContent,i=o.pos):(h="",i=c);i<l&&32===o.src.charCodeAt(i);)i++;return i<l&&10!==o.src.charCodeAt(i)?-1:(u=L(e.slice(1,s)),void 0===r.references[u]&&(r.references[u]={title:h,href:p}),i)}x.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,s=0,i="";o--;)i+=r[e[s].type](e,s++,t,n,this);return i},x.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,s=-1,i="";++s<o;)"inline"===e[s].type?i+=this.renderInline(e[s].children,t,n):i+=r[e[s].type](e,s,t,n,this);return i},A.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},A.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach((function(e){e.enabled&&e.alt.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),e.__cache__={},t.forEach((function(t){e.__cache__[t]=[],e.__rules__.forEach((function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))}))}))},A.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},A.prototype.before=function(e,t,n,r){var o=this.__find__(e),s=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},A.prototype.after=function(e,t,n,r){var o=this.__find__(e),s=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},A.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},A.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach((function(e){e.enabled=!1})),e.forEach((function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0}),this),this.__cache__=null},A.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach((function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1}),this),this.__cache__=null},A.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},M.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},M.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},M.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},M.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0};var T=" \n()[]'\".,!?-";function O(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var $=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,N=/\((c|tm|r|p)\)/gi,R={c:"©",r:"®",p:"§",tm:"™"},j=/['"]/,Z=/['"]/g,P=/[-\s()\[\]]/;function U(e,t){return!(t<0||t>=e.length||P.test(e[t]))}function B(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var G=[["block",function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}],["abbr",function(e){var t,n,r,o,s=e.tokens;if(!e.inlineMode)for(t=1,n=s.length-1;t<n;t++)if("paragraph_open"===s[t-1].type&&"inline"===s[t].type&&"paragraph_close"===s[t+1].type){for(r=s[t].content;r.length&&!((o=I(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();s[t].content=r,r.length||(s[t-1].tight=!0,s[t+1].tight=!0)}}],["references",function(e){var t,n,r,o,s=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=s.length-1;t<n;t++)if("inline"===s[t].type&&"paragraph_open"===s[t-1].type&&"paragraph_close"===s[t+1].type){for(r=s[t].content;r.length&&!((o=q(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();s[t].content=r,r.length||(s[t-1].tight=!0,s[t+1].tight=!0)}}],["inline",function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}],["footnote_tail",function(e){var t,n,r,o,s,i,l,a,c,p=0,h=!1,u={};if(e.env.footnotes&&(e.tokens=e.tokens.filter((function(e){return"footnote_reference_open"===e.type?(h=!0,a=[],c=e.label,!1):"footnote_reference_close"===e.type?(h=!1,u[":"+c]=a,!1):(h&&a.push(e),!h)})),e.env.footnotes.list)){for(i=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:p++}),t=0,n=i.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:p++}),i[t].tokens?((l=[]).push({type:"paragraph_open",tight:!1,level:p++}),l.push({type:"inline",content:"",level:p,children:i[t].tokens}),l.push({type:"paragraph_close",tight:!1,level:--p})):i[t].label&&(l=u[":"+i[t].label]),e.tokens=e.tokens.concat(l),s="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=i[t].count>0?i[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:p});s&&e.tokens.push(s),e.tokens.push({type:"footnote_close",level:--p})}e.tokens.push({type:"footnote_block_close",level:--p})}}],["abbr2",function(e){var t,n,r,o,s,i,l,a,c,p,h,u,f=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(u="(^|["+T.split("").map(O).join("")+"])("+Object.keys(e.env.abbreviations).map((function(e){return e.substr(1)})).sort((function(e,t){return t.length-e.length})).map(O).join("|")+")($|["+T.split("").map(O).join("")+"])",e.env.abbrRegExp=new RegExp(u,"g")),p=e.env.abbrRegExp,n=0,r=f.length;n<r;n++)if("inline"===f[n].type)for(t=(o=f[n].children).length-1;t>=0;t--)if("text"===(s=o[t]).type){for(a=0,i=s.content,p.lastIndex=0,c=s.level,l=[];h=p.exec(i);)p.lastIndex>a&&l.push({type:"text",content:i.slice(a,h.index+h[1].length),level:c}),l.push({type:"abbr_open",title:e.env.abbreviations[":"+h[2]],level:c++}),l.push({type:"text",content:h[2],level:c}),l.push({type:"abbr_close",level:--c}),a=p.lastIndex-h[3].length;l.length&&(a<i.length&&l.push({type:"text",content:i.slice(a),level:c}),f[n].children=o=[].concat(o.slice(0,t),l,o.slice(t+1)))}}],["replacements",function(e){var t,n,r,o,s,i;if(e.options.typographer)for(s=e.tokens.length-1;s>=0;s--)if("inline"===e.tokens[s].type)for(t=(o=e.tokens[s].children).length-1;t>=0;t--)"text"===(n=o[t]).type&&(r=(i=r=n.content).indexOf("(")<0?i:i.replace(N,(function(e,t){return R[t.toLowerCase()]})),$.test(r)&&(r=r.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=r)}],["smartquotes",function(e){var t,n,r,o,s,i,l,a,c,p,h,u,f,d,k,v,g;if(e.options.typographer)for(g=[],k=e.tokens.length-1;k>=0;k--)if("inline"===e.tokens[k].type)for(v=e.tokens[k].children,g.length=0,t=0;t<v.length;t++)if("text"===(n=v[t]).type&&!j.test(n.text)){for(l=v[t].level,f=g.length-1;f>=0&&!(g[f].level<=l);f--);g.length=f+1,s=0,i=(r=n.content).length;e:for(;s<i&&(Z.lastIndex=s,o=Z.exec(r));)if(a=!U(r,o.index-1),s=o.index+1,d="'"===o[0],(c=!U(r,s))||a){if(h=!c,u=!a)for(f=g.length-1;f>=0&&(p=g[f],!(g[f].level<l));f--)if(p.single===d&&g[f].level===l){p=g[f],d?(v[p.token].content=B(v[p.token].content,p.pos,e.options.quotes[2]),n.content=B(n.content,o.index,e.options.quotes[3])):(v[p.token].content=B(v[p.token].content,p.pos,e.options.quotes[0]),n.content=B(n.content,o.index,e.options.quotes[1])),g.length=f;continue e}h?g.push({token:t,pos:o.index,single:d,level:l}):u&&d&&(n.content=B(n.content,o.index,"’"))}else d&&(n.content=B(n.content,o.index,"’"))}}]];function D(){this.options={},this.ruler=new A;for(var e=0;e<G.length;e++)this.ruler.push(G[e][0],G[e][1])}function H(e,t,n,r,o){var s,i,l,a,c,p,h;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",p=0,h=!1,l=a=p=0,c=(i=this.src).length;a<c;a++){if(s=i.charCodeAt(a),!h){if(32===s){p++;continue}h=!0}10!==s&&a!==c-1||(10!==s&&a++,this.bMarks.push(l),this.eMarks.push(a),this.tShift.push(p),h=!1,p=0,l=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function W(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])||42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n||r<o&&32!==e.src.charCodeAt(r)?-1:r}function F(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}D.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},H.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},H.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},H.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},H.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},H.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},H.prototype.getLines=function(e,t,n,r){var o,s,i,l,a,c=e;if(e>=t)return"";if(c+1===t)return s=this.bMarks[c]+Math.min(this.tShift[c],n),i=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(s,i);for(l=new Array(t-e),o=0;c<t;c++,o++)(a=this.tShift[c])>n&&(a=n),a<0&&(a=0),s=this.bMarks[c]+a,i=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],l[o]=this.src.slice(s,i);return l.join("")};var J={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(e){J[e]=!0}));var K=/^<([a-zA-Z]{1,15})[\s\/>]/,Q=/^<\/([a-zA-Z]{1,15})[\s>]/;function V(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}function X(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return o>=s||126!==(r=e.src.charCodeAt(o++))&&58!==r||o===(n=e.skipSpaces(o))||n>=s?-1:n}var Y=[["code",function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}],["fences",function(e,t,n,r){var o,s,i,l,a,c=!1,p=e.bMarks[t]+e.tShift[t],h=e.eMarks[t];if(p+3>h)return!1;if(126!==(o=e.src.charCodeAt(p))&&96!==o)return!1;if(a=p,(s=(p=e.skipChars(p,o))-a)<3)return!1;if((i=e.src.slice(p,h).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(l=t;!(++l>=n||(p=a=e.bMarks[l]+e.tShift[l])<(h=e.eMarks[l])&&e.tShift[l]<e.blkIndent);)if(e.src.charCodeAt(p)===o&&!(e.tShift[l]-e.blkIndent>=4||(p=e.skipChars(p,o))-a<s||(p=e.skipSpaces(p))<h)){c=!0;break}return s=e.tShift[t],e.line=l+(c?1:0),e.tokens.push({type:"fence",params:i,content:e.getLines(t+1,l,s,!0),lines:[t,e.line],level:e.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d,k=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(k>v)return!1;if(62!==e.src.charCodeAt(k++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(k)&&k++,a=e.blkIndent,e.blkIndent=0,l=[e.bMarks[t]],e.bMarks[t]=k,s=(k=k<v?e.skipSpaces(k):k)>=v,i=[e.tShift[t]],e.tShift[t]=k-e.bMarks[t],h=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((k=e.bMarks[o]+e.tShift[o])>=(v=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(k++)){if(s)break;for(d=!1,u=0,f=h.length;u<f;u++)if(h[u](e,o,n,!0)){d=!0;break}if(d)break;l.push(e.bMarks[o]),i.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(k)&&k++,l.push(e.bMarks[o]),e.bMarks[o]=k,s=(k=k<v?e.skipSpaces(k):k)>=v,i.push(e.tShift[o]),e.tShift[o]=k-e.bMarks[o];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:p=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,p[1]=e.line,u=0;u<i.length;u++)e.bMarks[u+t]=l[u],e.tShift[u+t]=i[u];return e.blkIndent=a,!0},["paragraph","blockquote","list"]],["hr",function(e,t,n,r){var o,s,i,l=e.bMarks[t],a=e.eMarks[t];if((l+=e.tShift[t])>a)return!1;if(42!==(o=e.src.charCodeAt(l++))&&45!==o&&95!==o)return!1;for(s=1;l<a;){if((i=e.src.charCodeAt(l++))!==o&&32!==i)return!1;i===o&&s++}return!(s<3||(r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level})),0))},["paragraph","blockquote","list"]],["list",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d,k,v,g,b,_,m,y,C,x,A,M=!0;if((h=F(e,t))>=0)k=!0;else{if(!((h=W(e,t))>=0))return!1;k=!1}if(e.level>=e.options.maxNesting)return!1;if(d=e.src.charCodeAt(h-1),r)return!0;for(g=e.tokens.length,k?(p=e.bMarks[t]+e.tShift[t],f=Number(e.src.substr(p,h-p-1)),e.tokens.push({type:"ordered_list_open",order:f,lines:_=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:_=[t,0],level:e.level++}),o=t,b=!1,y=e.parser.ruler.getRules("list");!(!(o<n)||((u=(v=e.skipSpaces(h))>=e.eMarks[o]?1:v-h)>4&&(u=1),u<1&&(u=1),s=h-e.bMarks[o]+u,e.tokens.push({type:"list_item_open",lines:m=[t,0],level:e.level++}),l=e.blkIndent,a=e.tight,i=e.tShift[t],c=e.parentType,e.tShift[t]=v-e.bMarks[t],e.blkIndent=s,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!b||(M=!1),b=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=l,e.tShift[t]=i,e.tight=a,e.parentType=c,e.tokens.push({type:"list_item_close",level:--e.level}),o=t=e.line,m[1]=o,v=e.bMarks[t],o>=n)||e.isEmpty(o)||e.tShift[o]<e.blkIndent);){for(A=!1,C=0,x=y.length;C<x;C++)if(y[C](e,o,n,!0)){A=!0;break}if(A)break;if(k){if((h=F(e,o))<0)break}else if((h=W(e,o))<0)break;if(d!==e.src.charCodeAt(h-1))break}return e.tokens.push({type:k?"ordered_list_close":"bullet_list_close",level:--e.level}),_[1]=o,e.line=o,M&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,g),!0},["paragraph","blockquote"]],["footnote",function(e,t,n,r){var o,s,i,l,a,c=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(c+4>p)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(l=c+2;l<p;l++){if(32===e.src.charCodeAt(l))return!1;if(93===e.src.charCodeAt(l))break}return!(l===c+2||l+1>=p||58!==e.src.charCodeAt(++l)||(r||(l++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),a=e.src.slice(c+2,l-2),e.env.footnotes.refs[":"+a]=-1,e.tokens.push({type:"footnote_reference_open",label:a,level:e.level++}),o=e.bMarks[t],s=e.tShift[t],i=e.parentType,e.tShift[t]=e.skipSpaces(l)-l,e.bMarks[t]=l,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=i,e.blkIndent-=4,e.tShift[t]=s,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level})),0))},["paragraph"]],["heading",function(e,t,n,r){var o,s,i,l=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(l>=a)return!1;if(35!==(o=e.src.charCodeAt(l))||l>=a)return!1;for(s=1,o=e.src.charCodeAt(++l);35===o&&l<a&&s<=6;)s++,o=e.src.charCodeAt(++l);return!(s>6||l<a&&32!==o||(r||(a=e.skipCharsBack(a,32,l),(i=e.skipCharsBack(a,35,l))>l&&32===e.src.charCodeAt(i-1)&&(a=i),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:s,lines:[t,e.line],level:e.level}),l<a&&e.tokens.push({type:"inline",content:e.src.slice(l,a).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:s,level:e.level})),0))},["paragraph","blockquote"]],["lheading",function(e,t,n){var r,o,s,i=t+1;return!(i>=n||e.tShift[i]<e.blkIndent||e.tShift[i]-e.blkIndent>3||(o=e.bMarks[i]+e.tShift[i])>=(s=e.eMarks[i])||45!==(r=e.src.charCodeAt(o))&&61!==r||(o=e.skipChars(o,r),(o=e.skipSpaces(o))<s||(o=e.bMarks[t]+e.tShift[t],e.line=i+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),0)))}],["htmlblock",function(e,t,n,r){var o,s,i,l=e.bMarks[t],a=e.eMarks[t],c=e.tShift[t];if(l+=c,!e.options.html)return!1;if(c>3||l+2>=a)return!1;if(60!==e.src.charCodeAt(l))return!1;if(33===(o=e.src.charCodeAt(l+1))||63===o){if(r)return!0}else{if(47!==o&&!function(e){var t=32|e;return t>=97&&t<=122}(o))return!1;if(47===o){if(!(s=e.src.slice(l,a).match(Q)))return!1}else if(!(s=e.src.slice(l,a).match(K)))return!1;if(!0!==J[s[1].toLowerCase()])return!1;if(r)return!0}for(i=t+1;i<e.lineMax&&!e.isEmpty(i);)i++;return e.line=i,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,i,0,!0)}),!0},["paragraph","blockquote"]],["table",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d;if(t+2>n)return!1;if(a=t+1,e.tShift[a]<e.blkIndent)return!1;if((i=e.bMarks[a]+e.tShift[a])>=e.eMarks[a])return!1;if(124!==(o=e.src.charCodeAt(i))&&45!==o&&58!==o)return!1;if(s=V(e,t+1),!/^[-:| ]+$/.test(s))return!1;if((c=s.split("|"))<=2)return!1;for(h=[],l=0;l<c.length;l++){if(!(u=c[l].trim())){if(0===l||l===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(u))return!1;58===u.charCodeAt(u.length-1)?h.push(58===u.charCodeAt(0)?"center":"right"):58===u.charCodeAt(0)?h.push("left"):h.push("")}if(-1===(s=V(e,t).trim()).indexOf("|"))return!1;if(c=s.replace(/^\||\|$/g,"").split("|"),h.length!==c.length)return!1;if(r)return!0;for(e.tokens.push({type:"table_open",lines:f=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),l=0;l<c.length;l++)e.tokens.push({type:"th_open",align:h[l],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[l].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:d=[t+2,0],level:e.level++}),a=t+2;a<n&&!(e.tShift[a]<e.blkIndent)&&-1!==(s=V(e,a).trim()).indexOf("|");a++){for(c=s.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),l=0;l<c.length;l++)e.tokens.push({type:"td_open",align:h[l],level:e.level++}),p=c[l].substring(124===c[l].charCodeAt(0)?1:0,124===c[l].charCodeAt(c[l].length-1)?c[l].length-1:c[l].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),f[1]=d[1]=a,e.line=a,!0},["paragraph"]],["deflist",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d,k,v,g;if(r)return!(e.ddIndent<0)&&X(e,t)>=0;if(p=t+1,e.isEmpty(p)&&++p>n)return!1;if(e.tShift[p]<e.blkIndent)return!1;if((o=X(e,p))<0)return!1;if(e.level>=e.options.maxNesting)return!1;c=e.tokens.length,e.tokens.push({type:"dl_open",lines:a=[t,0],level:e.level++}),i=t,s=p;e:for(;;){for(g=!0,v=!1,e.tokens.push({type:"dt_open",lines:[i,i],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(i,i+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[i,i],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:l=[p,0],level:e.level++}),k=e.tight,u=e.ddIndent,h=e.blkIndent,d=e.tShift[s],f=e.parentType,e.blkIndent=e.ddIndent=e.tShift[s]+2,e.tShift[s]=o-e.bMarks[s],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,s,n,!0),e.tight&&!v||(g=!1),v=e.line-s>1&&e.isEmpty(e.line-1),e.tShift[s]=d,e.tight=k,e.parentType=f,e.blkIndent=h,e.ddIndent=u,e.tokens.push({type:"dd_close",level:--e.level}),l[1]=p=e.line,p>=n)break e;if(e.tShift[p]<e.blkIndent)break e;if((o=X(e,p))<0)break;s=p}if(p>=n)break;if(i=p,e.isEmpty(i))break;if(e.tShift[i]<e.blkIndent)break;if((s=i+1)>=n)break;if(e.isEmpty(s)&&s++,s>=n)break;if(e.tShift[s]<e.blkIndent)break;if((o=X(e,s))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),a[1]=p,e.line=p,g&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,c),!0},["paragraph"]],["paragraph",function(e,t){var n,r,o,s,i,l,a=t+1;if(a<(n=e.lineMax)&&!e.isEmpty(a))for(l=e.parser.ruler.getRules("paragraph");a<n&&!e.isEmpty(a);a++)if(!(e.tShift[a]-e.blkIndent>3)){for(o=!1,s=0,i=l.length;s<i;s++)if(l[s](e,a,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,a,e.blkIndent,!1).trim(),e.line=a,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}]];function ee(){this.ruler=new A;for(var e=0;e<Y.length;e++)this.ruler.push(Y[e][0],Y[e][1],{alt:(Y[e][2]||[]).slice()})}ee.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),s=o.length,i=t,l=!1;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n))&&!(e.tShift[i]<e.blkIndent);){for(r=0;r<s&&!o[r](e,i,n,!1);r++);if(e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),(i=e.line)<n&&e.isEmpty(i)){if(l=!0,++i<n&&"list"===e.parentType&&e.isEmpty(i))break;e.line=i}}};var te=/[\n\t]/g,ne=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,re=/\u00a0/g;function oe(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}ee.prototype.parse=function(e,t,n,r){var o,s=0,i=0;if(!e)return[];(e=(e=e.replace(re," ")).replace(ne,"\n")).indexOf("\t")>=0&&(e=e.replace(te,(function(t,n){var r;return 10===e.charCodeAt(n)?(s=n+1,i=0,t):(r=" ".slice((n-s-i)%4),i=n-s+1,r)}))),o=new H(e,this,t,n,r),this.tokenize(o,o.line,o.lineMax)};for(var se=[],ie=0;ie<256;ie++)se.push(0);function le(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function ae(e,t){var n,r,o,s=t,i=!0,l=!0,a=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;s<a&&e.src.charCodeAt(s)===c;)s++;return s>=a&&(i=!1),(o=s-t)>=4?i=l=!1:(32!==(r=s<a?e.src.charCodeAt(s):-1)&&10!==r||(i=!1),32!==n&&10!==n||(l=!1),95===c&&(le(n)&&(i=!1),le(r)&&(l=!1))),{can_open:i,can_close:l,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){se[e.charCodeAt(0)]=1}));var ce=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,pe=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,he=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],ue=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,fe=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function de(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var ke=de(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),ve=de(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",ke)(),ge=de(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",ve)(),be=de(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",ge)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)(),_e=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,me=/^&([a-z][a-z0-9]{1,31});/i,ye=[["text",function(e,t){for(var n=e.pos;n<e.posMax&&!oe(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["newline",function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var s=n-2;s>=0;s--)if(32!==e.pending.charCodeAt(s)){e.pending=e.pending.substring(0,s+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}],["escape",function(e,t){var n,r=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r<o){if((n=e.src.charCodeAt(r))<256&&0!==se[n])return t||(e.pending+=e.src[r]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),r++;r<o&&32===e.src.charCodeAt(r);)r++;return e.pos=r,!0}}return t||(e.pending+="\\"),e.pos++,!0}],["backticks",function(e,t){var n,r,o,s,i,l=e.pos;if(96!==e.src.charCodeAt(l))return!1;for(n=l,l++,r=e.posMax;l<r&&96===e.src.charCodeAt(l);)l++;for(o=e.src.slice(n,l),s=i=l;-1!==(s=e.src.indexOf("`",i));){for(i=s+1;i<r&&96===e.src.charCodeAt(i);)i++;if(i-s===o.length)return t||e.push({type:"code",content:e.src.slice(l,s).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=i,!0}return t||(e.pending+=o),e.pos+=o.length,!0}],["del",function(e,t){var n,r,o,s,i,l=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(126!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(s=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),126===s)return!1;if(126===i)return!1;if(32===i||10===i)return!1;for(r=a+2;r<l&&126===e.src.charCodeAt(r);)r++;if(r>a+3)return e.pos+=r-a,t||(e.pending+=e.src.slice(a,r)),!0;for(e.pos=a+2,o=1;e.pos+1<l;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(s=e.src.charCodeAt(e.pos-1),126!==(i=e.pos+2<l?e.src.charCodeAt(e.pos+2):-1)&&126!==s&&(32!==s&&10!==s?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}],["ins",function(e,t){var n,r,o,s,i,l=e.posMax,a=e.pos;if(43!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(43!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(s=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),43===s)return!1;if(43===i)return!1;if(32===i||10===i)return!1;for(r=a+2;r<l&&43===e.src.charCodeAt(r);)r++;if(r!==a+2)return e.pos+=r-a,t||(e.pending+=e.src.slice(a,r)),!0;for(e.pos=a+2,o=1;e.pos+1<l;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(s=e.src.charCodeAt(e.pos-1),43!==(i=e.pos+2<l?e.src.charCodeAt(e.pos+2):-1)&&43!==s&&(32!==s&&10!==s?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}],["mark",function(e,t){var n,r,o,s,i,l=e.posMax,a=e.pos;if(61!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(61!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(s=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),61===s)return!1;if(61===i)return!1;if(32===i||10===i)return!1;for(r=a+2;r<l&&61===e.src.charCodeAt(r);)r++;if(r!==a+2)return e.pos+=r-a,t||(e.pending+=e.src.slice(a,r)),!0;for(e.pos=a+2,o=1;e.pos+1<l;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(s=e.src.charCodeAt(e.pos-1),61!==(i=e.pos+2<l?e.src.charCodeAt(e.pos+2):-1)&&61!==s&&(32!==s&&10!==s?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}],["emphasis",function(e,t){var n,r,o,s,i,l,a,c=e.posMax,p=e.pos,h=e.src.charCodeAt(p);if(95!==h&&42!==h)return!1;if(t)return!1;if(n=(a=ae(e,p)).delims,!a.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,l=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==h)e.parser.skipToken(e);else{if(r=(a=ae(e,e.pos)).delims,a.can_close){for(s=l.pop(),i=r;s!==i;){if(i<s){l.push(s-i);break}if(i-=s,0===l.length)break;e.pos+=s,s=l.pop()}if(0===l.length){n=s,o=!0;break}e.pos+=r;continue}a.can_open&&l.push(r),e.pos+=r}return o?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=p,!1)}],["sub",function(e,t){var n,r,o=e.posMax,s=e.pos;if(126!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=s+1;e.pos<o;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&s+1!==e.pos?(r=e.src.slice(s+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=s,!1):(e.posMax=e.pos,e.pos=s+1,t||e.push({type:"sub",level:e.level,content:r.replace(ce,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0):(e.pos=s,!1)}],["sup",function(e,t){var n,r,o=e.posMax,s=e.pos;if(94!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=s+1;e.pos<o;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&s+1!==e.pos?(r=e.src.slice(s+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=s,!1):(e.posMax=e.pos,e.pos=s+1,t||e.push({type:"sup",level:e.level,content:r.replace(pe,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0):(e.pos=s,!1)}],["links",function(e,t){var n,r,o,s,i,l,a,c,p=!1,h=e.pos,u=e.posMax,f=e.pos,d=e.src.charCodeAt(f);if(33===d&&(p=!0,d=e.src.charCodeAt(++f)),91!==d)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=f+1,(r=S(e,f))<0)return!1;if((l=r+1)<u&&40===e.src.charCodeAt(l)){for(l++;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);if(l>=u)return!1;for(f=l,E(e,l)?(s=e.linkContent,l=e.pos):s="",f=l;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);if(l<u&&f!==l&&z(e,l))for(i=e.linkContent,l=e.pos;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);else i="";if(l>=u||41!==e.src.charCodeAt(l))return e.pos=h,!1;l++}else{if(e.linkLevel>0)return!1;for(;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);if(l<u&&91===e.src.charCodeAt(l)&&(f=l+1,(l=S(e,l))>=0?o=e.src.slice(f,l++):l=f-1),o||(void 0===o&&(l=r+1),o=e.src.slice(n,r)),!(a=e.env.references[L(o)]))return e.pos=h,!1;s=a.href,i=a.title}return t||(e.pos=n,e.posMax=r,p?e.push({type:"image",src:s,title:i,alt:e.src.substr(n,r-n),level:e.level}):(e.push({type:"link_open",href:s,title:i,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=l,e.posMax=u,!0}],["footnote_inline",function(e,t){var n,r,o,s,i=e.posMax,l=e.pos;return!(l+2>=i||94!==e.src.charCodeAt(l)||91!==e.src.charCodeAt(l+1)||e.level>=e.options.maxNesting||(n=l+2,(r=S(e,l+1))<0||(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=n,e.posMax=r,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,s=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(s)},e.linkLevel--),e.pos=r+1,e.posMax=i,0)))}],["footnote_ref",function(e,t){var n,r,o,s,i=e.posMax,l=e.pos;if(l+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=l+2;r<i;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return!(r===l+2||r>=i||(r++,n=e.src.slice(l+2,r-1),void 0===e.env.footnotes.refs[":"+n]||(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],s=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:s,level:e.level})),e.pos=r,e.posMax=i,0)))}],["autolink",function(e,t){var n,r,o,s,i,l=e.pos;return!(60!==e.src.charCodeAt(l)||(n=e.src.slice(l)).indexOf(">")<0||((r=n.match(fe))?he.indexOf(r[1].toLowerCase())<0||(i=w(s=r[0].slice(1,-1)),!e.parser.validateLink(s)||(t||(e.push({type:"link_open",href:i,level:e.level}),e.push({type:"text",content:s,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=r[0].length,0)):!(o=n.match(ue))||(i=w("mailto:"+(s=o[0].slice(1,-1))),!e.parser.validateLink(i)||(t||(e.push({type:"link_open",href:i,level:e.level}),e.push({type:"text",content:s,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=o[0].length,0))))}],["htmltag",function(e,t){var n,r,o,s=e.pos;return!(!e.options.html||(o=e.posMax,60!==e.src.charCodeAt(s)||s+2>=o||33!==(n=e.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n)||!(r=e.src.slice(s).match(be))||(t||e.push({type:"htmltag",content:e.src.slice(s,s+r[0].length),level:e.level}),e.pos+=r[0].length,0)))}],["entity",function(e,t){var n,r,s=e.pos,i=e.posMax;if(38!==e.src.charCodeAt(s))return!1;if(s+1<i)if(35===e.src.charCodeAt(s+1)){if(r=e.src.slice(s).match(_e))return t||(n="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),e.pending+=c(n)?p(n):p(65533)),e.pos+=r[0].length,!0}else if(r=e.src.slice(s).match(me)){var l=o(r[1]);if(r[1]!==l)return t||(e.pending+=l),e.pos+=r[0].length,!0}return t||(e.pending+="&"),e.pos++,!0}]];function Ce(){this.ruler=new A;for(var e=0;e<ye.length;e++)this.ruler.push(ye[e][0],ye[e][1]);this.validateLink=xe}function xe(e){var t=e.trim().toLowerCase();return-1===(t=d(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}Ce.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,s=e.pos;if((n=e.cacheGet(s))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(s,e.pos);e.pos++,e.cacheSet(s,e.pos)}},Ce.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,s=e.posMax;e.pos<s;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=s)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ce.prototype.parse=function(e,t,n,r){var o=new M(e,this,t,n,r);this.tokenize(o)};var Ae={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function Me(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function Se(e,t){"string"!=typeof e&&(t=e,e="default"),t&&null!=t.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Ce,this.block=new ee,this.core=new D,this.renderer=new x,this.ruler=new A,this.options={},this.configure(Ae[e]),this.set(t||{})}Se.prototype.set=function(e){i(this.options,e)},Se.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)}))},Se.prototype.use=function(e,t){return e(this,t),this},Se.prototype.parse=function(e,t){var n=new Me(this,e,t);return this.core.process(n),n.tokens},Se.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Se.prototype.parseInline=function(e,t){var n=new Me(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Se.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)}}}]);