@lifesg/web-frontend-engine 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/chunks/{file-upload-manager.27debdaa.js → file-upload-manager.581859a5.js} +2 -2
- package/chunks/{file-upload-manager.27debdaa.js.map → file-upload-manager.581859a5.js.map} +1 -1
- package/chunks/{index.b5f8bb97.js → index.8cc1cf41.js} +8 -8
- package/chunks/{index.b5f8bb97.js.map → index.8cc1cf41.js.map} +1 -1
- package/chunks/{index.93ef32cd.js → index.bba30c64.js} +2 -2
- package/chunks/{index.93ef32cd.js.map → index.bba30c64.js.map} +1 -1
- package/chunks/{index.2f7eb734.js → index.d31714ac.js} +2 -2
- package/chunks/{index.2f7eb734.js.map → index.d31714ac.js.map} +1 -1
- package/chunks/{location-modal.4a00fa7b.js → location-modal.60f7c5c4.js} +2 -2
- package/chunks/{location-modal.4a00fa7b.js.map → location-modal.60f7c5c4.js.map} +1 -1
- package/cjs/chunks/{file-upload-manager.75e07efb.js → file-upload-manager.75d19b87.js} +2 -2
- package/cjs/chunks/{file-upload-manager.75e07efb.js.map → file-upload-manager.75d19b87.js.map} +1 -1
- package/cjs/chunks/{index.bb0ba7ce.js → index.00d4458f.js} +8 -8
- package/cjs/chunks/{index.bb0ba7ce.js.map → index.00d4458f.js.map} +1 -1
- package/cjs/chunks/{index.fafcc083.js → index.260bcc27.js} +2 -2
- package/cjs/chunks/{index.fafcc083.js.map → index.260bcc27.js.map} +1 -1
- package/cjs/chunks/{index.d2321141.js → index.b1899917.js} +2 -2
- package/cjs/chunks/{index.d2321141.js.map → index.b1899917.js.map} +1 -1
- package/cjs/chunks/{location-modal.5d849c88.js → location-modal.ff55a907.js} +2 -2
- package/cjs/chunks/{location-modal.5d849c88.js.map → location-modal.ff55a907.js.map} +1 -1
- package/cjs/index.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
|
@@ -276,7 +276,7 @@ Zf((function(e){Object.getOwnPropertyNames(Vp.prototype).forEach((function(t){"c
|
|
|
276
276
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
277
277
|
* Released under the MIT License.
|
|
278
278
|
*/
|
|
279
|
-
function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(EO,"__esModule",{value:!0}),EO.isPlainObject=function(e){var t,n;return!1!==SO(e)&&(void 0===(t=e.constructor)||!1!==SO(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};var AO=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===xO}(e)}(e)};var xO="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function wO(e,t){return!1!==t.clone&&t.isMergeableObject(e)?NO((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function TO(e,t,n){return e.concat(t).map((function(e){return wO(e,n)}))}function MO(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function OO(e,t){try{return t in e}catch(e){return!1}}function CO(e,t,n){var r={};return n.isMergeableObject(e)&&MO(e).forEach((function(t){r[t]=wO(e[t],n)})),MO(t).forEach((function(i){(function(e,t){return OO(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(OO(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return NO;var n=t.customMerge(e);return"function"==typeof n?n:NO}(i,n)(e[i],t[i],n):r[i]=wO(t[i],n))})),r}function NO(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||TO,n.isMergeableObject=n.isMergeableObject||AO,n.cloneUnlessOtherwiseSpecified=wO;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):CO(e,t,n):wO(t,n)}NO.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return NO(e,n,t)}),{})};var DO,LO=NO,IO={exports:{}};DO=IO,function(e,t){DO.exports?DO.exports=t():e.parseSrcset=t()}(St,(function(){return function(e){function t(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function n(t){var n,r=t.exec(e.substring(m));if(r)return n=r[0],m+=n.length,n}for(var r,i,a,o,s,u=e.length,c=/^[ \t\n\r\u000c]+/,l=/^[, \t\n\r\u000c]+/,d=/^[^ \t\n\r\u000c]+/,f=/[,]+$/,p=/^\d+$/,h=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,m=0,g=[];;){if(n(l),m>=u)return g;r=n(d),i=[],","===r.slice(-1)?(r=r.replace(f,""),_()):y()}function y(){for(n(c),a="",o="in descriptor";;){if(s=e.charAt(m),"in descriptor"===o)if(t(s))a&&(i.push(a),a="",o="after descriptor");else{if(","===s)return m+=1,a&&i.push(a),void _();if("("===s)a+=s,o="in parens";else{if(""===s)return a&&i.push(a),void _();a+=s}}else if("in parens"===o)if(")"===s)a+=s,o="in descriptor";else{if(""===s)return i.push(a),void _();a+=s}else if("after descriptor"===o)if(t(s));else{if(""===s)return void _();o="in descriptor",m-=1}m+=1}}function _(){var t,n,a,o,s,u,c,l,d,f=!1,m={};for(o=0;o<i.length;o++)u=(s=i[o])[s.length-1],c=s.substring(0,s.length-1),l=parseInt(c,10),d=parseFloat(c),p.test(c)&&"w"===u?((t||n)&&(f=!0),0===l?f=!0:t=l):h.test(c)&&"x"===u?((t||n||a)&&(f=!0),d<0?f=!0:n=d):p.test(c)&&"h"===u?((a||n)&&(f=!0),0===l?f=!0:a=l):f=!0;f?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+s+"'."):(m.url=r,t&&(m.w=t),n&&(m.d=n),a&&(m.h=a),g.push(m))}}}));var kO={exports:{}},$O=String,RO=function(){return{isColorSupported:!1,reset:$O,bold:$O,dim:$O,italic:$O,underline:$O,inverse:$O,hidden:$O,strikethrough:$O,black:$O,red:$O,green:$O,yellow:$O,blue:$O,magenta:$O,cyan:$O,white:$O,gray:$O,bgBlack:$O,bgRed:$O,bgGreen:$O,bgYellow:$O,bgBlue:$O,bgMagenta:$O,bgCyan:$O,bgWhite:$O,blackBright:$O,redBright:$O,greenBright:$O,yellowBright:$O,blueBright:$O,magentaBright:$O,cyanBright:$O,whiteBright:$O,bgBlackBright:$O,bgRedBright:$O,bgGreenBright:$O,bgYellowBright:$O,bgBlueBright:$O,bgMagentaBright:$O,bgCyanBright:$O,bgWhiteBright:$O}};kO.exports=RO(),kO.exports.createColors=RO;var FO=At(Object.freeze({__proto__:null,default:{}}));let zO=kO.exports,PO=FO;class jO extends Error{constructor(e,t,n,r,i,a){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),r&&(this.source=r),a&&(this.plugin=a),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,jO)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=zO.isColorSupported);let n=e=>e,r=e=>e,i=e=>e;if(e){let{bold:e,gray:t,red:a}=zO.createColors(!0);r=t=>e(a(t)),n=e=>t(e),PO&&(i=e=>PO(e))}let a=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(o,s).map(((e,t)=>{let a=o+1+t,s=" "+(" "+a).slice(-u)+" | ";if(a===this.line){if(e.length>160){let t=20,a=Math.max(0,this.column-t),o=Math.max(this.column+t,this.endColumn+t),u=e.slice(a,o),c=n(s.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return r(">")+n(s)+i(u)+"\n "+c+r("^")}let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+i(e)+"\n "+t+r("^")}return" "+n(s)+i(e)})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}var ZO=jO;jO.default=jO;const UO={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class BO{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,"before");a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return UO[n];let a=e.root();if(a.rawCache||(a.rawCache={}),void 0!==a.rawCache[n])return a.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((o=n)[0].toUpperCase()+o.slice(1));this[i]?r=this[i](a,e):a.walk((e=>{if(r=e.raws[t],void 0!==r)return!1}))}var o;return void 0===r&&(r=UO[n]),a.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var VO=BO;BO.default=BO;let HO=VO;function GO(e,t){new HO(t).stringify(e)}var YO=GO;GO.default=GO;var WO={};WO.isClean=Symbol("isClean"),WO.my=Symbol("my");let qO=ZO,KO=VO,JO=YO,{isClean:XO,my:QO}=WO;function eC(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],a=typeof i;"parent"===r&&"object"===a?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map((e=>eC(e,n))):("object"===a&&null!==i&&(i=eC(i)),n[r]=i)}return n}function tC(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,r=1,i=0;for(let a=0;a<e.length;a++){if(r===t.line&&n===t.column){i=a;break}"\n"===e[a]?(n=1,r+=1):n+=1}return i}class nC{get proxyOf(){return this}constructor(e={}){this.raws={},this[XO]=!1,this[QO]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=eC(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new qO(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[XO]=!0}markDirty(){if(this[XO]){this[XO]=!1;let e=this;for(;e=e.parent;)e[XO]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r=n.slice(tC(n,this.source.start),tC(n,this.source.end)).indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=tC(r,this.source.start),a=i+e;for(let e=i;e<a;e++)"\n"===r[e]?(t=1,n+=1):t+=1;return{column:t,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,i=r.slice(tC(r,this.source.start),tC(r,this.source.end)).indexOf(e.word);-1!==i&&(t=this.positionInside(i),n=this.positionInside(i+e.word.length))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new KO).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let a=t.get(r.input);null==a&&(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=JO){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}}var rC=nC;nC.default=nC;let iC=rC;class aC extends iC{constructor(e){super(e),this.type="comment"}}var oC=aC;aC.default=aC;let sC=rC;class uC extends sC{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}var cC=uC;uC.default=uC;let lC,dC,fC,pC,hC=oC,mC=cC,gC=rC,{isClean:yC,my:_C}=WO;function vC(e){return e.map((e=>(e.nodes&&(e.nodes=vC(e.nodes)),delete e.source,e)))}function bC(e){if(e[yC]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)bC(t)}class EC extends gC{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",a=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of a)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+a.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=vC(dC(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new mC(e)]}else if(e.selector||e.selectors)e=[new pC(e)];else if(e.name)e=[new lC(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new hC(e)]}return e.map((e=>(e[_C]||EC.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[yC]&&bC(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)})):this.walk(((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)})):this.walk(((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)})):this.walk(((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}}EC.registerParse=e=>{dC=e},EC.registerRule=e=>{pC=e},EC.registerAtRule=e=>{lC=e},EC.registerRoot=e=>{fC=e};var SC=EC;EC.default=EC,EC.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,lC.prototype):"rule"===e.type?Object.setPrototypeOf(e,pC.prototype):"decl"===e.type?Object.setPrototypeOf(e,mC.prototype):"comment"===e.type?Object.setPrototypeOf(e,hC.prototype):"root"===e.type&&Object.setPrototypeOf(e,fC.prototype),e[_C]=!0,e.nodes&&e.nodes.forEach((e=>{EC.rebuild(e)}))};let AC=SC;class xC extends AC{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}var wC=xC;xC.default=xC,AC.registerAtRule(xC);let TC,MC,OC=SC;class CC extends OC{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new TC(new MC,this,e).stringify()}}CC.registerLazyResult=e=>{TC=e},CC.registerProcessor=e=>{MC=e};var NC=CC;CC.default=CC;var DC={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=0|n;for(;i--;)r+=e[Math.random()*e.length|0];return r}};let{existsSync:LC,readFileSync:IC}=FO,{dirname:kC,join:$C}=FO,{SourceMapConsumer:RC,SourceMapGenerator:FC}=FO;class zC{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=kC(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new RC(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return r=e.substr(n[0].length),Buffer?Buffer.from(r,"base64").toString():window.atob(r);var r;let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=kC(e),LC(e))return this.mapFile=e,IC(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof RC)return FC.fromSourceMap(t).toString();if(t instanceof FC)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$C(kC(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}var PC=zC;zC.default=zC;let{nanoid:jC}=DC,{isAbsolute:ZC,resolve:UC}=FO,{SourceMapConsumer:BC,SourceMapGenerator:VC}=FO,{fileURLToPath:HC,pathToFileURL:GC}=FO,YC=ZO,WC=PC,qC=FO,KC=Symbol("fromOffsetCache"),JC=Boolean(BC&&VC),XC=Boolean(UC&&ZC);class QC{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!XC||/^\w+:\/\//.test(t.from)||ZC(t.from)?this.file=t.from:this.file=UC(t.from)),XC&&JC){let e=new WC(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+jC(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,a,o;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);a=e.line,i=e.col}else a=r.line,i=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let s=this.origin(t,n,a,i);return o=s?new YC(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,r.plugin):new YC(e,void 0===a?t:{column:n,line:t},void 0===a?n:{column:i,line:a},this.css,this.file,r.plugin),o.input={column:n,endColumn:i,endLine:a,line:t,source:this.css},this.file&&(GC&&(o.input.url=GC(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[KC])n=this[KC];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[KC]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:UC(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,a,o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n})),a=ZC(s.source)?GC(s.source):new URL(s.source,this.map.consumer().sourceRoot||GC(this.map.mapFile));let u={column:s.column,endColumn:i&&i.column,endLine:i&&i.line,line:s.line,url:a.toString()};if("file:"===a.protocol){if(!HC)throw new Error("file: protocol is not available in this PostCSS build");u.file=HC(a)}let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}var eN=QC;QC.default=QC,qC&&qC.registerInput&&qC.registerInput(QC);let tN,nN,rN=SC;class iN extends rN{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new tN(new nN,this,e).stringify()}}iN.registerLazyResult=e=>{tN=e},iN.registerProcessor=e=>{nN=e};var aN=iN;iN.default=iN,rN.registerRoot(iN);let oN={comma:e=>oN.split(e,[","],!0),space:e=>oN.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",a=!1,o=0,s=!1,u="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:s?n===u&&(s=!1):'"'===n||"'"===n?(s=!0,u=n):"("===n?o+=1:")"===n?o>0&&(o-=1):0===o&&t.includes(n)&&(a=!0),a?(""!==i&&r.push(i.trim()),i="",a=!1):i+=n;return(n||""!==i)&&r.push(i.trim()),r}};var sN=oN;oN.default=oN;let uN=SC,cN=sN;class lN extends uN{get selectors(){return cN.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}var dN=lN;lN.default=lN,uN.registerRule(lN);let fN=wC,pN=oC,hN=cC,mN=eN,gN=PC,yN=aN,_N=dN;function vN(e,t){if(Array.isArray(e))return e.map((e=>vN(e)));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:mN.prototype};n.map&&(n.map={...n.map,__proto__:gN.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map((e=>vN(e,t)))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new yN(r);if("decl"===r.type)return new hN(r);if("rule"===r.type)return new _N(r);if("comment"===r.type)return new pN(r);if("atrule"===r.type)return new fN(r);throw new Error("Unknown node type: "+e.type)}var bN=vN;vN.default=vN;let{dirname:EN,relative:SN,resolve:AN,sep:xN}=FO,{SourceMapConsumer:wN,SourceMapGenerator:TN}=FO,{pathToFileURL:MN}=FO,ON=eN,CN=Boolean(wN&&TN),NN=Boolean(EN&&AN&&SN&&xN);var DN=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||EN(e.file);!1===this.mapOpts.sourcesContent?(t=new wN(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),NN&&CN&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=TN.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new TN({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new TN({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((o,s,u)=>{if(this.css+=o,s&&"end"!==u&&(a.generated.line=n,a.generated.column=r-1,s.source&&s.source.start?(a.source=this.sourcePath(s),a.original.line=s.source.start.line,a.original.column=s.source.start.column-1,this.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,this.map.addMapping(a))),t=o.match(/\n/g),t?(n+=t.length,e=o.lastIndexOf("\n"),r=o.length-e):r+=o.length,s&&"start"!==u){let e=s.parent||{raws:{}};("decl"===s.type||"atrule"===s.type&&!s.nodes)&&s===e.last&&!e.raws.semicolon||(s.source&&s.source.end?(a.source=this.sourcePath(s),a.original.line=s.source.end.line,a.original.column=s.source.end.column-1,a.generated.line=n,a.generated.column=r-2,this.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,a.generated.line=n,a.generated.column=r-1,this.map.addMapping(a)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?EN(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=EN(AN(n,this.mapOpts.annotation)));let r=SN(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new ON(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(MN){let t=MN(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===xN&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};const LN="'".charCodeAt(0),IN='"'.charCodeAt(0),kN="\\".charCodeAt(0),$N="/".charCodeAt(0),RN="\n".charCodeAt(0),FN=" ".charCodeAt(0),zN="\f".charCodeAt(0),PN="\t".charCodeAt(0),jN="\r".charCodeAt(0),ZN="[".charCodeAt(0),UN="]".charCodeAt(0),BN="(".charCodeAt(0),VN=")".charCodeAt(0),HN="{".charCodeAt(0),GN="}".charCodeAt(0),YN=";".charCodeAt(0),WN="*".charCodeAt(0),qN=":".charCodeAt(0),KN="@".charCodeAt(0),JN=/[\t\n\f\r "#'()/;[\\\]{}]/g,XN=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,QN=/.[\r\n"'(/\\]/,eD=/[\da-f]/i;let tD=wC,nD=oC,rD=cC,iD=aN,aD=dN,oD=function(e,t={}){let n,r,i,a,o,s,u,c,l,d,f=e.css.valueOf(),p=t.ignoreErrors,h=f.length,m=0,g=[],y=[];function _(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=h},nextToken:function(e){if(y.length)return y.pop();if(m>=h)return;let t=!!e&&e.ignoreUnclosed;switch(n=f.charCodeAt(m),n){case RN:case FN:case PN:case jN:case zN:a=m;do{a+=1,n=f.charCodeAt(a)}while(n===FN||n===RN||n===PN||n===jN||n===zN);s=["space",f.slice(m,a)],m=a-1;break;case ZN:case UN:case HN:case GN:case qN:case YN:case VN:{let e=String.fromCharCode(n);s=[e,e,m];break}case BN:if(d=g.length?g.pop()[1]:"",l=f.charCodeAt(m+1),"url"===d&&l!==LN&&l!==IN&&l!==FN&&l!==RN&&l!==PN&&l!==zN&&l!==jN){a=m;do{if(u=!1,a=f.indexOf(")",a+1),-1===a){if(p||t){a=m;break}_("bracket")}for(c=a;f.charCodeAt(c-1)===kN;)c-=1,u=!u}while(u);s=["brackets",f.slice(m,a+1),m,a],m=a}else a=f.indexOf(")",m+1),r=f.slice(m,a+1),-1===a||QN.test(r)?s=["(","(",m]:(s=["brackets",r,m,a],m=a);break;case LN:case IN:o=n===LN?"'":'"',a=m;do{if(u=!1,a=f.indexOf(o,a+1),-1===a){if(p||t){a=m+1;break}_("string")}for(c=a;f.charCodeAt(c-1)===kN;)c-=1,u=!u}while(u);s=["string",f.slice(m,a+1),m,a],m=a;break;case KN:JN.lastIndex=m+1,JN.test(f),a=0===JN.lastIndex?f.length-1:JN.lastIndex-2,s=["at-word",f.slice(m,a+1),m,a],m=a;break;case kN:for(a=m,i=!0;f.charCodeAt(a+1)===kN;)a+=1,i=!i;if(n=f.charCodeAt(a+1),i&&n!==$N&&n!==FN&&n!==RN&&n!==PN&&n!==jN&&n!==zN&&(a+=1,eD.test(f.charAt(a)))){for(;eD.test(f.charAt(a+1));)a+=1;f.charCodeAt(a+1)===FN&&(a+=1)}s=["word",f.slice(m,a+1),m,a],m=a;break;default:n===$N&&f.charCodeAt(m+1)===WN?(a=f.indexOf("*/",m+2)+1,0===a&&(p||t?a=f.length:_("comment")),s=["comment",f.slice(m,a+1),m,a],m=a):(XN.lastIndex=m+1,XN.test(f),a=0===XN.lastIndex?f.length-1:XN.lastIndex-2,s=["word",f.slice(m,a+1),m,a],g.push(s),m=a)}return m++,s},position:function(){return m}}};const sD={empty:!0,space:!0};var uD=class{constructor(e){this.input=e,this.root=new iD,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new tD;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let a=!1,o=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(s.length>0){for(r=s.length-1,n=s[r];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}s.push(e)}else s.push(e);if(this.tokenizer.endOfFile()){a=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),a&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),o&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[a,o]of e.entries()){if(n=o,r=n[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(t){if("word"===t[0]&&"progid"===t[1])continue;return a}this.doubleColon(n)}t=n}return!1}comment(e){let t=new nD;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=oD(this.input)}decl(e,t){let n=new rD;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let a,o=[];for(;e.length&&(a=e[0][0],"space"===a||"comment"===a);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),i="";for(let e=t;e>0;e--){let t=r[e][0];if(i.trim().startsWith("!")&&"space"!==t)break;i=r.pop()[1]+i}i.trim().startsWith("!")&&(n.important=!0,n.raws.important=i,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=o.map((e=>e[1])).join(""),o=[]),this.raw(n,"value",o.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new aD;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith("--"),s=[],u=e;for(;u;){if(n=u[0],s.push(u),"("===n||"["===n)i||(i=u),a.push("("===n?")":"]");else if(o&&r&&"{"===n)i||(i=u),a.push("}");else if(0===a.length){if(";"===n){if(r)return void this.decl(s,o);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(r=!0)}else n===a[a.length-1]&&(a.pop(),0===a.length&&(i=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(u=s[s.length-1][0],"space"===u||"comment"===u);)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,o,s,u=n.length,c="",l=!0;for(let e=0;e<u;e+=1)i=n[e],a=i[0],"space"!==a||e!==u-1||r?"comment"===a?(s=n[e-1]?n[e-1][0]:"empty",o=n[e+1]?n[e+1][0]:"empty",sD[s]||sD[o]||","===c.slice(-1)?l=!1:c+=i[1]):c+=i[1]:l=!1;if(!l){let r=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new aD;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let cD=SC,lD=eN,dD=uD;function fD(e,t){let n=new lD(e,t),r=new dD(n);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var pD=fD;fD.default=fD,cD.registerParse(fD);class hD{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}var mD=hD;hD.default=hD;let gD=mD;class yD{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new gD(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}}var _D=yD;yD.default=yD;let vD={};var bD=function(e){vD[e]||(vD[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ED=SC,SD=NC,AD=DN,xD=pD,wD=_D,TD=aN,MD=YO,{isClean:OD,my:CD}=WO,ND=bD;const DD={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},LD={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ID={Once:!0,postcssPlugin:!0,prepare:!0};function kD(e){return"object"==typeof e&&"function"==typeof e.then}function $D(e){let t=!1,n=DD[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function RD(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:$D(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function FD(e){return e[OD]=!1,e.nodes&&e.nodes.forEach((e=>FD(e))),e}let zD={};class PD{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof PD||t instanceof wD)r=FD(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=xD;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(e){this.processed=!0,this.error=e}r&&!r[CD]&&ED.rebuild(r)}else r=FD(t);this.result=new wD(e,r,n),this.helpers={...zD,postcss:zD,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,i=t.split("."),a=r.split(".");(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!LD[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ID[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(kD(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[OD];){e[OD]=!0;let t=[RD(e)];for(;t.length>0;){let e=this.visitTick(t);if(kD(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return kD(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=MD;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new AD(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(kD(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[OD];)e[OD]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||ND("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(kD(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[OD])return r[OD]=!0,void e.push(RD(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[OD]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[OD]=!0;let t=$D(e);for(let n of t)if(0===n)e.nodes&&e.each((e=>{e[OD]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}PD.registerPostcss=e=>{zD=e};var jD=PD;PD.default=PD,TD.registerLazyResult(PD),SD.registerLazyResult(PD);let ZD=DN,UD=pD;const BD=_D;let VD=YO,HD=bD;class GD{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=UD;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=VD;this.result=new BD(this._processor,r,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let o=new ZD(i,r,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||HD("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}var YD=GD;GD.default=GD;let WD=NC,qD=jD,KD=YD,JD=aN;class XD{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new qD(this,e,t):new KD(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}var QD=XD;XD.default=XD,JD.registerProcessor(XD),WD.registerProcessor(XD);let eL=wC,tL=oC,nL=SC,rL=ZO,iL=cC,aL=NC,oL=bN,sL=eN,uL=jD,cL=sN,lL=rC,dL=pD,fL=QD,pL=_D,hL=aN,mL=dN,gL=YO,yL=mD;function _L(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new fL(e)}_L.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new fL).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return _L([i(n)]).process(e,t)},i},_L.stringify=gL,_L.parse=dL,_L.fromJSON=oL,_L.list=cL,_L.comment=e=>new tL(e),_L.atRule=e=>new eL(e),_L.decl=e=>new iL(e),_L.rule=e=>new mL(e),_L.root=e=>new hL(e),_L.document=e=>new aL(e),_L.CssSyntaxError=rL,_L.Declaration=iL,_L.Container=nL,_L.Processor=fL,_L.Document=aL,_L.Comment=tL,_L.Warning=yL,_L.AtRule=eL,_L.Result=pL,_L.Input=sL,_L.Rule=mL,_L.Root=hL,_L.Node=lL,uL.registerPostcss(_L);var vL=_L;_L.default=_L;const bL=vT,EL=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},{isPlainObject:SL}=EO,AL=LO,xL=IO.exports,{parse:wL}=vL,TL=["img","audio","video","picture","svg","object","map","iframe","embed"],ML=["script","style"];function OL(e,t){e&&Object.keys(e).forEach((function(n){t(e[n],n)}))}function CL(e,t){return{}.hasOwnProperty.call(e,t)}function NL(e,t){const n=[];return OL(e,(function(e){t(e)&&n.push(e)})),n}var DL=IL;const LL=/^[^\0\t\n\f\r /<=>]+$/;function IL(e,t,n){if(null==e)return"";"number"==typeof e&&(e=e.toString());let r="",i="";function a(e,t){const n=this;this.tag=e,this.attribs=t||{},this.tagPosition=r.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(g.length){g[g.length-1].text+=n.text}},this.updateParentNodeMediaChildren=function(){if(g.length&&TL.includes(this.tag)){g[g.length-1].mediaChildren.push(this.tag)}}}(t=Object.assign({},IL.defaults,t)).parser=Object.assign({},kL,t.parser);const o=function(e){return!1===t.allowedTags||(t.allowedTags||[]).indexOf(e)>-1};ML.forEach((function(e){o(e)&&!t.allowVulnerableTags&&console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)}));const s=t.nonTextTags||["script","style","textarea","option"];let u,c;t.allowedAttributes&&(u={},c={},OL(t.allowedAttributes,(function(e,t){u[t]=[];const n=[];e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(EL(e).replace(/\\\*/g,".*")):u[t].push(e)})),n.length&&(c[t]=new RegExp("^("+n.join("|")+")$"))})));const l={},d={},f={};OL(t.allowedClasses,(function(e,t){if(u&&(CL(u,t)||(u[t]=[]),u[t].push("class")),l[t]=e,Array.isArray(e)){const n=[];l[t]=[],f[t]=[],e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(EL(e).replace(/\\\*/g,".*")):e instanceof RegExp?f[t].push(e):l[t].push(e)})),n.length&&(d[t]=new RegExp("^("+n.join("|")+")$"))}}));const p={};let h,m,g,y,_,v,b;OL(t.transformTags,(function(e,t){let n;"function"==typeof e?n=e:"string"==typeof e&&(n=IL.simpleTransform(e)),"*"===t?h=n:p[t]=n}));let E=!1;A();const S=new bL.Parser({onopentag:function(e,n){if(t.enforceHtmlBoundary&&"html"===e&&A(),v)return void b++;const S=new a(e,n);g.push(S);let O=!1;const C=!!S.text;let N;if(CL(p,e)&&(N=p[e](e,n),S.attribs=n=N.attribs,void 0!==N.text&&(S.innerText=N.text),e!==N.tagName&&(S.name=e=N.tagName,_[m]=N.tagName)),h&&(N=h(e,n),S.attribs=n=N.attribs,e!==N.tagName&&(S.name=e=N.tagName,_[m]=N.tagName)),(!o(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(const t in e)if(CL(e,t))return!1;return!0}(y)||null!=t.nestingLimit&&m>=t.nestingLimit)&&(O=!0,y[m]=!0,"discard"!==t.disallowedTagsMode&&"completelyDiscard"!==t.disallowedTagsMode||-1!==s.indexOf(e)&&(v=!0,b=1)),m++,O){if("discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode){if(S.innerText&&!C){const n=x(S.innerText);t.textFilter?r+=t.textFilter(n,e):r+=n,E=!0}return}i=r,r=""}r+="<"+e,"script"===e&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(S.innerText=""),(!u||CL(u,e)||u["*"])&&OL(n,(function(n,i){if(!LL.test(i))return void delete S.attribs[i];if(""===n&&!t.allowedEmptyAttributes.includes(i)&&(t.nonBooleanAttributes.includes(i)||t.nonBooleanAttributes.includes("*")))return void delete S.attribs[i];let a=!1;if(!u||CL(u,e)&&-1!==u[e].indexOf(i)||u["*"]&&-1!==u["*"].indexOf(i)||CL(c,e)&&c[e].test(i)||c["*"]&&c["*"].test(i))a=!0;else if(u&&u[e])for(const t of u[e])if(SL(t)&&t.name&&t.name===i){a=!0;let e="";if(!0===t.multiple){const r=n.split(" ");for(const n of r)-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}if(a){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(i)&&w(e,n))return void delete S.attribs[i];if("script"===e&&"src"===i){let e=!0;try{const r=T(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){const n=(t.allowedScriptHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedScriptDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(t){e=!1}if(!e)return void delete S.attribs[i]}if("iframe"===e&&"src"===i){let e=!0;try{const r=T(n);if(r.isRelativeUrl)e=CL(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){const n=(t.allowedIframeHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedIframeDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(t){e=!1}if(!e)return void delete S.attribs[i]}if("srcset"===i)try{let e=xL(n);if(e.forEach((function(e){w("srcset",e.url)&&(e.evil=!0)})),e=NL(e,(function(e){return!e.evil})),!e.length)return void delete S.attribs[i];n=NL(e,(function(e){return!e.evil})).map((function(e){if(!e.url)throw new Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")})).join(", "),S.attribs[i]=n}catch(e){return void delete S.attribs[i]}if("class"===i){const t=l[e],r=l["*"],a=d[e],o=f[e],s=f["*"],u=[a,d["*"]].concat(o,s).filter((function(e){return e}));if(!(n=M(n,t&&r?AL(t,r):t||r,u)).length)return void delete S.attribs[i]}if("style"===i)if(t.parseStyleAttributes)try{const r=function(e,t){if(!t)return e;const n=e.nodes[0];let r;r=t[n.selector]&&t["*"]?AL(t[n.selector],t["*"]):t[n.selector]||t["*"];r&&(e.nodes[0].nodes=n.nodes.reduce(function(e){return function(t,n){if(CL(e,n.prop)){e[n.prop].some((function(e){return e.test(n.value)}))&&t.push(n)}return t}}(r),[]));return e}(wL(e+" {"+n+"}",{map:!1}),t.allowedStyles);if(n=function(e){return e.nodes[0].nodes.reduce((function(e,t){return e.push(`${t.prop}:${t.value}${t.important?" !important":""}`),e}),[]).join(";")}(r),0===n.length)return void delete S.attribs[i]}catch(t){return"undefined"!=typeof window&&console.warn('Failed to parse "'+e+" {"+n+"}\", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547"),void delete S.attribs[i]}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.");r+=" "+i,n&&n.length?r+='="'+x(n,!0)+'"':t.allowedEmptyAttributes.includes(i)&&(r+='=""')}else delete S.attribs[i]})),-1!==t.selfClosing.indexOf(e)?r+=" />":(r+=">",!S.innerText||C||t.textFilter||(r+=x(S.innerText),E=!0)),O&&(r=i+x(r),i=""),S.openingTagLength=r.length-S.tagPosition},ontext:function(e){if(v)return;const n=g[g.length-1];let i;if(n&&(i=n.tag,e=void 0!==n.innerText?n.innerText:e),"completelyDiscard"!==t.disallowedTagsMode||o(i))if("discard"!==t.disallowedTagsMode&&"completelyDiscard"!==t.disallowedTagsMode||"script"!==i&&"style"!==i){if(!E){const n=x(e,!1);t.textFilter?r+=t.textFilter(n,i):r+=n}}else r+=e;else e="";if(g.length){g[g.length-1].text+=e}},onclosetag:function(e,n){if(v){if(b--,b)return;v=!1}const a=g.pop();if(!a)return;if(a.tag!==e)return void g.push(a);v=!!t.enforceHtmlBoundary&&"html"===e,m--;const s=y[m];if(s){if(delete y[m],"discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode)return void a.updateParentNodeText();i=r,r=""}if(_[m]&&(e=_[m],delete _[m]),t.exclusiveFilter){const e=t.exclusiveFilter(a);if("excludeTag"===e)return s&&(r=i,i=""),void(r=r.substring(0,a.tagPosition)+r.substring(a.tagPosition+a.openingTagLength));if(e)return void(r=r.substring(0,a.tagPosition))}a.updateParentNodeMediaChildren(),a.updateParentNodeText(),-1!==t.selfClosing.indexOf(e)||n&&!o(e)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0?s&&(r=i,i=""):(r+="</"+e+">",s&&(r=i+x(r),i=""),E=!1)}},t.parser);return S.write(e),S.end(),r;function A(){r="",m=0,g=[],y={},_={},v=!1,b=0}function x(e,n){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,""")),e}function w(e,n){for(n=n.replace(/[\x00-\x20]+/g,"");;){const e=n.indexOf("\x3c!--");if(-1===e)break;const t=n.indexOf("--\x3e",e+4);if(-1===t)break;n=n.substring(0,e)+n.substring(t+3)}const r=n.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!r)return!!n.match(/^[/\\]{2}/)&&!t.allowProtocolRelative;const i=r[1].toLowerCase();return CL(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(i):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(i)}function T(e){if((e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw new Error("relative: exploit attempt");let t="relative://relative-site";for(let e=0;e<100;e++)t+=`/${e}`;const n=new URL(e,t);return{isRelativeUrl:n&&"relative-site"===n.hostname&&"relative:"===n.protocol,url:n}}function M(e,t,n){return t?(e=e.split(/\s+/)).filter((function(e){return-1!==t.indexOf(e)||n.some((function(t){return t.test(e)}))})).join(" "):e}}const kL={decodeEntities:!0};IL.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0},IL.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(r,i){let a;if(n)for(a in t)i[a]=t[a];else i=t;return{tagName:e,attribs:i}}};var $L=DL;const RL=t=>{const{baseTextColor:n,baseTextSize:r,children:i,className:a,id:o,inline:c,sanitizeOptions:l}=t,d=()=>o?exports.TestHelper.generateId(o,"sanitized"):exports.TestHelper.generateId("sanitized");return e.jsx(s.Markup,{baseTextColor:n,baseTextSize:r,inline:c,id:d(),className:a,"data-testid":d(),dangerouslySetInnerHTML:{__html:$L("string"!=typeof i?u.renderToStaticMarkup(i):i,l)}})};var FL={exports:{}};
|
|
279
|
+
function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(EO,"__esModule",{value:!0}),EO.isPlainObject=function(e){var t,n;return!1!==SO(e)&&(void 0===(t=e.constructor)||!1!==SO(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};var AO=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===xO}(e)}(e)};var xO="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function wO(e,t){return!1!==t.clone&&t.isMergeableObject(e)?NO((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function TO(e,t,n){return e.concat(t).map((function(e){return wO(e,n)}))}function MO(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function OO(e,t){try{return t in e}catch(e){return!1}}function CO(e,t,n){var r={};return n.isMergeableObject(e)&&MO(e).forEach((function(t){r[t]=wO(e[t],n)})),MO(t).forEach((function(i){(function(e,t){return OO(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(OO(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return NO;var n=t.customMerge(e);return"function"==typeof n?n:NO}(i,n)(e[i],t[i],n):r[i]=wO(t[i],n))})),r}function NO(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||TO,n.isMergeableObject=n.isMergeableObject||AO,n.cloneUnlessOtherwiseSpecified=wO;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):CO(e,t,n):wO(t,n)}NO.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return NO(e,n,t)}),{})};var DO,LO=NO,IO={exports:{}};DO=IO,function(e,t){DO.exports?DO.exports=t():e.parseSrcset=t()}(St,(function(){return function(e){function t(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function n(t){var n,r=t.exec(e.substring(m));if(r)return n=r[0],m+=n.length,n}for(var r,i,a,o,s,u=e.length,c=/^[ \t\n\r\u000c]+/,l=/^[, \t\n\r\u000c]+/,d=/^[^ \t\n\r\u000c]+/,f=/[,]+$/,p=/^\d+$/,h=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,m=0,g=[];;){if(n(l),m>=u)return g;r=n(d),i=[],","===r.slice(-1)?(r=r.replace(f,""),_()):y()}function y(){for(n(c),a="",o="in descriptor";;){if(s=e.charAt(m),"in descriptor"===o)if(t(s))a&&(i.push(a),a="",o="after descriptor");else{if(","===s)return m+=1,a&&i.push(a),void _();if("("===s)a+=s,o="in parens";else{if(""===s)return a&&i.push(a),void _();a+=s}}else if("in parens"===o)if(")"===s)a+=s,o="in descriptor";else{if(""===s)return i.push(a),void _();a+=s}else if("after descriptor"===o)if(t(s));else{if(""===s)return void _();o="in descriptor",m-=1}m+=1}}function _(){var t,n,a,o,s,u,c,l,d,f=!1,m={};for(o=0;o<i.length;o++)u=(s=i[o])[s.length-1],c=s.substring(0,s.length-1),l=parseInt(c,10),d=parseFloat(c),p.test(c)&&"w"===u?((t||n)&&(f=!0),0===l?f=!0:t=l):h.test(c)&&"x"===u?((t||n||a)&&(f=!0),d<0?f=!0:n=d):p.test(c)&&"h"===u?((a||n)&&(f=!0),0===l?f=!0:a=l):f=!0;f?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+s+"'."):(m.url=r,t&&(m.w=t),n&&(m.d=n),a&&(m.h=a),g.push(m))}}}));var kO={exports:{}},$O=String,RO=function(){return{isColorSupported:!1,reset:$O,bold:$O,dim:$O,italic:$O,underline:$O,inverse:$O,hidden:$O,strikethrough:$O,black:$O,red:$O,green:$O,yellow:$O,blue:$O,magenta:$O,cyan:$O,white:$O,gray:$O,bgBlack:$O,bgRed:$O,bgGreen:$O,bgYellow:$O,bgBlue:$O,bgMagenta:$O,bgCyan:$O,bgWhite:$O,blackBright:$O,redBright:$O,greenBright:$O,yellowBright:$O,blueBright:$O,magentaBright:$O,cyanBright:$O,whiteBright:$O,bgBlackBright:$O,bgRedBright:$O,bgGreenBright:$O,bgYellowBright:$O,bgBlueBright:$O,bgMagentaBright:$O,bgCyanBright:$O,bgWhiteBright:$O}};kO.exports=RO(),kO.exports.createColors=RO;var FO=At(Object.freeze({__proto__:null,default:{}}));let zO=kO.exports,PO=FO;class jO extends Error{constructor(e,t,n,r,i,a){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),r&&(this.source=r),a&&(this.plugin=a),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,jO)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=zO.isColorSupported);let n=e=>e,r=e=>e,i=e=>e;if(e){let{bold:e,gray:t,red:a}=zO.createColors(!0);r=t=>e(a(t)),n=e=>t(e),PO&&(i=e=>PO(e))}let a=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(o,s).map(((e,t)=>{let a=o+1+t,s=" "+(" "+a).slice(-u)+" | ";if(a===this.line){if(e.length>160){let t=20,a=Math.max(0,this.column-t),o=Math.max(this.column+t,this.endColumn+t),u=e.slice(a,o),c=n(s.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return r(">")+n(s)+i(u)+"\n "+c+r("^")}let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+i(e)+"\n "+t+r("^")}return" "+n(s)+i(e)})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}var ZO=jO;jO.default=jO;const UO={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class BO{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,"before");a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return UO[n];let a=e.root();if(a.rawCache||(a.rawCache={}),void 0!==a.rawCache[n])return a.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((o=n)[0].toUpperCase()+o.slice(1));this[i]?r=this[i](a,e):a.walk((e=>{if(r=e.raws[t],void 0!==r)return!1}))}var o;return void 0===r&&(r=UO[n]),a.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var VO=BO;BO.default=BO;let HO=VO;function GO(e,t){new HO(t).stringify(e)}var YO=GO;GO.default=GO;var WO={};WO.isClean=Symbol("isClean"),WO.my=Symbol("my");let qO=ZO,KO=VO,JO=YO,{isClean:XO,my:QO}=WO;function eC(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],a=typeof i;"parent"===r&&"object"===a?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map((e=>eC(e,n))):("object"===a&&null!==i&&(i=eC(i)),n[r]=i)}return n}function tC(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,r=1,i=0;for(let a=0;a<e.length;a++){if(r===t.line&&n===t.column){i=a;break}"\n"===e[a]?(n=1,r+=1):n+=1}return i}class nC{get proxyOf(){return this}constructor(e={}){this.raws={},this[XO]=!1,this[QO]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=eC(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new qO(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[XO]=!0}markDirty(){if(this[XO]){this[XO]=!1;let e=this;for(;e=e.parent;)e[XO]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r=n.slice(tC(n,this.source.start),tC(n,this.source.end)).indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=tC(r,this.source.start),a=i+e;for(let e=i;e<a;e++)"\n"===r[e]?(t=1,n+=1):t+=1;return{column:t,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,i=r.slice(tC(r,this.source.start),tC(r,this.source.end)).indexOf(e.word);-1!==i&&(t=this.positionInside(i),n=this.positionInside(i+e.word.length))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new KO).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let a=t.get(r.input);null==a&&(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=JO){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}}var rC=nC;nC.default=nC;let iC=rC;class aC extends iC{constructor(e){super(e),this.type="comment"}}var oC=aC;aC.default=aC;let sC=rC;class uC extends sC{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}var cC=uC;uC.default=uC;let lC,dC,fC,pC,hC=oC,mC=cC,gC=rC,{isClean:yC,my:_C}=WO;function vC(e){return e.map((e=>(e.nodes&&(e.nodes=vC(e.nodes)),delete e.source,e)))}function bC(e){if(e[yC]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)bC(t)}class EC extends gC{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",a=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of a)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+a.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=vC(dC(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new mC(e)]}else if(e.selector||e.selectors)e=[new pC(e)];else if(e.name)e=[new lC(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new hC(e)]}return e.map((e=>(e[_C]||EC.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[yC]&&bC(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)})):this.walk(((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)})):this.walk(((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)})):this.walk(((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}}EC.registerParse=e=>{dC=e},EC.registerRule=e=>{pC=e},EC.registerAtRule=e=>{lC=e},EC.registerRoot=e=>{fC=e};var SC=EC;EC.default=EC,EC.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,lC.prototype):"rule"===e.type?Object.setPrototypeOf(e,pC.prototype):"decl"===e.type?Object.setPrototypeOf(e,mC.prototype):"comment"===e.type?Object.setPrototypeOf(e,hC.prototype):"root"===e.type&&Object.setPrototypeOf(e,fC.prototype),e[_C]=!0,e.nodes&&e.nodes.forEach((e=>{EC.rebuild(e)}))};let AC=SC;class xC extends AC{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}var wC=xC;xC.default=xC,AC.registerAtRule(xC);let TC,MC,OC=SC;class CC extends OC{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new TC(new MC,this,e).stringify()}}CC.registerLazyResult=e=>{TC=e},CC.registerProcessor=e=>{MC=e};var NC=CC;CC.default=CC;var DC={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=0|n;for(;i--;)r+=e[Math.random()*e.length|0];return r}};let{existsSync:LC,readFileSync:IC}=FO,{dirname:kC,join:$C}=FO,{SourceMapConsumer:RC,SourceMapGenerator:FC}=FO;class zC{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=kC(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new RC(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return r=e.substr(n[0].length),Buffer?Buffer.from(r,"base64").toString():window.atob(r);var r;let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=kC(e),LC(e))return this.mapFile=e,IC(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof RC)return FC.fromSourceMap(t).toString();if(t instanceof FC)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$C(kC(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}var PC=zC;zC.default=zC;let{nanoid:jC}=DC,{isAbsolute:ZC,resolve:UC}=FO,{SourceMapConsumer:BC,SourceMapGenerator:VC}=FO,{fileURLToPath:HC,pathToFileURL:GC}=FO,YC=ZO,WC=PC,qC=FO,KC=Symbol("fromOffsetCache"),JC=Boolean(BC&&VC),XC=Boolean(UC&&ZC);class QC{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!XC||/^\w+:\/\//.test(t.from)||ZC(t.from)?this.file=t.from:this.file=UC(t.from)),XC&&JC){let e=new WC(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+jC(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,a,o;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);a=e.line,i=e.col}else a=r.line,i=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let s=this.origin(t,n,a,i);return o=s?new YC(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,r.plugin):new YC(e,void 0===a?t:{column:n,line:t},void 0===a?n:{column:i,line:a},this.css,this.file,r.plugin),o.input={column:n,endColumn:i,endLine:a,line:t,source:this.css},this.file&&(GC&&(o.input.url=GC(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[KC])n=this[KC];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[KC]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:UC(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,a,o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n})),a=ZC(s.source)?GC(s.source):new URL(s.source,this.map.consumer().sourceRoot||GC(this.map.mapFile));let u={column:s.column,endColumn:i&&i.column,endLine:i&&i.line,line:s.line,url:a.toString()};if("file:"===a.protocol){if(!HC)throw new Error("file: protocol is not available in this PostCSS build");u.file=HC(a)}let c=o.sourceContentFor(s.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}var eN=QC;QC.default=QC,qC&&qC.registerInput&&qC.registerInput(QC);let tN,nN,rN=SC;class iN extends rN{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new tN(new nN,this,e).stringify()}}iN.registerLazyResult=e=>{tN=e},iN.registerProcessor=e=>{nN=e};var aN=iN;iN.default=iN,rN.registerRoot(iN);let oN={comma:e=>oN.split(e,[","],!0),space:e=>oN.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",a=!1,o=0,s=!1,u="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:s?n===u&&(s=!1):'"'===n||"'"===n?(s=!0,u=n):"("===n?o+=1:")"===n?o>0&&(o-=1):0===o&&t.includes(n)&&(a=!0),a?(""!==i&&r.push(i.trim()),i="",a=!1):i+=n;return(n||""!==i)&&r.push(i.trim()),r}};var sN=oN;oN.default=oN;let uN=SC,cN=sN;class lN extends uN{get selectors(){return cN.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}var dN=lN;lN.default=lN,uN.registerRule(lN);let fN=wC,pN=oC,hN=cC,mN=eN,gN=PC,yN=aN,_N=dN;function vN(e,t){if(Array.isArray(e))return e.map((e=>vN(e)));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:mN.prototype};n.map&&(n.map={...n.map,__proto__:gN.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map((e=>vN(e,t)))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new yN(r);if("decl"===r.type)return new hN(r);if("rule"===r.type)return new _N(r);if("comment"===r.type)return new pN(r);if("atrule"===r.type)return new fN(r);throw new Error("Unknown node type: "+e.type)}var bN=vN;vN.default=vN;let{dirname:EN,relative:SN,resolve:AN,sep:xN}=FO,{SourceMapConsumer:wN,SourceMapGenerator:TN}=FO,{pathToFileURL:MN}=FO,ON=eN,CN=Boolean(wN&&TN),NN=Boolean(EN&&AN&&SN&&xN);var DN=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||EN(e.file);!1===this.mapOpts.sourcesContent?(t=new wN(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),NN&&CN&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=TN.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new TN({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new TN({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((o,s,u)=>{if(this.css+=o,s&&"end"!==u&&(a.generated.line=n,a.generated.column=r-1,s.source&&s.source.start?(a.source=this.sourcePath(s),a.original.line=s.source.start.line,a.original.column=s.source.start.column-1,this.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,this.map.addMapping(a))),t=o.match(/\n/g),t?(n+=t.length,e=o.lastIndexOf("\n"),r=o.length-e):r+=o.length,s&&"start"!==u){let e=s.parent||{raws:{}};("decl"===s.type||"atrule"===s.type&&!s.nodes)&&s===e.last&&!e.raws.semicolon||(s.source&&s.source.end?(a.source=this.sourcePath(s),a.original.line=s.source.end.line,a.original.column=s.source.end.column-1,a.generated.line=n,a.generated.column=r-2,this.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,a.generated.line=n,a.generated.column=r-1,this.map.addMapping(a)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?EN(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=EN(AN(n,this.mapOpts.annotation)));let r=SN(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new ON(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(MN){let t=MN(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===xN&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};const LN="'".charCodeAt(0),IN='"'.charCodeAt(0),kN="\\".charCodeAt(0),$N="/".charCodeAt(0),RN="\n".charCodeAt(0),FN=" ".charCodeAt(0),zN="\f".charCodeAt(0),PN="\t".charCodeAt(0),jN="\r".charCodeAt(0),ZN="[".charCodeAt(0),UN="]".charCodeAt(0),BN="(".charCodeAt(0),VN=")".charCodeAt(0),HN="{".charCodeAt(0),GN="}".charCodeAt(0),YN=";".charCodeAt(0),WN="*".charCodeAt(0),qN=":".charCodeAt(0),KN="@".charCodeAt(0),JN=/[\t\n\f\r "#'()/;[\\\]{}]/g,XN=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,QN=/.[\r\n"'(/\\]/,eD=/[\da-f]/i;let tD=wC,nD=oC,rD=cC,iD=aN,aD=dN,oD=function(e,t={}){let n,r,i,a,o,s,u,c,l,d,f=e.css.valueOf(),p=t.ignoreErrors,h=f.length,m=0,g=[],y=[];function _(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=h},nextToken:function(e){if(y.length)return y.pop();if(m>=h)return;let t=!!e&&e.ignoreUnclosed;switch(n=f.charCodeAt(m),n){case RN:case FN:case PN:case jN:case zN:a=m;do{a+=1,n=f.charCodeAt(a)}while(n===FN||n===RN||n===PN||n===jN||n===zN);s=["space",f.slice(m,a)],m=a-1;break;case ZN:case UN:case HN:case GN:case qN:case YN:case VN:{let e=String.fromCharCode(n);s=[e,e,m];break}case BN:if(d=g.length?g.pop()[1]:"",l=f.charCodeAt(m+1),"url"===d&&l!==LN&&l!==IN&&l!==FN&&l!==RN&&l!==PN&&l!==zN&&l!==jN){a=m;do{if(u=!1,a=f.indexOf(")",a+1),-1===a){if(p||t){a=m;break}_("bracket")}for(c=a;f.charCodeAt(c-1)===kN;)c-=1,u=!u}while(u);s=["brackets",f.slice(m,a+1),m,a],m=a}else a=f.indexOf(")",m+1),r=f.slice(m,a+1),-1===a||QN.test(r)?s=["(","(",m]:(s=["brackets",r,m,a],m=a);break;case LN:case IN:o=n===LN?"'":'"',a=m;do{if(u=!1,a=f.indexOf(o,a+1),-1===a){if(p||t){a=m+1;break}_("string")}for(c=a;f.charCodeAt(c-1)===kN;)c-=1,u=!u}while(u);s=["string",f.slice(m,a+1),m,a],m=a;break;case KN:JN.lastIndex=m+1,JN.test(f),a=0===JN.lastIndex?f.length-1:JN.lastIndex-2,s=["at-word",f.slice(m,a+1),m,a],m=a;break;case kN:for(a=m,i=!0;f.charCodeAt(a+1)===kN;)a+=1,i=!i;if(n=f.charCodeAt(a+1),i&&n!==$N&&n!==FN&&n!==RN&&n!==PN&&n!==jN&&n!==zN&&(a+=1,eD.test(f.charAt(a)))){for(;eD.test(f.charAt(a+1));)a+=1;f.charCodeAt(a+1)===FN&&(a+=1)}s=["word",f.slice(m,a+1),m,a],m=a;break;default:n===$N&&f.charCodeAt(m+1)===WN?(a=f.indexOf("*/",m+2)+1,0===a&&(p||t?a=f.length:_("comment")),s=["comment",f.slice(m,a+1),m,a],m=a):(XN.lastIndex=m+1,XN.test(f),a=0===XN.lastIndex?f.length-1:XN.lastIndex-2,s=["word",f.slice(m,a+1),m,a],g.push(s),m=a)}return m++,s},position:function(){return m}}};const sD={empty:!0,space:!0};var uD=class{constructor(e){this.input=e,this.root=new iD,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new tD;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let a=!1,o=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(s.length>0){for(r=s.length-1,n=s[r];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}s.push(e)}else s.push(e);if(this.tokenizer.endOfFile()){a=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),a&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),o&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[a,o]of e.entries()){if(n=o,r=n[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(t){if("word"===t[0]&&"progid"===t[1])continue;return a}this.doubleColon(n)}t=n}return!1}comment(e){let t=new nD;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=oD(this.input)}decl(e,t){let n=new rD;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let a,o=[];for(;e.length&&(a=e[0][0],"space"===a||"comment"===a);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),i="";for(let e=t;e>0;e--){let t=r[e][0];if(i.trim().startsWith("!")&&"space"!==t)break;i=r.pop()[1]+i}i.trim().startsWith("!")&&(n.important=!0,n.raws.important=i,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=o.map((e=>e[1])).join(""),o=[]),this.raw(n,"value",o.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new aD;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith("--"),s=[],u=e;for(;u;){if(n=u[0],s.push(u),"("===n||"["===n)i||(i=u),a.push("("===n?")":"]");else if(o&&r&&"{"===n)i||(i=u),a.push("}");else if(0===a.length){if(";"===n){if(r)return void this.decl(s,o);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(r=!0)}else n===a[a.length-1]&&(a.pop(),0===a.length&&(i=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(u=s[s.length-1][0],"space"===u||"comment"===u);)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,o,s,u=n.length,c="",l=!0;for(let e=0;e<u;e+=1)i=n[e],a=i[0],"space"!==a||e!==u-1||r?"comment"===a?(s=n[e-1]?n[e-1][0]:"empty",o=n[e+1]?n[e+1][0]:"empty",sD[s]||sD[o]||","===c.slice(-1)?l=!1:c+=i[1]):c+=i[1]:l=!1;if(!l){let r=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new aD;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let cD=SC,lD=eN,dD=uD;function fD(e,t){let n=new lD(e,t),r=new dD(n);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var pD=fD;fD.default=fD,cD.registerParse(fD);class hD{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}var mD=hD;hD.default=hD;let gD=mD;class yD{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new gD(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}}var _D=yD;yD.default=yD;let vD={};var bD=function(e){vD[e]||(vD[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ED=SC,SD=NC,AD=DN,xD=pD,wD=_D,TD=aN,MD=YO,{isClean:OD,my:CD}=WO,ND=bD;const DD={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},LD={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ID={Once:!0,postcssPlugin:!0,prepare:!0};function kD(e){return"object"==typeof e&&"function"==typeof e.then}function $D(e){let t=!1,n=DD[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function RD(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:$D(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function FD(e){return e[OD]=!1,e.nodes&&e.nodes.forEach((e=>FD(e))),e}let zD={};class PD{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof PD||t instanceof wD)r=FD(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=xD;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(e){this.processed=!0,this.error=e}r&&!r[CD]&&ED.rebuild(r)}else r=FD(t);this.result=new wD(e,r,n),this.helpers={...zD,postcss:zD,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,i=t.split("."),a=r.split(".");(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!LD[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ID[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(kD(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[OD];){e[OD]=!0;let t=[RD(e)];for(;t.length>0;){let e=this.visitTick(t);if(kD(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return kD(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=MD;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new AD(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(kD(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[OD];)e[OD]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||ND("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(kD(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[OD])return r[OD]=!0,void e.push(RD(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[OD]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[OD]=!0;let t=$D(e);for(let n of t)if(0===n)e.nodes&&e.each((e=>{e[OD]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}PD.registerPostcss=e=>{zD=e};var jD=PD;PD.default=PD,TD.registerLazyResult(PD),SD.registerLazyResult(PD);let ZD=DN,UD=pD;const BD=_D;let VD=YO,HD=bD;class GD{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=UD;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=VD;this.result=new BD(this._processor,r,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let o=new ZD(i,r,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||HD("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}var YD=GD;GD.default=GD;let WD=NC,qD=jD,KD=YD,JD=aN;class XD{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new qD(this,e,t):new KD(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}var QD=XD;XD.default=XD,JD.registerProcessor(XD),WD.registerProcessor(XD);let eL=wC,tL=oC,nL=SC,rL=ZO,iL=cC,aL=NC,oL=bN,sL=eN,uL=jD,cL=sN,lL=rC,dL=pD,fL=QD,pL=_D,hL=aN,mL=dN,gL=YO,yL=mD;function _L(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new fL(e)}_L.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new fL).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return _L([i(n)]).process(e,t)},i},_L.stringify=gL,_L.parse=dL,_L.fromJSON=oL,_L.list=cL,_L.comment=e=>new tL(e),_L.atRule=e=>new eL(e),_L.decl=e=>new iL(e),_L.rule=e=>new mL(e),_L.root=e=>new hL(e),_L.document=e=>new aL(e),_L.CssSyntaxError=rL,_L.Declaration=iL,_L.Container=nL,_L.Processor=fL,_L.Document=aL,_L.Comment=tL,_L.Warning=yL,_L.AtRule=eL,_L.Result=pL,_L.Input=sL,_L.Rule=mL,_L.Root=hL,_L.Node=lL,uL.registerPostcss(_L);var vL=_L;_L.default=_L;const bL=vT,EL=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},{isPlainObject:SL}=EO,AL=LO,xL=IO.exports,{parse:wL}=vL,TL=["img","audio","video","picture","svg","object","map","iframe","embed"],ML=["script","style"];function OL(e,t){e&&Object.keys(e).forEach((function(n){t(e[n],n)}))}function CL(e,t){return{}.hasOwnProperty.call(e,t)}function NL(e,t){const n=[];return OL(e,(function(e){t(e)&&n.push(e)})),n}var DL=IL;const LL=/^[^\0\t\n\f\r /<=>]+$/;function IL(e,t,n){if(null==e)return"";"number"==typeof e&&(e=e.toString());let r="",i="";function a(e,t){const n=this;this.tag=e,this.attribs=t||{},this.tagPosition=r.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(g.length){g[g.length-1].text+=n.text}},this.updateParentNodeMediaChildren=function(){if(g.length&&TL.includes(this.tag)){g[g.length-1].mediaChildren.push(this.tag)}}}(t=Object.assign({},IL.defaults,t)).parser=Object.assign({},kL,t.parser);const o=function(e){return!1===t.allowedTags||(t.allowedTags||[]).indexOf(e)>-1};ML.forEach((function(e){o(e)&&!t.allowVulnerableTags&&console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)}));const s=t.nonTextTags||["script","style","textarea","option"];let u,c;t.allowedAttributes&&(u={},c={},OL(t.allowedAttributes,(function(e,t){u[t]=[];const n=[];e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(EL(e).replace(/\\\*/g,".*")):u[t].push(e)})),n.length&&(c[t]=new RegExp("^("+n.join("|")+")$"))})));const l={},d={},f={};OL(t.allowedClasses,(function(e,t){if(u&&(CL(u,t)||(u[t]=[]),u[t].push("class")),l[t]=e,Array.isArray(e)){const n=[];l[t]=[],f[t]=[],e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(EL(e).replace(/\\\*/g,".*")):e instanceof RegExp?f[t].push(e):l[t].push(e)})),n.length&&(d[t]=new RegExp("^("+n.join("|")+")$"))}}));const p={};let h,m,g,y,_,v,b;OL(t.transformTags,(function(e,t){let n;"function"==typeof e?n=e:"string"==typeof e&&(n=IL.simpleTransform(e)),"*"===t?h=n:p[t]=n}));let E=!1;A();const S=new bL.Parser({onopentag:function(e,n){if(t.enforceHtmlBoundary&&"html"===e&&A(),v)return void b++;const S=new a(e,n);g.push(S);let O=!1;const C=!!S.text;let N;if(CL(p,e)&&(N=p[e](e,n),S.attribs=n=N.attribs,void 0!==N.text&&(S.innerText=N.text),e!==N.tagName&&(S.name=e=N.tagName,_[m]=N.tagName)),h&&(N=h(e,n),S.attribs=n=N.attribs,e!==N.tagName&&(S.name=e=N.tagName,_[m]=N.tagName)),(!o(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(const t in e)if(CL(e,t))return!1;return!0}(y)||null!=t.nestingLimit&&m>=t.nestingLimit)&&(O=!0,y[m]=!0,"discard"!==t.disallowedTagsMode&&"completelyDiscard"!==t.disallowedTagsMode||-1!==s.indexOf(e)&&(v=!0,b=1)),m++,O){if("discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode){if(S.innerText&&!C){const n=x(S.innerText);t.textFilter?r+=t.textFilter(n,e):r+=n,E=!0}return}i=r,r=""}r+="<"+e,"script"===e&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(S.innerText=""),(!u||CL(u,e)||u["*"])&&OL(n,(function(n,i){if(!LL.test(i))return void delete S.attribs[i];if(""===n&&!t.allowedEmptyAttributes.includes(i)&&(t.nonBooleanAttributes.includes(i)||t.nonBooleanAttributes.includes("*")))return void delete S.attribs[i];let a=!1;if(!u||CL(u,e)&&-1!==u[e].indexOf(i)||u["*"]&&-1!==u["*"].indexOf(i)||CL(c,e)&&c[e].test(i)||c["*"]&&c["*"].test(i))a=!0;else if(u&&u[e])for(const t of u[e])if(SL(t)&&t.name&&t.name===i){a=!0;let e="";if(!0===t.multiple){const r=n.split(" ");for(const n of r)-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}if(a){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(i)&&w(e,n))return void delete S.attribs[i];if("script"===e&&"src"===i){let e=!0;try{const r=T(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){const n=(t.allowedScriptHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedScriptDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(t){e=!1}if(!e)return void delete S.attribs[i]}if("iframe"===e&&"src"===i){let e=!0;try{const r=T(n);if(r.isRelativeUrl)e=CL(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){const n=(t.allowedIframeHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedIframeDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(t){e=!1}if(!e)return void delete S.attribs[i]}if("srcset"===i)try{let e=xL(n);if(e.forEach((function(e){w("srcset",e.url)&&(e.evil=!0)})),e=NL(e,(function(e){return!e.evil})),!e.length)return void delete S.attribs[i];n=NL(e,(function(e){return!e.evil})).map((function(e){if(!e.url)throw new Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")})).join(", "),S.attribs[i]=n}catch(e){return void delete S.attribs[i]}if("class"===i){const t=l[e],r=l["*"],a=d[e],o=f[e],s=f["*"],u=[a,d["*"]].concat(o,s).filter((function(e){return e}));if(!(n=M(n,t&&r?AL(t,r):t||r,u)).length)return void delete S.attribs[i]}if("style"===i)if(t.parseStyleAttributes)try{const r=function(e,t){if(!t)return e;const n=e.nodes[0];let r;r=t[n.selector]&&t["*"]?AL(t[n.selector],t["*"]):t[n.selector]||t["*"];r&&(e.nodes[0].nodes=n.nodes.reduce(function(e){return function(t,n){if(CL(e,n.prop)){e[n.prop].some((function(e){return e.test(n.value)}))&&t.push(n)}return t}}(r),[]));return e}(wL(e+" {"+n+"}",{map:!1}),t.allowedStyles);if(n=function(e){return e.nodes[0].nodes.reduce((function(e,t){return e.push(`${t.prop}:${t.value}${t.important?" !important":""}`),e}),[]).join(";")}(r),0===n.length)return void delete S.attribs[i]}catch(t){return"undefined"!=typeof window&&console.warn('Failed to parse "'+e+" {"+n+"}\", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547"),void delete S.attribs[i]}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.");r+=" "+i,n&&n.length?r+='="'+x(n,!0)+'"':t.allowedEmptyAttributes.includes(i)&&(r+='=""')}else delete S.attribs[i]})),-1!==t.selfClosing.indexOf(e)?r+=" />":(r+=">",!S.innerText||C||t.textFilter||(r+=x(S.innerText),E=!0)),O&&(r=i+x(r),i=""),S.openingTagLength=r.length-S.tagPosition},ontext:function(e){if(v)return;const n=g[g.length-1];let i;if(n&&(i=n.tag,e=void 0!==n.innerText?n.innerText:e),"completelyDiscard"!==t.disallowedTagsMode||o(i))if("discard"!==t.disallowedTagsMode&&"completelyDiscard"!==t.disallowedTagsMode||"script"!==i&&"style"!==i){if(!E){const n=x(e,!1);t.textFilter?r+=t.textFilter(n,i):r+=n}}else r+=e;else e="";if(g.length){g[g.length-1].text+=e}},onclosetag:function(e,n){if(v){if(b--,b)return;v=!1}const a=g.pop();if(!a)return;if(a.tag!==e)return void g.push(a);v=!!t.enforceHtmlBoundary&&"html"===e,m--;const s=y[m];if(s){if(delete y[m],"discard"===t.disallowedTagsMode||"completelyDiscard"===t.disallowedTagsMode)return void a.updateParentNodeText();i=r,r=""}if(_[m]&&(e=_[m],delete _[m]),t.exclusiveFilter){const e=t.exclusiveFilter(a);if("excludeTag"===e)return s&&(r=i,i=""),void(r=r.substring(0,a.tagPosition)+r.substring(a.tagPosition+a.openingTagLength));if(e)return void(r=r.substring(0,a.tagPosition))}a.updateParentNodeMediaChildren(),a.updateParentNodeText(),-1!==t.selfClosing.indexOf(e)||n&&!o(e)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0?s&&(r=i,i=""):(r+="</"+e+">",s&&(r=i+x(r),i=""),E=!1)}},t.parser);return S.write(e),S.end(),r;function A(){r="",m=0,g=[],y={},_={},v=!1,b=0}function x(e,n){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,""")),e}function w(e,n){for(n=n.replace(/[\x00-\x20]+/g,"");;){const e=n.indexOf("\x3c!--");if(-1===e)break;const t=n.indexOf("--\x3e",e+4);if(-1===t)break;n=n.substring(0,e)+n.substring(t+3)}const r=n.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!r)return!!n.match(/^[/\\]{2}/)&&!t.allowProtocolRelative;const i=r[1].toLowerCase();return CL(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(i):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(i)}function T(e){if((e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw new Error("relative: exploit attempt");let t="relative://relative-site";for(let e=0;e<100;e++)t+=`/${e}`;const n=new URL(e,t);return{isRelativeUrl:n&&"relative-site"===n.hostname&&"relative:"===n.protocol,url:n}}function M(e,t,n){return t?(e=e.split(/\s+/)).filter((function(e){return-1!==t.indexOf(e)||n.some((function(t){return t.test(e)}))})).join(" "):e}}const kL={decodeEntities:!0};IL.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0},IL.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(r,i){let a;if(n)for(a in t)i[a]=t[a];else i=t;return{tagName:e,attribs:i}}};var $L=DL;const RL=t=>{const{baseTextColor:n,baseTextSize:r,children:i,className:a,id:o,inline:c,sanitizeOptions:l}=t;return e.jsx(s.Markup,{baseTextColor:n,baseTextSize:r,inline:c,id:o,className:a,"data-testid":o?exports.TestHelper.generateId(o,"sanitized"):exports.TestHelper.generateId("sanitized"),dangerouslySetInnerHTML:{__html:$L("string"!=typeof i?u.renderToStaticMarkup(i):i,l)}})};var FL={exports:{}};
|
|
280
280
|
/**
|
|
281
281
|
* @license
|
|
282
282
|
* Lodash <https://lodash.com/>
|
|
@@ -335,7 +335,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
335
335
|
}
|
|
336
336
|
`,Zk={D1:"heading-xxl",D2:"heading-xl",D3:"heading-md",D4:"heading-sm",DBody:"heading-sm",H1:"heading-lg",H2:"heading-md",H3:"heading-sm",H4:"heading-xs",H5:"body-md",H6:"body-sm",Body:"body-baseline",BodySmall:"body-md",XSmall:"body-xs"},Uk={"TEXT-D1":{type:r.Typography.HeadingXXL,weight:"bold"},"TEXT-D2":{type:r.Typography.HeadingXL,weight:"bold"},"TEXT-D3":{type:r.Typography.HeadingMD,weight:"bold"},"TEXT-D4":{type:r.Typography.HeadingSM,weight:"bold"},"TEXT-DBODY":{type:r.Typography.HeadingSM,weight:"light"},"TEXT-H1":{type:r.Typography.HeadingLG,weight:"bold"},"TEXT-H2":{type:r.Typography.HeadingMD,weight:"bold"},"TEXT-H3":{type:r.Typography.HeadingSM,weight:"bold"},"TEXT-H4":{type:r.Typography.HeadingXS,weight:"bold"},"TEXT-H5":{type:r.Typography.BodyMD,weight:"bold"},"TEXT-H6":{type:r.Typography.BodySM,weight:"bold"},"TEXT-BODY":{type:r.Typography.BodyBL,weight:"regular"},"TEXT-BODYSMALL":{type:r.Typography.BodyMD,weight:"regular"},"TEXT-XSMALL":{type:r.Typography.BodyXS,weight:"regular"}},Bk={"HEADING-XXL":r.Typography.HeadingXXL,"HEADING-XL":r.Typography.HeadingXL,"HEADING-MD":r.Typography.HeadingMD,"HEADING-SM":r.Typography.HeadingSM,"HEADING-LG":r.Typography.HeadingLG,"HEADING-XS":r.Typography.HeadingXS,"BODY-MD":r.Typography.BodyMD,"BODY-SM":r.Typography.BodySM,"BODY-BL":r.Typography.BodyBL,"BODY-XS":r.Typography.BodyXS},Vk={300:"light",400:"regular",500:"medium",700:"bold",900:"bold"},Hk={"text-d1":"h1","text-d2":"h1","text-dbody":"h1","text-h1":"h1","text-h2":"h2","text-h3":"h3","text-h4":"h4","text-h5":"h5","text-h6":"h6","text-body":"p","text-bodysmall":"p","text-xsmall":"p"},Gk=V.default(a.Button.Small)`
|
|
337
337
|
padding: 0;
|
|
338
|
-
`;var Yk;exports.EElementType=void 0,(Yk=exports.EElementType||(exports.EElementType={})).ALERT="Alert",Yk["TEXT-D1"]="Text",Yk["TEXT-D2"]="Text",Yk["TEXT-DBODY"]="Text",Yk["TEXT-H1"]="Text",Yk["TEXT-H2"]="Text",Yk["TEXT-H3"]="Text",Yk["TEXT-H4"]="Text",Yk["TEXT-H5"]="Text",Yk["TEXT-H6"]="Text",Yk["TEXT-BODY"]="Text",Yk["TEXT-BODYSMALL"]="Text",Yk["TEXT-XSMALL"]="Text",Yk["HEADING-XXL"]="Text",Yk["HEADING-XL"]="Text",Yk["HEADING-MD"]="Text",Yk["HEADING-SM"]="Text",Yk["HEADING-LG"]="Text",Yk["HEADING-XS"]="Text",Yk["BODY-MD"]="Text",Yk["BODY-SM"]="Text",Yk["BODY-BL"]="Text",Yk["BODY-XS"]="Text",Yk.DIV="Wrapper",Yk.DIVIDER="Divider",Yk.SPAN="Wrapper",Yk.HEADER="Wrapper",Yk.FOOTER="Wrapper",Yk.H1="Wrapper",Yk.H2="Wrapper",Yk.H3="Wrapper",Yk.H4="Wrapper",Yk.H5="Wrapper",Yk.H6="Wrapper",Yk.P="Wrapper",Yk.GRID="Grid",Yk.TAB="Tab",Yk["TAB-ITEM"]="TabItem",Yk["LIST-ITEM"]="ListItem",Yk["ORDERED-LIST"]="List",Yk["UNORDERED-LIST"]="List",Yk.ACCORDION="Accordion",Yk.POPOVER="Popover";var Wk=Object.freeze({__proto__:null,Accordion:t=>{const{schema:n,id:r}=t,{children:i,button:o,title:s,disableContentInset:u,...c}=n,{dispatchFieldEvent:l}=yI();return e.jsx(d.BoxContainer,{id:r,title:"string"==typeof s?s:e.jsx(uU,{children:s}),...c,callToActionComponent:o?e.jsx(a.Button.Default,{styleType:"light",type:"button",onClick:()=>l("accordion","edit",r),children:"object"==typeof o?o.label:"Edit"}):void 0,children:u?e.jsx(uU,{id:r,children:i}):e.jsx(Fk,{children:e.jsx(uU,{id:r,children:i})})})},Alert:t=>{const{id:n,schema:{children:r,...i}}=t
|
|
338
|
+
`;var Yk;exports.EElementType=void 0,(Yk=exports.EElementType||(exports.EElementType={})).ALERT="Alert",Yk["TEXT-D1"]="Text",Yk["TEXT-D2"]="Text",Yk["TEXT-DBODY"]="Text",Yk["TEXT-H1"]="Text",Yk["TEXT-H2"]="Text",Yk["TEXT-H3"]="Text",Yk["TEXT-H4"]="Text",Yk["TEXT-H5"]="Text",Yk["TEXT-H6"]="Text",Yk["TEXT-BODY"]="Text",Yk["TEXT-BODYSMALL"]="Text",Yk["TEXT-XSMALL"]="Text",Yk["HEADING-XXL"]="Text",Yk["HEADING-XL"]="Text",Yk["HEADING-MD"]="Text",Yk["HEADING-SM"]="Text",Yk["HEADING-LG"]="Text",Yk["HEADING-XS"]="Text",Yk["BODY-MD"]="Text",Yk["BODY-SM"]="Text",Yk["BODY-BL"]="Text",Yk["BODY-XS"]="Text",Yk.DIV="Wrapper",Yk.DIVIDER="Divider",Yk.SPAN="Wrapper",Yk.HEADER="Wrapper",Yk.FOOTER="Wrapper",Yk.H1="Wrapper",Yk.H2="Wrapper",Yk.H3="Wrapper",Yk.H4="Wrapper",Yk.H5="Wrapper",Yk.H6="Wrapper",Yk.P="Wrapper",Yk.GRID="Grid",Yk.TAB="Tab",Yk["TAB-ITEM"]="TabItem",Yk["LIST-ITEM"]="ListItem",Yk["ORDERED-LIST"]="List",Yk["UNORDERED-LIST"]="List",Yk.ACCORDION="Accordion",Yk.POPOVER="Popover";var Wk=Object.freeze({__proto__:null,Accordion:t=>{const{schema:n,id:r}=t,{children:i,button:o,title:s,disableContentInset:u,...c}=n,{dispatchFieldEvent:l}=yI();return e.jsx(d.BoxContainer,{id:r,title:"string"==typeof s?s:e.jsx(uU,{children:s}),...c,callToActionComponent:o?e.jsx(a.Button.Default,{styleType:"light",type:"button",onClick:()=>l("accordion","edit",r),children:"object"==typeof o?o.label:"Edit"}):void 0,children:u?e.jsx(uU,{id:r,children:i}):e.jsx(Fk,{children:e.jsx(uU,{id:r,children:i})})})},Alert:t=>{const{id:n,schema:{children:r,...i}}=t,a=`${n}-content`;return e.jsx(c.Alert,{id:n,"data-testid":exports.TestHelper.generateId(n,"alert"),...i,children:"string"==typeof r?e.jsx(RL,{id:a,children:r}):U.default.isValidElement(r)||Array.isArray(r)||"number"==typeof r||"boolean"==typeof r||null==typeof r?r:e.jsx(uU,{children:r})})},Divider:t=>{const{id:n,schema:{verticalMargin:r,...i}}=t;return e.jsx(zk,{id:n,"data-testid":exports.TestHelper.generateId(n,"divider"),$verticalMargin:r,...i})},Grid:t=>{const{id:n,schema:{children:r,customOptions:i={gridType:"v2"},uiType:a,...o}}=t,s="v3"===i.gridType?Pk:jk,u="v3"===i.gridType?"grid":"flex";return e.jsx(s,{type:u,"data-testid":exports.TestHelper.generateId(n,"grid"),...o,children:e.jsx(uU,{children:r})})},List:t=>{const{id:n,schema:{children:r,uiType:i,size:a,...o}}=t,s="ordered-list"===i?h.TextList.Ol:h.TextList.Ul;return e.jsx(s,{id:n,"data-testid":exports.TestHelper.generateId(n,i),size:(e=>e in Zk)(a)?Zk[a]:a,...o,children:r.map(((t,n)=>"string"==typeof t?e.jsx("li",{children:e.jsx(RL,{inline:!0,children:t})},n):e.jsx(uU,{children:t},n)))})},ListItem:t=>{const{id:n,schema:{children:r,uiType:i,showIf:a,columns:o,...s}}=t;return e.jsx("li",{id:n,...s,children:"string"==typeof r?e.jsx(RL,{inline:!0,children:r}):e.jsx(uU,{children:r})})},Popover:t=>{const{id:n,schema:{children:r,className:i,icon:a,hint:{content:o,...s},...u}}=t;return e.jsx(m.PopoverInline,{id:n,"data-testid":exports.TestHelper.generateId(n,"popover"),className:i,icon:(()=>{if(!a)return null;const t=H[a];return e.jsx(t,{})})(),content:r&&e.jsx(RL,{inline:!0,children:r}),popoverContent:(()=>{const t={allowedTags:$L.defaults.allowedTags.concat(["img"]),allowedAttributes:!1};return"string"==typeof o?e.jsx(RL,{inline:!0,sanitizeOptions:t,children:o}):e.jsx(uU,{children:o})})(),...s,...u})},Tab:n=>{const{id:r,schema:{currentActiveTabId:i,children:a,...o}}=n,[s,u]=t.useState(p()),{removeFieldValidationConfig:c}=Dk(),{unregister:l}=xe(),{dispatchFieldEvent:d}=yI(),f=Object.keys(a);t.useEffect((()=>{u(p())}),[i]),_s((()=>{Object.values(a).forEach(((e,t)=>{if(t===s)return;h(e).forEach((e=>{c(e),l(e)}))}))}),[s,a]);function p(){const e=Object.keys(a).findIndex((e=>e===i));return e<0?0:e}const h=e=>{const t=e.children,n=[];return dE(t)||!un(t)||Object.entries(t).forEach((([e,t])=>{n.push(e),"chips"===t.uiType&&n.push(e+"-textarea"),t.children&&n.push(...h(t))})),n};return e.jsx(y.Tab,{...o,id:r,"data-testid":exports.TestHelper.generateId(r,"tab"),currentActive:s,onTabClick:(e,t)=>{t!==s&&(u(t),d("change",r,{previousTabId:f[s],currentTabId:f[t]}))},children:Object.entries(a).map((([n,r])=>{const{title:i,children:a,...o}=r;return t.createElement(y.Tab.Item,{...o,key:n,id:n,"data-testid":exports.TestHelper.generateId(n,"tab-item"),title:i},e.jsx(uU,{children:a}))}))})},Text:n=>{const{id:r,schema:{children:i,uiType:a,maxLines:o,weight:s,...u}}=n,c=t.useRef(null),[l,d]=t.useState(!1),[f,p]=t.useState(!1),h=Uk[a.toUpperCase()]?.type||Bk[a.toUpperCase()]||void 0,m=Hk[a]||void 0;t.useEffect((()=>{if(d(!o),p(o>0),!o||!c.current)return;const e=c.current.clientHeight,t=c.current.scrollHeight;p(t-e>1)}),[i,o]);const g=e=>exports.TestHelper.generateId(e,"text"),y=()=>{const e=Hr(i)&&i.length>1,t=un(i)&&Object.keys(i).length>1;return e||t},_={allowedTags:$L.defaults.allowedTags.concat(["img"]),allowedAttributes:!1};return e.jsxs(e.Fragment,{children:[e.jsx(h,{id:r,ref:c,maxLines:l?void 0:o,"data-testid":g(r),weight:s?iI(s)?Vk[s]:s:a.toUpperCase()in Uk?Uk[a.toUpperCase()].weight:void 0,...u,...m&&!y()&&{as:m},...y()&&{as:"div"},children:Hr(i)?i.map(((t,n)=>{const i=`${r}-${n}`,a=`${i}-content`;return e.jsx(h,{id:i,"data-testid":g(i),children:e.jsx(RL,{id:a,inline:!0,sanitizeOptions:_,children:t})},n)})):"object"==typeof i?e.jsx(uU,{children:i}):e.jsx(RL,{inline:!0,sanitizeOptions:_,children:i})}),f&&e.jsx(Gk,{styleType:"link",onClick:()=>d(!l),children:l?"View less":"View more"})]})},get EElementType(){return exports.EElementType}});const qk=t.forwardRef((({onChange:n,formValues:r,schema:i,error:a},o)=>{const s=t.useRef(null),u=t.useRef(void 0),c=t.useRef(null),{customComponents:l}=mI(),[d,f]=t.useState({}),[p,h]=t.useState(),{isSubmitting:m,isDirty:g}=Le(),{formSchema:{restoreMode:y,revalidationMode:_,validationMode:v,stripUnknown:b}}=Ck(),E=kk(g);t.useImperativeHandle(o,(()=>s.current)),t.useEffect((()=>{g||void 0===E||E===g||s.current?.reset()}),[g]),t.useEffect((()=>{g?tI(r,d)||r&&Object.entries(r).forEach((([e,t])=>{s.current?.setValue(e,t)})):h(r)}),[r]),t.useEffect((()=>{m&&s.current?.validate()}),[m]),t.useEffect((()=>{u.current=a,a?s.current?.setErrors(a):s.current?.clearErrors()}),[a]);const S=t.useCallback((()=>{u.current&&setTimeout((()=>{u.current&&s.current?.setErrors(u.current)}),0)}),[]);return e.jsx("div",{ref:c,onBlurCapture:S,children:e.jsx(mU,{ref:s,data:{sections:{section:{uiType:"section",children:i}},defaultValues:p,restoreMode:y,revalidationMode:_,validationMode:v,stripUnknown:b},onValueChange:(e,t=!1)=>{(g||void 0===E||E===g)&&(f(e),n(e,t))},wrapInForm:!1,components:l})})})),Kk=V.default.div`
|
|
339
339
|
${({$inset:e})=>e&&`\n\tpadding-left: ${e};\n\tpadding-right: ${e};\n\t`}
|
|
340
340
|
|
|
341
341
|
&:not(:last-child) {
|
|
@@ -416,7 +416,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
416
416
|
margin: 0;
|
|
417
417
|
padding: 0;
|
|
418
418
|
}
|
|
419
|
-
`,Z$=({Field:n,id:r,schema:i,warning:a})=>{const{control:o,setValue:s}=xe(),{formSchema:{defaultValues:u,restoreMode:c="none"}}=Ck(),{getField:l,setField:d,setRegisteredFields:f}=Nk(),{removeFieldValidationConfig:p}=Dk(),h=t.useRef(c);t.useEffect((()=>{h.current=c}),[c]),gI((()=>(s(r,l(r)),f((e=>[...e,r])),()=>{switch(h.current){case"default-value":d(r,u?.[r]);break;case"none":{const e=l(r);Hr(e)?d(r,[]):o$(e)?d(r,""):(iI(e)||QL(e))&&d(r,void 0);break}}f((e=>e.filter((e=>e!==r)))),p(r)})),[]);const m=(t,n)=>{const r=n.label;return"string"==typeof r?{children:e.jsx(RL,{inline:!0,children:r})}:r&&"object"==typeof r&&r.mainLabel?{children:e.jsx(RL,{inline:!0,children:r.mainLabel}),subtitle:e.jsx(U$,{className:"sub-label",children:r.subLabel}),addon:r.hint?.content?{type:"popover",content:e.jsx(B$,{className:"label-hint",children:r.hint?.content}),"data-testid":(n["data-testid"]||t)+"-popover",zIndex:r.hint?.zIndex}:void 0}:void 0};return e.jsx(Re,{control:o,name:r,shouldUnregister:!0,render:({field:t,fieldState:o})=>{const{ref:s,...u}=t,c={...u,id:r,formattedLabel:m(r,i),value:l(r),warning:a};return e.jsx(n,{schema:i,...c,...o})}})},U$=V.default(RL)`
|
|
419
|
+
`,Z$=({Field:n,id:r,schema:i,warning:a})=>{const{control:o,setValue:s}=xe(),{formSchema:{defaultValues:u,restoreMode:c="none"}}=Ck(),{getField:l,setField:d,setRegisteredFields:f}=Nk(),{removeFieldValidationConfig:p}=Dk(),h=t.useRef(c);t.useEffect((()=>{h.current=c}),[c]),gI((()=>(s(r,l(r)),f((e=>[...e,r])),()=>{switch(h.current){case"default-value":d(r,u?.[r]);break;case"none":{const e=l(r);Hr(e)?d(r,[]):o$(e)?d(r,""):(iI(e)||QL(e))&&d(r,void 0);break}}f((e=>e.filter((e=>e!==r)))),p(r)})),[]);const m=(t,n)=>{const r=n.label;return"string"==typeof r?{children:e.jsx(RL,{inline:!0,children:r})}:r&&"object"==typeof r&&r.mainLabel?{children:e.jsx(RL,{inline:!0,children:r.mainLabel}),subtitle:e.jsx(U$,{className:"sub-label",id:`${t}-label-subtitle`,children:r.subLabel}),addon:r.hint?.content?{type:"popover",content:e.jsx(B$,{className:"label-hint",children:r.hint?.content}),"data-testid":(n["data-testid"]||t)+"-popover",zIndex:r.hint?.zIndex}:void 0}:void 0};return e.jsx(Re,{control:o,name:r,shouldUnregister:!0,render:({field:t,fieldState:o})=>{const{ref:s,...u}=t,c={...u,id:r,formattedLabel:m(r,i),value:l(r),warning:a};return e.jsx(n,{schema:i,...c,...o})}})},U$=V.default(RL)`
|
|
420
420
|
&.sub-label {
|
|
421
421
|
display: block;
|
|
422
422
|
${n.Font["body-md-regular"]};
|
|
@@ -478,7 +478,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
478
478
|
cursor: pointer;
|
|
479
479
|
`,cz=V.default(c.Alert)`
|
|
480
480
|
margin-top: ${n.Spacing["spacing-8"]};
|
|
481
|
-
`;var lz=Vr,dz=Hr,fz=qt?qt.isConcatSpreadable:void 0;var pz=sa,hz=function(e){return dz(e)||lz(e)||!!(fz&&e&&e[fz])};var mz=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=hz),a||(a=[]);++o<s;){var u=t[o];n>0&&r(u)?n>1?e(u,n-1,r,i,a):pz(a,u):i||(a[a.length]=u)}return a};var gz=Na,yz=function(){},_z=gz&&1/FS(new gz([,-0]))[1]==1/0?function(e){return new gz(e)}:yz,vz=CS,bz=A$,Ez=x$,Sz=DS,Az=_z,xz=FS;var wz=function(e,t,n){var r=-1,i=bz,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=Ez;else if(a>=200){var c=t?null:Az(e);if(c)return xz(c);o=!1,i=Sz,u=new vz}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s},Tz=D$,Mz=mz,Oz=wz;var Cz=function(e,t,n){var r=e.length;if(r<2)return r?Oz(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Tz(a[i]||o,e[s],t,n));return Oz(Mz(a,1),t,n)},Nz=Ki,Dz=Cz,Lz=AI,Iz=yk((function(e){return Dz(Nz(e,Lz))}));const kz=t.createContext({files:[],setFiles:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),$z=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState([]),s=t.useMemo((()=>({files:r,setFiles:i,currentFileIds:a,setCurrentFileIds:o})),[r,a]);return e.jsx(kz.Provider,{value:s,children:n})};var Rz,Fz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(Rz||(Rz={})),exports.EFileStatus=void 0,(Fz=exports.EFileStatus||(exports.EFileStatus={}))[Fz.INJECTED=-99]="INJECTED",Fz[Fz.INJECTING=-98]="INJECTING",Fz[Fz.TO_DELETE=-4]="TO_DELETE",Fz[Fz.ERROR_FORMAT=-3]="ERROR_FORMAT",Fz[Fz.ERROR_GENERIC=-2]="ERROR_GENERIC",Fz[Fz.ERROR_SIZE=-1]="ERROR_SIZE",Fz[Fz.NONE=0]="NONE",Fz[Fz.UPLOAD_READY=4]="UPLOAD_READY",Fz[Fz.UPLOADING=5]="UPLOADING",Fz[Fz.UPLOADED=6]="UPLOADED";const zz=t.lazy((()=>Promise.resolve().then((function(){return require("./file-upload-manager.
|
|
481
|
+
`;var lz=Vr,dz=Hr,fz=qt?qt.isConcatSpreadable:void 0;var pz=sa,hz=function(e){return dz(e)||lz(e)||!!(fz&&e&&e[fz])};var mz=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=hz),a||(a=[]);++o<s;){var u=t[o];n>0&&r(u)?n>1?e(u,n-1,r,i,a):pz(a,u):i||(a[a.length]=u)}return a};var gz=Na,yz=function(){},_z=gz&&1/FS(new gz([,-0]))[1]==1/0?function(e){return new gz(e)}:yz,vz=CS,bz=A$,Ez=x$,Sz=DS,Az=_z,xz=FS;var wz=function(e,t,n){var r=-1,i=bz,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=Ez;else if(a>=200){var c=t?null:Az(e);if(c)return xz(c);o=!1,i=Sz,u=new vz}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s},Tz=D$,Mz=mz,Oz=wz;var Cz=function(e,t,n){var r=e.length;if(r<2)return r?Oz(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Tz(a[i]||o,e[s],t,n));return Oz(Mz(a,1),t,n)},Nz=Ki,Dz=Cz,Lz=AI,Iz=yk((function(e){return Dz(Nz(e,Lz))}));const kz=t.createContext({files:[],setFiles:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),$z=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState([]),s=t.useMemo((()=>({files:r,setFiles:i,currentFileIds:a,setCurrentFileIds:o})),[r,a]);return e.jsx(kz.Provider,{value:s,children:n})};var Rz,Fz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(Rz||(Rz={})),exports.EFileStatus=void 0,(Fz=exports.EFileStatus||(exports.EFileStatus={}))[Fz.INJECTED=-99]="INJECTED",Fz[Fz.INJECTING=-98]="INJECTING",Fz[Fz.TO_DELETE=-4]="TO_DELETE",Fz[Fz.ERROR_FORMAT=-3]="ERROR_FORMAT",Fz[Fz.ERROR_GENERIC=-2]="ERROR_GENERIC",Fz[Fz.ERROR_SIZE=-1]="ERROR_SIZE",Fz[Fz.NONE=0]="NONE",Fz[Fz.UPLOAD_READY=4]="UPLOAD_READY",Fz[Fz.UPLOADING=5]="UPLOADING",Fz[Fz.UPLOADED=6]="UPLOADED";const zz=t.lazy((()=>Promise.resolve().then((function(){return require("./file-upload-manager.75d19b87.js")})))),Pz=n=>{const{id:r,error:i,isDirty:a,isTouched:o,value:s,schema:{compressImages:u,description:c,hideThumbnail:l,label:d,uploadOnAddingFile:f,validation:p,warning:h,...m},warning:g}=n,{files:y,currentFileIds:_,setFiles:v}=t.useContext(kz),b=t.useRef({}),E=t.useRef({}),S=t.useRef({}),A=t.useRef({}),x=t.useRef({}),{setFieldValidationConfig:w}=Dk(),{dispatchFieldEvent:T}=yI(),{clearErrors:O,setError:C}=xe(),[N,D]=t.useState(),L=t.useRef(y),I=t.useCallback(((e,t)=>{const n=[...t],i=n.length;e.forEach(((e,t)=>{!S.current.max||i+t<S.current.max?(n.push({...e,slot:Rz.findAvailableSlot(n)}),O(r)):C(r,{type:"max",message:S.current.errorMessage||om.UPLOAD().MAX_FILES(S.current.max)})})),v(n)}),[O,r,C,v]);t.useEffect((()=>{L.current=y}),[y]),t.useEffect((()=>{T("mount",r)}),[T,r]),t.useEffect((()=>{const e=p?.find((e=>"required"in e)),t=p?.find((e=>"fileType"in e)),n=p?.find((e=>"fileExtension"in e)),i=p?.find((e=>"maxSizeInKb"in e)),a=p?.find((e=>"upload"in e&&e.upload));b.current=t?.fileType?t:{},E.current=t?.fileType&&n?.fileExtension?n:{},A.current=i?.maxSizeInKb>0?i:{},x.current=a||{};const o=p?.find((e=>"length"in e)),s=p?.find((e=>"max"in e));S.current=o?{max:o.length,errorMessage:o.errorMessage}:s?{max:s.max,errorMessage:s.errorMessage}:{},w(r,tT().of(Qw().shape({dataURL:zx(),fileId:zx(),fileName:zx(),fileUrl:zx(),uploadResponse:Qw()})).test("is-empty-array",e?.errorMessage||om.UPLOAD().REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",A.current.errorMessage||om.UPLOAD().MAX_FILE_SIZE(A.current.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&A.current.maxSizeInKb)||y.filter((e=>e.status===exports.EFileStatus.UPLOADED)).every((e=>{if("base64"===f.type&&e.dataURL)return exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*A.current.maxSizeInKb;if("multipart"===f.type){const t=e.uploadResponse?.data||e.uploadResponse;let n=e.rawFile?.size||t?.fileSize;return isNaN(n)&&(n=0),n<=1024*A.current.maxSizeInKb}})))).test("max-files",S.current.errorMessage||om.UPLOAD().MAX_FILES(S.current.max),(e=>!(e&&Array.isArray(e)&&S.current.max)||e.length<=S.current.max)).test("no-interim-statuses",om.UPLOAD().UPLOADING,(()=>{const e=new Set([exports.EFileStatus.INJECTED,exports.EFileStatus.INJECTING,exports.EFileStatus.NONE,exports.EFileStatus.UPLOAD_READY,exports.EFileStatus.UPLOADING]);return!L.current.some((t=>e.has(t.status)))})),p)}),[p,y.map((e=>e.status)).join(",")]),t.useEffect((()=>{if(!a&&!o){const e=Array.isArray(s)?s:[];if(!(Iz(e.map((({fileId:e})=>e)),_).length>0))return;const t=[];e.forEach((({dataURL:e,fileId:n,fileName:r,fileUrl:i,uploadResponse:a})=>{t.push({addedFrom:"schema",dataURL:e,fileItem:{id:n},uploadResponse:a,fileUrl:i,rawFile:{name:r},slot:null,status:exports.EFileStatus.INJECTED})})),I(t,[])}}),[I,a,o,_,s]),t.useEffect((()=>{if(i?.message)try{const{message:e,fileErrors:t}=JSON.parse(i.message);t&&v(L.current.map((e=>{const n=t[e.fileItem.id];return n?{...e,fileItem:{...e.fileItem,errorMessage:n}}:e}))),e&&D(e)}catch(e){D(i.message)}else D(void 0)}),[i?.message,v]);const k=t=>t?e.jsx(RL,{children:t}):null;return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(zz,{compressImages:!!u,fileTypeRule:b.current,fileExtensionRule:E.current,hideThumbnail:l,id:r,maxFileSizeRule:A.current,upload:f,uploadRule:x.current,value:s})}),e.jsx(M.FileUpload,{...m,accept:b.current.fileType?.map((e=>`.${e}`)).join(","),description:k(c),errorMessage:k(N),fileItems:y.filter((({fileItem:e,status:t})=>!!e&&t!==exports.EFileStatus.INJECTED&&t!==exports.EFileStatus.INJECTING)).map((({fileItem:e})=>e)),id:r,maxFiles:S.current.max,onChange:e=>{I(e.map((e=>({addedFrom:"input",rawFile:e,slot:null,status:exports.EFileStatus.NONE}))),y)},onDelete:e=>{v(y.map((t=>t.fileItem.id!==e.id?t:{...t,status:exports.EFileStatus.TO_DELETE}))),O(r)},title:k(d),warning:k(g||h)})]})},jz=t.createContext({images:[],setImages:()=>null,errorCount:0,setErrorCount:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),Zz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState(0),[s,u]=t.useState([]);return e.jsx(jz.Provider,{value:{images:r,setImages:i,errorCount:a,setErrorCount:o,currentFileIds:s,setCurrentFileIds:u},children:n})};var Uz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(Uz||(Uz={}));const Bz=["jpg","gif","png","heic","heif","webp"];var Vz;exports.EImageStatus=void 0,(Vz=exports.EImageStatus||(exports.EImageStatus={}))[Vz.INJECTED=-99]="INJECTED",Vz[Vz.ERROR_FILENAME=-8]="ERROR_FILENAME",Vz[Vz.ERROR_CUSTOM_MUTED=-7]="ERROR_CUSTOM_MUTED",Vz[Vz.ERROR_EXCEED=-6]="ERROR_EXCEED",Vz[Vz.ERROR_CUSTOM=-5]="ERROR_CUSTOM",Vz[Vz.TO_DELETE=-4]="TO_DELETE",Vz[Vz.ERROR_FORMAT=-3]="ERROR_FORMAT",Vz[Vz.ERROR_GENERIC=-2]="ERROR_GENERIC",Vz[Vz.ERROR_SIZE=-1]="ERROR_SIZE",Vz[Vz.NONE=0]="NONE",Vz[Vz.TO_RECOMPRESS=1]="TO_RECOMPRESS",Vz[Vz.COMPRESSED=2]="COMPRESSED",Vz[Vz.RECOMPRESSED=2]="RECOMPRESSED",Vz[Vz.CONVERTED=2]="CONVERTED",Vz[Vz.EDITED=3]="EDITED",Vz[Vz.UPLOAD_READY=4]="UPLOAD_READY",Vz[Vz.UPLOADING=5]="UPLOADING",Vz[Vz.UPLOADED=6]="UPLOADED",Vz[Vz.PENDING=7]="PENDING";var Hz,Gz={exports:{}},Yz={exports:{}},Wz={};var qz,Kz,Jz,Xz,Qz,eP,tP,nP,rP,iP,aP,oP,sP,uP,cP={};
|
|
482
482
|
/** @license React v16.13.1
|
|
483
483
|
* react-is.development.js
|
|
484
484
|
*
|
|
@@ -1011,7 +1011,7 @@ object-assign
|
|
|
1011
1011
|
stroke: ${n.Colour["icon-primary"]};
|
|
1012
1012
|
stroke-width: 1;
|
|
1013
1013
|
}
|
|
1014
|
-
`,NZ=n=>{const{accepts:r,activeFileIndex:i,capture:a,id:o="image-thumbnails",images:s,maxFiles:u,onClickThumbnail:c,onSelectFile:l,multiple:d}=n,f=t.useRef(null),p=async e=>{const t=Array.from(e.target.files||[]);t.length&&setTimeout((()=>{l(t)}),100)},h=()=>f?.current?.click();return e.jsxs(EZ,{id:exports.TestHelper.generateId(o),children:[s.map(((t,n)=>t.status===exports.EImageStatus.NONE?e.jsx(TZ,{children:[...Array(4)].map(((t,n)=>e.jsx(wZ,{},`dot-${n}`)))},n):t.status>exports.EImageStatus.NONE||t.status===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsx(SZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),src:t.thumbnailDataURL||t.dataURL||"https://assets.life.gov.sg/web-frontend-engine/img/icons/photo-placeholder-add.svg",type:"button","aria-label":`thumbnail of ${t.name}`,onClick:()=>c(n),children:e.jsx(MZ,{isSelected:i===n})},n):"reviewModal"===t.addedFrom||t.status<exports.EImageStatus.NONE?e.jsxs(SZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),type:"button","aria-label":`error with ${t.name}`,onClick:()=>c(n),error:!0,children:[e.jsx(MZ,{isSelected:i===n}),e.jsx(AZ,{})]},n):void 0)),(s.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED||"reviewModal"===t)).length<u||!u)&&e.jsxs(e.Fragment,{children:[e.jsx(OZ,{id:exports.TestHelper.generateId(o,"file-input"),"data-testid":exports.TestHelper.generateId(o,"file-input"),type:"file","aria-hidden":"true",tabIndex:-1,capture:a,ref:f,accept:r.map((e=>`.${e}`)).join(", "),onChange:p,multiple:d,value:""}),e.jsx(CZ,{type:"button",id:exports.TestHelper.generateId(o,"add-image-button"),"data-testid":exports.TestHelper.generateId(o,"add-image-button"),"aria-label":"add image",styleType:"secondary",onClick:h,children:e.jsx(k.PlusIcon,{})})]})]})},DZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.d2321141.js")})))),LZ=[{color:"#282828",label:"black"},{color:"#FFF",colorScheme:"light",label:"white"},{color:"#017cd3",label:"blue"},{color:"#fb0101",label:"red"},{color:"#22910c",label:"green"},{color:"#f8e821",label:"yellow"}],IZ=n=>{const{accepts:r,capture:i,className:a,compress:s,dimensions:u,id:c="image-review",maxFiles:l,maxSizeInKb:d,onExit:f,outputType:p,show:h,multiple:m,maxFilesErrorMessage:g,imageReviewModalStyles:y}=n,{images:_,setImages:v}=t.useContext(jz),{dispatchFieldEvent:b,addFieldEventListener:E,removeFieldEventListener:S}=yI(),A=kk(h),[x,w]=t.useState(_.length-1),[T,M]=t.useState(!1),[C,N]=t.useState(),D=!!_?.find((({status:e})=>e===exports.EImageStatus.NONE)),[L,I]=t.useState(LZ[0].color),[k,$]=t.useState(!1),R=t.useRef(null),F=!!_?.find((({addedFrom:e,status:t})=>"reviewModal"===e&&t<=exports.EImageStatus.NONE))||!_.length,z=t.useCallback((e=>{e.detail.removePendingImages&&v((e=>e.filter((({status:e})=>e===exports.EImageStatus.UPLOADED||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)))),f()}),[f,v]),P=e=>{!l||e.length+_.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||"reviewModal"===t)).length<=l?e.forEach((e=>{v((t=>{const n=Uz.findAvailableSlot(t);return[...t,{id:um(),file:e,name:e.name,dimensions:u,status:exports.EImageStatus.NONE,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))})):v((t=>{const n=Uz.findAvailableSlot(t);return[...t,{id:um(),file:e[0],name:e[0].name,dimensions:u,status:exports.EImageStatus.ERROR_EXCEED,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))},j=e=>{e&&(v((e=>e.map(((e,t)=>({...e,...t===x?{status:exports.EImageStatus.TO_DELETE}:{}}))))),w(Math.max(0,x-1))),N(null)},Z=t.useCallback((()=>{v((e=>e.filter((({status:e})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)).map((e=>{const t={...e};return e.drawingDataURL&&(t.dataURL=e.drawingDataURL),e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE&&(t.status=exports.EImageStatus.UPLOAD_READY),t.drawingDataURL=void 0,t.drawing=void 0,t}))))}),[v]),U=()=>{!b("save-review-images",c,{images:_,retry:U})||(Z(),f())},B=()=>{M(!0),I(LZ[0].color)},V=async()=>{const{dataURL:e,drawing:t}=R.current?.export()||{},n=await exports.ImageHelper.dataUrlToImage(e),r=await exports.ImageHelper.resampleImage(n,{scale:96/n.width,type:exports.FileHelper.fileExtensionToMimeType(p)}),i=await exports.FileHelper.fileToDataUrl(r);v((n=>{const r=[...n];return r[x]={...r[x],thumbnailDataURL:i,drawingDataURL:e,drawing:t,status:s?exports.EImageStatus.TO_RECOMPRESS:exports.EImageStatus.EDITED},r})),M(!1),G()},H=()=>{G(),$(!0)},G=()=>{I(""),$(!1)};t.useEffect((()=>{const e={"trigger-save-review-images":Z,"dismiss-review-modal":z};return Object.entries(e).forEach((([e,t])=>{E(e,c,t)})),()=>{Object.entries(e).forEach((([e,t])=>{S(e,c,t)}))}}),[E,z,Z,c,S]),t.useEffect((()=>{w(_.length-1)}),[_.length]),t.useEffect((()=>{h?b("show-review-modal",c):A&&b("hide-review-modal",c)}),[h]);return e.jsx(o.Modal,{id:exports.TestHelper.generateId(c,void 0,h?"show":"hide"),className:a?`${a}-review`:void 0,show:h,children:e.jsx(eZ,{className:a?`${a}-review-modal-box`:void 0,imageReviewModalStyles:y,showCloseButton:!1,children:h?e.jsxs(e.Fragment,{children:[e.jsx(tZ,{className:a?`${a}-header`:void 0,$drawActive:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(aZ,{id:exports.TestHelper.generateId(c,"clear-drawing-button"),"data-testid":exports.TestHelper.generateId(c,"clear-drawing-button"),onClick:()=>N("clear-drawing"),children:"Clear"}),e.jsx(aZ,{id:exports.TestHelper.generateId(c,"save-drawing"),"data-testid":exports.TestHelper.generateId(c,"save-drawing"),onClick:V,children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(nZ,{id:exports.TestHelper.generateId(c,"close-button"),"data-testid":exports.TestHelper.generateId(c,"close-button"),"aria-label":"exit review modal",onClick:()=>N("exit"),children:e.jsx(O.CrossIcon,{type:"cross"})}),e.jsx(rZ,{weight:"semibold",children:"Review photos"})]})}),e.jsxs(oZ,{children:[_.length>0&&e.jsx(pZ,{className:a?`${a}-editor`:void 0,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(DZ,{baseImageDataURL:_[x]?.dataURL,drawing:_[x]?.drawing,color:T?L:void 0,erase:!!T&&k,ref:R,maxSizeInKb:d})})}),_.length>0&&e.jsx(sZ,{children:"Loading Preview..."}),!T&&_[x]?.status>=exports.EImageStatus.NONE&&e.jsxs(uZ,{children:[e.jsxs(cZ,{id:exports.TestHelper.generateId(c,"draw-button"),"data-testid":exports.TestHelper.generateId(c,"draw-button"),onClick:B,disabled:D,children:[e.jsx(dZ,{$disabled:D}),e.jsx(lZ,{weight:"semibold",$disabled:D,children:"Draw"})]}),e.jsxs(cZ,{id:exports.TestHelper.generateId(c,"delete-button"),"data-testid":exports.TestHelper.generateId(c,"delete-button"),onClick:()=>N("delete"),disabled:D,children:[e.jsx(fZ,{$disabled:D}),e.jsx(lZ,{weight:"semibold",$disabled:D,children:"Delete"})]})]}),_[x]?.status<exports.EImageStatus.NONE&&e.jsx(Xj,{id:`${c}-photo-error`,image:_[x],accepts:r,maxSizeInKb:d,onClickOk:()=>j(!0),maxFilesErrorMessage:g,maxFiles:l})]}),e.jsx(hZ,{className:a?`${a}-footer`:void 0,children:T?e.jsxs(e.Fragment,{children:[e.jsx(gZ,{id:exports.TestHelper.generateId(c,"eraser-button"),"data-testid":exports.TestHelper.generateId(c,"eraser-button"),"aria-label":"eraser",onClick:H,children:e.jsx(yZ,{$eraseMode:k})}),e.jsx(vZ,{children:LZ.map((({color:t,colorScheme:n,label:r},i)=>e.jsx(bZ,{id:exports.TestHelper.generateId(c,`palette-color-${i}`),"aria-label":`${r} brush`,$color:t,$colorScheme:n,onClick:()=>(e=>{G(),I(e)})(t),children:L===t&&e.jsx(_Z,{$colorScheme:n})},t)))})]}):e.jsxs(e.Fragment,{children:[e.jsx(NZ,{id:`${c}-image-thumbnails`,activeFileIndex:x,accepts:r,capture:i,maxFiles:l,images:_,onClickThumbnail:w,onSelectFile:P,multiple:m}),e.jsx(mZ,{id:exports.TestHelper.generateId(c,"save-button"),"data-testid":exports.TestHelper.generateId(c,"save-button"),onClick:U,disabled:F,children:"Save"})]})}),e.jsx(Qj,{images:_,show:C,onDecideClearDrawing:e=>{e&&R.current.clearDrawing(),N(null)},onDecideDelete:j,onDecideExit:e=>{e&&(v(_.filter((({addedFrom:e,status:t})=>t>=exports.EImageStatus.UPLOADED||t<exports.EImageStatus.NONE&&"dragInput"===e)).map((e=>({...e,drawingDataURL:void 0,drawing:void 0})))),f()),N(null)}})]}):e.jsx(e.Fragment,{})})})},kZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.fafcc083.js")})))),$Z=n=>{const{schema:{buttonLabel:r,capture:i,className:a,compress:o,crop:s,description:u,dimensions:c={width:1e3,height:1e3},editImage:l,label:d,outputType:f="jpg",uploadOnAddingFile:p,validation:h,multiple:m,imageReviewModalStyles:g,tooltip:y},id:_,isDirty:v,isTouched:b,value:E,warning:S,...A}=n,{images:x,setImages:w,currentFileIds:T}=t.useContext(jz),M=kk(x),[O,C]=t.useState([...Bz]),[N,D]=t.useState(0),[L,I]=t.useState(0),[k,$]=t.useState(!1),[R,F]=t.useState(!1),{setFieldValidationConfig:z}=Dk(),{dispatchFieldEvent:P}=yI(),j=Rk();t.useEffect((()=>{P("mount",_)}),[P,_]),t.useEffect((()=>{if(!v&&!b){const e=Array.isArray(E)?E:[];if(!(Iz(e.map((({fileId:e})=>e)),T).length>0))return;const t=[];e.forEach((({fileId:e,fileName:n,dataURL:r,uploadResponse:i},a)=>{const o={id:e||um(),file:{},name:n,dimensions:{width:10,height:10},dataURL:r,status:exports.EImageStatus.INJECTED,addedFrom:"schema",uploadProgress:100,slot:a,uploadResponse:i};t.push(o)})),w(t)}}),[v,b,T,w,E]),t.useEffect((()=>{const e=h?.find((e=>"required"in e)),t=h?.find((e=>"fileType"in e)),n=h?.find((e=>"maxSizeInKb"in e));t?.fileType&&t?.fileType!==O&&C(t?.fileType),n?.maxSizeInKb&&n?.maxSizeInKb!==L&&I(n?.maxSizeInKb);const r=h?.find((e=>"length"in e)),i=h?.find((e=>"max"in e));let a;r?a={maxFiles:r.length,errorMessage:r.errorMessage}:i&&(a={maxFiles:i.max,errorMessage:i.errorMessage}),a?.maxFiles&&N!==a.maxFiles&&D(a.maxFiles),z(_,tT().of(Qw().shape({fileName:zx(),dataURL:zx()})).test("is-empty-array",e?.errorMessage||om.UPLOAD("photo").REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",n?.errorMessage||om.UPLOAD("photo").MAX_FILE_SIZE(n?.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&n?.maxSizeInKb)||e.every((e=>exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*n?.maxSizeInKb)))),h)}),[h]),t.useEffect((()=>{x.some((e=>e.status===exports.EImageStatus.NONE))||(x.some(((e,t)=>{const n=M?.[t];if(e.status!==n?.status||e.dataURL!==n.dataURL)switch(e.status){case exports.EImageStatus.COMPRESSED:case exports.EImageStatus.CONVERTED:if(l&&!R)return j()?F(!0):$(!0),!0}})),0===x.length&&F(!1))}),[x.map((e=>e.status)).join(","),x.map((e=>e.dataURL)).join(",")]);const Z=(e=!1)=>{e?l&&(document.body.classList.remove("lifesg-ds-overlay-open"),F(!0)):w((e=>e.map((e=>e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE?{...e,status:exports.EImageStatus.UPLOAD_READY}:e)))),$(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(kZ,{accepts:O,compress:!!o,crop:!!s,dimensions:c,editImage:l,id:_,maxSizeInKb:L,outputType:f,upload:p,filenameMatches:h?.find((e=>"matches"in e))?.matches,filenameMatchesErrorMessage:h?.find((e=>"matches"in e))?.errorMessage,value:E})}),e.jsx(Vj,{id:_,capture:i,className:a,label:d,description:u,buttonLabel:r,accepts:O,maxFiles:N,maxSizeInKb:L,dimensions:c,errorMessage:A.error?.message,validation:h,multiple:m,warning:S,tooltip:y}),e.jsx(_T,{id:`${_}-review-prompt`,title:"Review photos?",size:"large",show:k,description:"This lets you check if you've selected the correct photos, and draw on them to highlight the issue.",buttons:[{id:"ok",title:"Ok",onClick:()=>Z(!0)},{id:"skip",title:"Skip",buttonStyle:"secondary",onClick:()=>Z()}]}),(()=>{const t=h?.find((e=>"max"in e));return e.jsx(IZ,{accepts:O,dimensions:c,id:_,className:a,maxFiles:N,maxFilesErrorMessage:t?.errorMessage,maxSizeInKb:L,onExit:()=>F(!1),outputType:f,show:R,multiple:m,capture:i,imageReviewModalStyles:g})})()]})},RZ=i.css`
|
|
1014
|
+
`,NZ=n=>{const{accepts:r,activeFileIndex:i,capture:a,id:o="image-thumbnails",images:s,maxFiles:u,onClickThumbnail:c,onSelectFile:l,multiple:d}=n,f=t.useRef(null),p=async e=>{const t=Array.from(e.target.files||[]);t.length&&setTimeout((()=>{l(t)}),100)},h=()=>f?.current?.click();return e.jsxs(EZ,{id:exports.TestHelper.generateId(o),children:[s.map(((t,n)=>t.status===exports.EImageStatus.NONE?e.jsx(TZ,{children:[...Array(4)].map(((t,n)=>e.jsx(wZ,{},`dot-${n}`)))},n):t.status>exports.EImageStatus.NONE||t.status===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsx(SZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),src:t.thumbnailDataURL||t.dataURL||"https://assets.life.gov.sg/web-frontend-engine/img/icons/photo-placeholder-add.svg",type:"button","aria-label":`thumbnail of ${t.name}`,onClick:()=>c(n),children:e.jsx(MZ,{isSelected:i===n})},n):"reviewModal"===t.addedFrom||t.status<exports.EImageStatus.NONE?e.jsxs(SZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),type:"button","aria-label":`error with ${t.name}`,onClick:()=>c(n),error:!0,children:[e.jsx(MZ,{isSelected:i===n}),e.jsx(AZ,{})]},n):void 0)),(s.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED||"reviewModal"===t)).length<u||!u)&&e.jsxs(e.Fragment,{children:[e.jsx(OZ,{id:exports.TestHelper.generateId(o,"file-input"),"data-testid":exports.TestHelper.generateId(o,"file-input"),type:"file","aria-hidden":"true",tabIndex:-1,capture:a,ref:f,accept:r.map((e=>`.${e}`)).join(", "),onChange:p,multiple:d,value:""}),e.jsx(CZ,{type:"button",id:exports.TestHelper.generateId(o,"add-image-button"),"data-testid":exports.TestHelper.generateId(o,"add-image-button"),"aria-label":"add image",styleType:"secondary",onClick:h,children:e.jsx(k.PlusIcon,{})})]})]})},DZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.b1899917.js")})))),LZ=[{color:"#282828",label:"black"},{color:"#FFF",colorScheme:"light",label:"white"},{color:"#017cd3",label:"blue"},{color:"#fb0101",label:"red"},{color:"#22910c",label:"green"},{color:"#f8e821",label:"yellow"}],IZ=n=>{const{accepts:r,capture:i,className:a,compress:s,dimensions:u,id:c="image-review",maxFiles:l,maxSizeInKb:d,onExit:f,outputType:p,show:h,multiple:m,maxFilesErrorMessage:g,imageReviewModalStyles:y}=n,{images:_,setImages:v}=t.useContext(jz),{dispatchFieldEvent:b,addFieldEventListener:E,removeFieldEventListener:S}=yI(),A=kk(h),[x,w]=t.useState(_.length-1),[T,M]=t.useState(!1),[C,N]=t.useState(),D=!!_?.find((({status:e})=>e===exports.EImageStatus.NONE)),[L,I]=t.useState(LZ[0].color),[k,$]=t.useState(!1),R=t.useRef(null),F=!!_?.find((({addedFrom:e,status:t})=>"reviewModal"===e&&t<=exports.EImageStatus.NONE))||!_.length,z=t.useCallback((e=>{e.detail.removePendingImages&&v((e=>e.filter((({status:e})=>e===exports.EImageStatus.UPLOADED||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)))),f()}),[f,v]),P=e=>{!l||e.length+_.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||"reviewModal"===t)).length<=l?e.forEach((e=>{v((t=>{const n=Uz.findAvailableSlot(t);return[...t,{id:um(),file:e,name:e.name,dimensions:u,status:exports.EImageStatus.NONE,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))})):v((t=>{const n=Uz.findAvailableSlot(t);return[...t,{id:um(),file:e[0],name:e[0].name,dimensions:u,status:exports.EImageStatus.ERROR_EXCEED,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))},j=e=>{e&&(v((e=>e.map(((e,t)=>({...e,...t===x?{status:exports.EImageStatus.TO_DELETE}:{}}))))),w(Math.max(0,x-1))),N(null)},Z=t.useCallback((()=>{v((e=>e.filter((({status:e})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)).map((e=>{const t={...e};return e.drawingDataURL&&(t.dataURL=e.drawingDataURL),e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE&&(t.status=exports.EImageStatus.UPLOAD_READY),t.drawingDataURL=void 0,t.drawing=void 0,t}))))}),[v]),U=()=>{!b("save-review-images",c,{images:_,retry:U})||(Z(),f())},B=()=>{M(!0),I(LZ[0].color)},V=async()=>{const{dataURL:e,drawing:t}=R.current?.export()||{},n=await exports.ImageHelper.dataUrlToImage(e),r=await exports.ImageHelper.resampleImage(n,{scale:96/n.width,type:exports.FileHelper.fileExtensionToMimeType(p)}),i=await exports.FileHelper.fileToDataUrl(r);v((n=>{const r=[...n];return r[x]={...r[x],thumbnailDataURL:i,drawingDataURL:e,drawing:t,status:s?exports.EImageStatus.TO_RECOMPRESS:exports.EImageStatus.EDITED},r})),M(!1),G()},H=()=>{G(),$(!0)},G=()=>{I(""),$(!1)};t.useEffect((()=>{const e={"trigger-save-review-images":Z,"dismiss-review-modal":z};return Object.entries(e).forEach((([e,t])=>{E(e,c,t)})),()=>{Object.entries(e).forEach((([e,t])=>{S(e,c,t)}))}}),[E,z,Z,c,S]),t.useEffect((()=>{w(_.length-1)}),[_.length]),t.useEffect((()=>{h?b("show-review-modal",c):A&&b("hide-review-modal",c)}),[h]);return e.jsx(o.Modal,{id:exports.TestHelper.generateId(c,void 0,h?"show":"hide"),className:a?`${a}-review`:void 0,show:h,children:e.jsx(eZ,{className:a?`${a}-review-modal-box`:void 0,imageReviewModalStyles:y,showCloseButton:!1,children:h?e.jsxs(e.Fragment,{children:[e.jsx(tZ,{className:a?`${a}-header`:void 0,$drawActive:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(aZ,{id:exports.TestHelper.generateId(c,"clear-drawing-button"),"data-testid":exports.TestHelper.generateId(c,"clear-drawing-button"),onClick:()=>N("clear-drawing"),children:"Clear"}),e.jsx(aZ,{id:exports.TestHelper.generateId(c,"save-drawing"),"data-testid":exports.TestHelper.generateId(c,"save-drawing"),onClick:V,children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(nZ,{id:exports.TestHelper.generateId(c,"close-button"),"data-testid":exports.TestHelper.generateId(c,"close-button"),"aria-label":"exit review modal",onClick:()=>N("exit"),children:e.jsx(O.CrossIcon,{type:"cross"})}),e.jsx(rZ,{weight:"semibold",children:"Review photos"})]})}),e.jsxs(oZ,{children:[_.length>0&&e.jsx(pZ,{className:a?`${a}-editor`:void 0,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(DZ,{baseImageDataURL:_[x]?.dataURL,drawing:_[x]?.drawing,color:T?L:void 0,erase:!!T&&k,ref:R,maxSizeInKb:d})})}),_.length>0&&e.jsx(sZ,{children:"Loading Preview..."}),!T&&_[x]?.status>=exports.EImageStatus.NONE&&e.jsxs(uZ,{children:[e.jsxs(cZ,{id:exports.TestHelper.generateId(c,"draw-button"),"data-testid":exports.TestHelper.generateId(c,"draw-button"),onClick:B,disabled:D,children:[e.jsx(dZ,{$disabled:D}),e.jsx(lZ,{weight:"semibold",$disabled:D,children:"Draw"})]}),e.jsxs(cZ,{id:exports.TestHelper.generateId(c,"delete-button"),"data-testid":exports.TestHelper.generateId(c,"delete-button"),onClick:()=>N("delete"),disabled:D,children:[e.jsx(fZ,{$disabled:D}),e.jsx(lZ,{weight:"semibold",$disabled:D,children:"Delete"})]})]}),_[x]?.status<exports.EImageStatus.NONE&&e.jsx(Xj,{id:`${c}-photo-error`,image:_[x],accepts:r,maxSizeInKb:d,onClickOk:()=>j(!0),maxFilesErrorMessage:g,maxFiles:l})]}),e.jsx(hZ,{className:a?`${a}-footer`:void 0,children:T?e.jsxs(e.Fragment,{children:[e.jsx(gZ,{id:exports.TestHelper.generateId(c,"eraser-button"),"data-testid":exports.TestHelper.generateId(c,"eraser-button"),"aria-label":"eraser",onClick:H,children:e.jsx(yZ,{$eraseMode:k})}),e.jsx(vZ,{children:LZ.map((({color:t,colorScheme:n,label:r},i)=>e.jsx(bZ,{id:exports.TestHelper.generateId(c,`palette-color-${i}`),"aria-label":`${r} brush`,$color:t,$colorScheme:n,onClick:()=>(e=>{G(),I(e)})(t),children:L===t&&e.jsx(_Z,{$colorScheme:n})},t)))})]}):e.jsxs(e.Fragment,{children:[e.jsx(NZ,{id:`${c}-image-thumbnails`,activeFileIndex:x,accepts:r,capture:i,maxFiles:l,images:_,onClickThumbnail:w,onSelectFile:P,multiple:m}),e.jsx(mZ,{id:exports.TestHelper.generateId(c,"save-button"),"data-testid":exports.TestHelper.generateId(c,"save-button"),onClick:U,disabled:F,children:"Save"})]})}),e.jsx(Qj,{images:_,show:C,onDecideClearDrawing:e=>{e&&R.current.clearDrawing(),N(null)},onDecideDelete:j,onDecideExit:e=>{e&&(v(_.filter((({addedFrom:e,status:t})=>t>=exports.EImageStatus.UPLOADED||t<exports.EImageStatus.NONE&&"dragInput"===e)).map((e=>({...e,drawingDataURL:void 0,drawing:void 0})))),f()),N(null)}})]}):e.jsx(e.Fragment,{})})})},kZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.260bcc27.js")})))),$Z=n=>{const{schema:{buttonLabel:r,capture:i,className:a,compress:o,crop:s,description:u,dimensions:c={width:1e3,height:1e3},editImage:l,label:d,outputType:f="jpg",uploadOnAddingFile:p,validation:h,multiple:m,imageReviewModalStyles:g,tooltip:y},id:_,isDirty:v,isTouched:b,value:E,warning:S,...A}=n,{images:x,setImages:w,currentFileIds:T}=t.useContext(jz),M=kk(x),[O,C]=t.useState([...Bz]),[N,D]=t.useState(0),[L,I]=t.useState(0),[k,$]=t.useState(!1),[R,F]=t.useState(!1),{setFieldValidationConfig:z}=Dk(),{dispatchFieldEvent:P}=yI(),j=Rk();t.useEffect((()=>{P("mount",_)}),[P,_]),t.useEffect((()=>{if(!v&&!b){const e=Array.isArray(E)?E:[];if(!(Iz(e.map((({fileId:e})=>e)),T).length>0))return;const t=[];e.forEach((({fileId:e,fileName:n,dataURL:r,uploadResponse:i},a)=>{const o={id:e||um(),file:{},name:n,dimensions:{width:10,height:10},dataURL:r,status:exports.EImageStatus.INJECTED,addedFrom:"schema",uploadProgress:100,slot:a,uploadResponse:i};t.push(o)})),w(t)}}),[v,b,T,w,E]),t.useEffect((()=>{const e=h?.find((e=>"required"in e)),t=h?.find((e=>"fileType"in e)),n=h?.find((e=>"maxSizeInKb"in e));t?.fileType&&t?.fileType!==O&&C(t?.fileType),n?.maxSizeInKb&&n?.maxSizeInKb!==L&&I(n?.maxSizeInKb);const r=h?.find((e=>"length"in e)),i=h?.find((e=>"max"in e));let a;r?a={maxFiles:r.length,errorMessage:r.errorMessage}:i&&(a={maxFiles:i.max,errorMessage:i.errorMessage}),a?.maxFiles&&N!==a.maxFiles&&D(a.maxFiles),z(_,tT().of(Qw().shape({fileName:zx(),dataURL:zx()})).test("is-empty-array",e?.errorMessage||om.UPLOAD("photo").REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",n?.errorMessage||om.UPLOAD("photo").MAX_FILE_SIZE(n?.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&n?.maxSizeInKb)||e.every((e=>exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*n?.maxSizeInKb)))),h)}),[h]),t.useEffect((()=>{x.some((e=>e.status===exports.EImageStatus.NONE))||(x.some(((e,t)=>{const n=M?.[t];if(e.status!==n?.status||e.dataURL!==n.dataURL)switch(e.status){case exports.EImageStatus.COMPRESSED:case exports.EImageStatus.CONVERTED:if(l&&!R)return j()?F(!0):$(!0),!0}})),0===x.length&&F(!1))}),[x.map((e=>e.status)).join(","),x.map((e=>e.dataURL)).join(",")]);const Z=(e=!1)=>{e?l&&(document.body.classList.remove("lifesg-ds-overlay-open"),F(!0)):w((e=>e.map((e=>e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE?{...e,status:exports.EImageStatus.UPLOAD_READY}:e)))),$(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(kZ,{accepts:O,compress:!!o,crop:!!s,dimensions:c,editImage:l,id:_,maxSizeInKb:L,outputType:f,upload:p,filenameMatches:h?.find((e=>"matches"in e))?.matches,filenameMatchesErrorMessage:h?.find((e=>"matches"in e))?.errorMessage,value:E})}),e.jsx(Vj,{id:_,capture:i,className:a,label:d,description:u,buttonLabel:r,accepts:O,maxFiles:N,maxSizeInKb:L,dimensions:c,errorMessage:A.error?.message,validation:h,multiple:m,warning:S,tooltip:y}),e.jsx(_T,{id:`${_}-review-prompt`,title:"Review photos?",size:"large",show:k,description:"This lets you check if you've selected the correct photos, and draw on them to highlight the issue.",buttons:[{id:"ok",title:"Ok",onClick:()=>Z(!0)},{id:"skip",title:"Skip",buttonStyle:"secondary",onClick:()=>Z()}]}),(()=>{const t=h?.find((e=>"max"in e));return e.jsx(IZ,{accepts:O,dimensions:c,id:_,className:a,maxFiles:N,maxFilesErrorMessage:t?.errorMessage,maxSizeInKb:L,onExit:()=>F(!1),outputType:f,show:R,multiple:m,capture:i,imageReviewModalStyles:g})})()]})},RZ=i.css`
|
|
1015
1015
|
border: ${n.Border["width-010"]} ${n.Border.solid} ${n.Colour["border-focus"]};
|
|
1016
1016
|
box-shadow: none;
|
|
1017
1017
|
`,FZ=i.css`
|
|
@@ -1090,7 +1090,7 @@ object-assign
|
|
|
1090
1090
|
${e=>i.css`
|
|
1091
1091
|
margin-left: ${e.$readOnly?n.Spacing["spacing-4"]:n.Spacing["spacing-12"]};
|
|
1092
1092
|
`}
|
|
1093
|
-
`,UZ=t=>{const{id:n,"data-testid":r,className:i,disabled:a,readOnly:o,onFocus:s,value:u,placeholder:c,error:l}=t;return e.jsxs(PZ,{id:n,"data-testid":r,type:"button",className:i,disabled:a,$readOnly:o,$error:l,onFocus:s,onClick:e=>{a||e.currentTarget.focus()},tabIndex:a?-1:0,"aria-disabled":a||void 0,"aria-haspopup":"dialog","aria-readonly":o,children:[c&&!u?e.jsx(jZ,{$placeholder:!0,$disabled:a,children:c}):e.jsx(jZ,{$disabled:a,children:u}),e.jsx(ZZ,{$disabled:a,$readOnly:o,"aria-hidden":"true",children:e.jsx(R.PinFillIcon,{})})]})},BZ=t=>{const{id:n,label:r,className:i,locationInputPlaceholder:a="",onFocus:o,value:s,errorMessage:u,disabled:c,readOnly:l}=t;return e.jsx(x.Form.CustomField,{id:exports.TestHelper.generateId(n,"location-input"),"data-testid":exports.TestHelper.generateId(n,"location-input"),label:r,errorMessage:u,children:e.jsx(UZ,{id:exports.TestHelper.generateId(n,"location-input-base"),"data-testid":exports.TestHelper.generateId(n,"location-input-base"),disabled:c,readOnly:l,placeholder:a,onFocus:o,value:s,error:!!u,className:i})})},VZ=t.lazy((()=>Promise.resolve().then((function(){return require("./location-modal.
|
|
1093
|
+
`,UZ=t=>{const{id:n,"data-testid":r,className:i,disabled:a,readOnly:o,onFocus:s,value:u,placeholder:c,error:l}=t;return e.jsxs(PZ,{id:n,"data-testid":r,type:"button",className:i,disabled:a,$readOnly:o,$error:l,onFocus:s,onClick:e=>{a||e.currentTarget.focus()},tabIndex:a?-1:0,"aria-disabled":a||void 0,"aria-haspopup":"dialog","aria-readonly":o,children:[c&&!u?e.jsx(jZ,{$placeholder:!0,$disabled:a,children:c}):e.jsx(jZ,{$disabled:a,children:u}),e.jsx(ZZ,{$disabled:a,$readOnly:o,"aria-hidden":"true",children:e.jsx(R.PinFillIcon,{})})]})},BZ=t=>{const{id:n,label:r,className:i,locationInputPlaceholder:a="",onFocus:o,value:s,errorMessage:u,disabled:c,readOnly:l}=t;return e.jsx(x.Form.CustomField,{id:exports.TestHelper.generateId(n,"location-input"),"data-testid":exports.TestHelper.generateId(n,"location-input"),label:r,errorMessage:u,children:e.jsx(UZ,{id:exports.TestHelper.generateId(n,"location-input-base"),"data-testid":exports.TestHelper.generateId(n,"location-input-base"),disabled:c,readOnly:l,placeholder:a,onFocus:o,value:s,error:!!u,className:i})})},VZ=t.lazy((()=>Promise.resolve().then((function(){return require("./location-modal.ff55a907.js")}))));class HZ extends Error{code;message;constructor(e){super(),Object.assign(this,e)}}var GZ;!function(e){e.IS_EMAIL_VALID="is-email-valid",e.IS_PHONE_NUMBER_VALID="is-phone-number-valid",e.SEND_OTP_FAILED="send-otp-failed",e.OTP_VERIFICATION_FAILED="otp-verification-failed",e.IS_OTP_VERIFIED="is-otp-verified",e.API_ERROR="api"}(GZ||(GZ={}));const YZ=V.default(r.Typography.BodyMD)`
|
|
1094
1094
|
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
1095
1095
|
`,WZ=V.default(z.RadioButton)`
|
|
1096
1096
|
margin-right: ${n.Spacing["spacing-4"]};
|
|
@@ -1126,7 +1126,7 @@ object-assign
|
|
|
1126
1126
|
gap: ${n.Spacing["spacing-16"]};
|
|
1127
1127
|
`,tU=V.default.div`
|
|
1128
1128
|
${({$color:e})=>e&&`color: ${e};`}
|
|
1129
|
-
`;var nU;exports.EFieldType=void 0,(nU=exports.EFieldType||(exports.EFieldType={})).BUTTON="ButtonField",nU.CHECKBOX="CheckboxGroup",nU.CHIPS="Chips",nU["CONTACT-FIELD"]="ContactField",nU["DATE-FIELD"]="DateField",nU["DATE-RANGE-FIELD"]="DateRangeField",nU["EMAIL-FIELD"]="TextField",nU["E-SIGNATURE-FIELD"]="ESignatureField",nU["ERROR-FIELD"]="ErrorField",nU["FILE-UPLOAD"]="FileUpload",nU["HIDDEN-FIELD"]="HiddenField",nU["HISTOGRAM-SLIDER"]="HistogramSlider",nU["IMAGE-UPLOAD"]="ImageUpload",nU["LOCATION-FIELD"]="LocationField",nU["MASKED-FIELD"]="MaskedField",nU["MULTI-SELECT"]="MultiSelect",nU["NESTED-MULTI-SELECT"]="NestedMultiSelect",nU["RANGE-SELECT"]="RangeSelect",nU["NUMERIC-FIELD"]="TextField",nU["OTP-VERIFICATION-FIELD"]="OtpVerificationField",nU.RADIO="RadioButtonGroup",nU.RESET="ResetButton",nU.SELECT="Select",nU["SELECT-HISTOGRAM"]="SelectHistogram",nU.SLIDER="Slider",nU.SUBMIT="SubmitButton",nU.SWITCH="Switch",nU.TEXTAREA="Textarea",nU["TEXT-FIELD"]="TextField",nU["TIME-FIELD"]="TimeField",nU["UNIT-NUMBER-FIELD"]="UnitNumberField";var rU=Object.freeze({__proto__:null,ButtonField:t=>{const{schema:{label:n,uiType:r,startIcon:i,endIcon:a,href:o,target:s,...u},id:c,...l}=t,{dispatchFieldEvent:d}=yI(),f=t=>{if(!t)return null;const n=H[t];return e.jsx(n,{})};return e.jsxs(m$,{type:"button",...u,...l,onClick:e=>{d("click",c,e),o&&(e=>{try{return!!new URL(e)}catch{return!1}})(o)&&(s?window.open(o,s,"noopener noreferrer"):window.location.href=o)},children:[f(i),n,f(a)]})},CheckboxGroup:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||[]),{setFieldValidationConfig:v}=Dk();t.useEffect((()=>{const e=f?.find((e=>"required"in e));v(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),f)}),[f]),ys((()=>{const e=h?.filter((e=>d.find((t=>t.value===e))));g(a,e)}),[d]),t.useEffect((()=>{_(h||[])}),[h]);const b=(e,t)=>{const n=d.find((e=>!0===e.none));let r=[...y];t?r=r.includes(e)?[]:[e]:r.includes(e)?r=$$(r,e,n?.value):(r.push(e),r=$$(r,n?.value)),o({target:{value:r}})},E=e=>y.includes(e),S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(uU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:r,errorMessage:i?.message,children:"toggle"===u?.styleType?d.length>0&&"toggle"===u.styleType&&e.jsx(P$,{$layoutType:u?.layoutType??"horizontal",className:s?`${s}-checkbox-container`:void 0,children:d.map(((t,n)=>{const r=S();return e.jsx(j$,{type:"checkbox","data-testid":exports.TestHelper.generateId(a,"toggle"),id:r,className:s,disabled:c??t.disabled,name:r,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(t.value),onChange:()=>b(t.value,t.none),error:!!i?.message,compositeSection:t.children?{children:e.jsx(uU,{children:t.children}),collapsible:!1}:null,subLabel:!!t.subLabel&&A(t.subLabel),children:A(t.label)},n)}))}):d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(z$,{className:s?`${s}-checkbox-container`:void 0,children:[e.jsx(F$,{...p,"data-testid":exports.TestHelper.generateId(a,"checkbox"),id:r,className:s,disabled:c??t.disabled,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx(R$,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}),e.jsx(YL,{id:a,message:m})]})},Chips:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{disabled:s,label:u,options:c,textarea:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||[]),[_,v]=t.useState(!1),[b,E]=t.useState(!0),{setValue:S,unregister:A}=xe(),{setFieldValidationConfig:w,removeFieldValidationConfig:T}=Dk();t.useEffect((()=>{_||A(O())}),[]),t.useEffect((()=>{const e=d?.find((e=>"required"in e)),t=d?.find((e=>"max"in e)),n=d?.find((e=>"length"in e));w(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),d),1!==t?.max&&1!==n?.length||E(!1)}),[d]),ys((()=>{const e=[...c.map((e=>e.value)),l?.label],t=p?.filter((t=>e.includes(t)));S(a,t)}),[c]),t.useEffect((()=>{p?.includes(C())?N(!0):N(),y(p||[])}),[p]);const M=e=>g.includes(e),O=()=>`${a}-textarea`,C=()=>"string"==typeof l?.label?l?.label:l?.label?.mainLabel,N=(e=!1)=>{v(e),e||T(O())},D=e=>{let t=[...g];if(t.includes(e))return t=t.filter((t=>t!==e)),void o({target:{value:t}});b?t.push(e):t=[e],o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsxs(x.Form.CustomField,{label:i,errorMessage:r?.message,...m,children:[e.jsxs(W$,{"data-testid":exports.TestHelper.generateId(a,"chips"),$showTextarea:_,children:[c.map(((e,n)=>t.createElement(uT,{...f,key:n,onClick:()=>D(e.value),isActive:M(e.value),disabled:s??e.disabled},e.label))),(()=>{if(!l?.label)return;const t=C();return e.jsx(uT,{...f,onClick:()=>{D(t)},isActive:M(t),children:t})})()]}),(()=>{if(!l?.label)return e.jsx(e.Fragment,{});const t=O(),n={uiType:"textarea",className:f.className?`${f.className}-textarea`:void 0,...l};return _?e.jsx(Z$,{id:t,schema:n,Field:Y$}):e.jsx(e.Fragment,{})})()]}),e.jsx(YL,{id:a,message:h})]})},ContactField:n=>{const{isDirty:r,formattedLabel:i,error:a,id:o,name:s,onChange:u,schema:{defaultCountry:c,disabled:l,enableSearch:d,label:f,placeholder:p,validation:h,...m},value:g,warning:y,..._}=n,{resetField:v}=xe(),[b,E]=t.useState(g||""),S=kk(c),[A,w]=t.useState(c),[T]=t.useState((()=>{const e=new Map;return q$.forEach((t=>{const[n,...r]=t,i=r.find((e=>/^\d+$/.test(e)));e.set(n,i)})),e})()),[M,O]=t.useState(),[C,N]=t.useState(),[D,L]=t.useState(void 0),{setFieldValidationConfig:I}=Dk();t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber,r=e?.errorMessage;T.has(n)?(w(n),L(!0)):["default","house","mobile"].includes(t)?(w("Singapore"),L(!0)):L(!1),N(t),I(o,zx().test("singaporeNumber",r||om.CONTACT.INVALID_SINGAPORE_NUMBER,(e=>!e||!t||ez.isSingaporeNumber(e,t))).test("internationalNumber",r||om.CONTACT.INVALID_INTERNATIONAL_NUMBER,(e=>!(e&&!t&&n)||ez.isInternationalNumber(M?.name,e))),h)}),[h,M]),t.useEffect((()=>{const e=A||"Singapore";O({name:e,prefix:T.get(e)})}),[A,T]),t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber;!c||S===c||T.has(n)||["default","house","mobile"].includes(t)||w(c)}),[h,c]),t.useEffect((()=>{if(void 0!==D&&!r){const{prefix:e,number:t}=ez.getParsedPhoneNumber(g||""),n=e.replace(/\+/g,""),r=(e=>{for(const[t,,,n]of q$)if(t===e)return n})(A||"Singapore");if(!D||D&&n===r){const n=k({countryCode:e||r,number:t});v(o,{defaultValue:n,keepDirty:!0})}else{const e=k({countryCode:"",number:""});v(o,{defaultValue:e,keepDirty:!0})}}}),[g,r,D,A]);const k=e=>{const{countryCode:t,number:n}=e,r=t.replace(/\+/g,"");if(!1===D&&r!==M?.prefix){const e=((e,t)=>{for(const[n,r]of t.entries())if(r===e)return n})(r,T);e&&O({name:e,prefix:t})}return E(n),ez.formatPhoneNumber(e.countryCode,e.number)||""};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.PhoneNumberInput,{...m,..._,"data-testid":exports.TestHelper.generateId(o,"contact"),disabled:l,enableSearch:d,errorMessage:a?.message,fixedCountry:D,id:o,label:i,name:s,placeholder:(()=>{if(p)return p;if(C){return`Enter ${"mobile"===C?"mobile":"home"} number`}return"Enter contact number"})(),value:(()=>{if(!M)return;const{prefix:e}=M;return{number:b,countryCode:e}})(),onChange:e=>{const t=k(e);u({target:{value:t}})}}),e.jsx(YL,{id:o,message:y})]})},DateField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{label:u,useCurrentDate:c,dateFormat:l=tz,validation:d,...f},value:p,warning:h,...m}=n,{setValue:g}=xe(),[y,_]=t.useState(p||""),[v,b]=t.useState(),{setFieldValidationConfig:E}=Dk();t.useEffect((()=>{const e=d?.find((e=>"dateFormat"in e&&e.dateFormat)),t=d?.find((e=>"future"in e)),n=d?.find((e=>"past"in e)),r=d?.find((e=>"notFuture"in e)),i=d?.find((e=>"notPast"in e)),o=d?.find((e=>"minDate"in e)),s=d?.find((e=>"maxDate"in e)),u=d?.find((e=>"excludedDates"in e)),c=d?.find((e=>"withinDays"in e)),f=d?.find((e=>"beyondDays"in e)),p=sm.toLocalDateOrTime(o?.minDate,l,"date"),h=sm.toLocalDateOrTime(s?.maxDate,l,"date");E(a,zx().test("is-date",e?.errorMessage||om.DATE.INVALID,(e=>!e||""===e||!!w(e)&&!!sm.toLocalDateOrTime(e,l,"date"))).test("future",t?.errorMessage||om.DATE.MUST_BE_FUTURE,(e=>{if(!w(e)||!t?.future)return!0;const n=sm.toLocalDateOrTime(e,l,"date");return!!n?.isAfter(bf.now())})).test("past",n?.errorMessage||om.DATE.MUST_BE_PAST,(e=>{if(!w(e)||!n?.past)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!!t?.isBefore(bf.now())})).test("not-future",r?.errorMessage||om.DATE.CANNOT_BE_FUTURE,(e=>{if(!w(e)||!r?.notFuture)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(bf.now())})).test("not-past",i?.errorMessage||om.DATE.CANNOT_BE_PAST,(e=>{if(!w(e)||!i?.notPast)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(bf.now())})).test("min-date",o?.errorMessage||om.DATE.MIN_DATE(sm.formatDateTime(o?.minDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!p)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(p)})).test("max-date",s?.errorMessage||om.DATE.MAX_DATE(sm.formatDateTime(s?.maxDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!h)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(h)})).test("excluded-dates",u?.errorMessage||om.DATE.DISABLED_DATES,(e=>!w(e)||!u||!u.excludedDates.includes(e))).test("within-days",c?.errorMessage||c?.withinDays&&om.DATE.WITHIN_DAYS(c?.withinDays),(e=>!w(e)||!c||sm.checkWithinDays(e,{...c.withinDays,dateFormat:l}))).test("beyond-days",f?.errorMessage||f?.beyondDays&&om.DATE.BEYOND_DAYS(f?.beyondDays),(e=>!w(e)||!f||sm.checkBeyondDays(e,{...f.beyondDays,dateFormat:l}))),d);const m=c?.withinDays&&sm.calculateDisabledWithinDaysRange({...c.withinDays,dateFormat:l}),g=f?.beyondDays&&sm.calculateDisabledBeyondDaysRange({...f.beyondDays,dateFormat:l}),y=A([p,t?.future&&bf.now().plusDays(1),i?.notPast&&bf.now(),m?.startDate,g?.startDate]),_=S([h,n?.past&&bf.now().minusDays(1),r?.notFuture&&bf.now(),m?.endDate,g?.endDate]),v=[...u?.excludedDates||[]];(y||_||v)&&b((e=>({...e,minDate:y?.format(nz),maxDate:_?.format(nz),disabledDates:v})))}),[d]),t.useEffect((()=>{if(l)if(p)if(w(p)){const e=sm.toLocalDateOrTime(p,l,"date");_(sm.formatDateTime(e?.toString(),tz,"date",om.DATE.INVALID))}else _(om.DATE.INVALID);else if(!o)if(c){const e=sm.formatDateTime(bf.now().toString(),l,"date");g(a,e);const t=sm.formatDateTime(bf.now().toString(),tz,"date");_(t)}else _(void 0)}),[c,p,l,o]);const S=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],A=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],w=e=>e&&e!==om.DATE.INVALID;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateInput,{...f,...m,...v,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:e=>{s({target:{value:sm.formatDateTime(e,l,"date",om.DATE.INVALID)}})},value:y}),e.jsx(YL,{id:a,message:h})]})},DateRangeField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{dateFormat:u=iz,label:c,validation:l,variant:d,...f},value:p={from:void 0,to:void 0},warning:h,...m}=n,[g,y]=t.useState(p.from||""),[_,v]=t.useState(p.to||""),[b,E]=t.useState(),{setFieldValidationConfig:S}=Dk(),[A,w]=t.useState([]);ys((()=>{S(a,Qw().shape({from:zx(),to:zx()}).test({name:"is-empty-string",test(e,t){w(t.schema.describe().meta?.rules??[]);const n=N(t.schema.describe().meta?.rules,"required");if(!e||!n)return!0;return!!(e.from?.length>0&&e.to?.length>0)||t.createError({message:n?.errorMessage??om.DATE_RANGE.REQUIRED})}}).test({name:"is-date",test(e,t){const n=l?.find((e=>!!e&&"dateFormat"in e&&e.dateFormat));if(FL.exports.isEmpty(e?.from)||FL.exports.isEmpty(e?.to))return!0;return!(!O(e.from)||!O(e.to)||!sm.toLocalDateOrTime(e.from,u,"date")||!sm.toLocalDateOrTime(e.to,u,"date"))||t.createError({message:n?.errorMessage||om.DATE_RANGE.INVALID})}}).test({name:"number-of-days",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"numberOfDays"),r=n?.numberOfDays;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date");return!!sm.toLocalDateOrTime(e.to,u,"date").equals(i.plusDays(r-1))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_HAVE_NUMBER_OF_DAYS(r)})}}).test({name:"future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"future");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isAfter(bf.now())||!i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_FUTURE})}}).test({name:"past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"past");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isBefore(bf.now())||!i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_PAST})}}).test({name:"not-future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notFuture");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isAfter(bf.now())||i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_FUTURE})}}).test({name:"not-past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notPast");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isBefore(bf.now())||i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_PAST})}}).test({name:"min-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"minDate"),r=n?.minDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isBefore(i)||o?.isBefore(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MIN_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"max-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"maxDate"),r=n?.maxDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isAfter(i)||o?.isAfter(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MAX_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"excluded-dates",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"excludedDates"),r=n?.excludedDates;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date"),a=sm.toLocalDateOrTime(e.to,u,"date");try{const e=r.map((e=>sm.toLocalDateOrTime(e,u,"date")));for(const r of e)if(i.isEqual(r)||a.isEqual(r))return t.createError({message:n?.errorMessage??om.DATE_RANGE.DISABLED_DATES});return!0}catch{return!1}}}),l);const e=N(A,"future"),t=N(A,"past"),n=N(A,"notFuture"),r=N(A,"notPast"),i=N(A,"minDate"),o=N(A,"maxDate"),s=N(A,"excludedDates"),c=N(A,"numberOfDays"),f=sm.toLocalDateOrTime(i?.minDate,u,"date"),p=sm.toLocalDateOrTime(o?.maxDate,u,"date"),h=M([f,e?.future&&bf.now().plusDays(1),r?.notPast&&bf.now()]),m=T([p,t?.past&&bf.now().minusDays(1),n?.notFuture&&bf.now()]),g=s?.excludedDates,y=c?.numberOfDays;E((e=>({...e,minDate:h?.format(az),maxDate:m?.format(az),disabledDates:g,numberOfDays:y})))}),[l,A]),t.useEffect((()=>{C(rz.START)}),[p.from,u,o]),t.useEffect((()=>{C(rz.END)}),[p.to,u,o]);const T=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],M=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],O=e=>e&&e!==om.DATE_RANGE.INVALID,C=e=>{const t=e===rz.START?p.from:p.to,n=e===rz.START?y:v;if(u)if(t)if(O(t)){const e=sm.toLocalDateOrTime(t,u,"date");n(sm.formatDateTime(e?.toString(),iz,"date",om.DATE_RANGE.INVALID))}else n(om.DATE_RANGE.INVALID);else o||n(void 0)},N=(e,t)=>{const n=e?.find((e=>t in e)),r=l?.find((e=>!!e&&t in e));return FL.exports.isEmpty(n)?FL.exports.isEmpty(r)?void 0:r:n};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateRangeInput,{...f,...m,...b,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:(e,t)=>{s({target:{value:{from:sm.formatDateTime(e,u,"date",om.DATE_RANGE.INVALID),to:sm.formatDateTime(t,u,"date",om.DATE_RANGE.INVALID)}}})},value:g,valueEnd:_,variant:d}),e.jsx(YL,{id:a,message:h})]})},get TDateRangeInputType(){return rz},ESignatureField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,uiType:u,upload:c,validation:l,...d},value:f,warning:p}=n,[h,m]=t.useState(null),[g,y]=t.useState(0),[_,v]=t.useState(0),[b,E]=t.useState(null),{setFieldValidationConfig:S}=Dk(),A=t.useRef(null),{clearErrors:w}=xe();t.useEffect((()=>{const e=l?.find((e=>"upload"in e&&e.upload));A.current=e,S(a,Qw().shape({fileId:zx().required(),dataURL:zx(),fileUrl:zx(),uploadResponse:Cx().nullable()}).default(void 0),l)}),[l]),t.useEffect((()=>{if(v(0),M(f)){if(f.dataURL)m(f.dataURL);else if(f.fileUrl){const e=C(f.fileId,f.fileUrl);return()=>e.abort()}}else m(null)}),[f]);const T=async e=>{if(!e)return m(null),v(0),y(0),E(null),void o({target:{value:null}});const t=um();if(m(e),v(0),dE(c))o({target:{value:{fileId:t,dataURL:e}}});else try{const n=await O(t,e);o({target:{value:{fileId:t,..."base64"===c.type&&{dataURL:e},fileUrl:n?.data?.fileUrl,uploadResponse:n}}}),w(a),y(0)}catch(e){y((e=>e+1)),E(null)}},M=e=>!!e,O=async(e,t)=>{E(0);const n=new FormData;if(n.append("fileId",e),c.sessionId&&n.append("sessionId",c.sessionId),"base64"===c.type)n.append("dataURL",t);else if("multipart"===c.type){const r=await exports.FileHelper.dataUrlToBlob(t),i=exports.FileHelper.blobToFile(r,{name:e,lastModified:Date.now()});n.append("file",i,e)}const r=await new fl("",void 0,void 0,!0).post(c.url,n,{headers:{"Content-Type":"base64"===c.type?"application/json":"multipart/form-data",...c.headers},onUploadProgress:e=>{const{loaded:t,total:n}=e;E(t/n)}});return E(null),r},C=(e,t)=>{const n=new AbortController;return(async()=>{try{const r=await new fl("",void 0,void 0,!1,{responseType:"blob"}).get(t,{signal:n.signal}),i=await exports.FileHelper.getType(new File([r],e)),a=new File([r],e,{type:i.mime}),o=await exports.FileHelper.fileToDataUrl(a);m(o),v(0)}catch(e){if(e instanceof Kc)return;v((e=>e+1))}})(),n};return e.jsxs(oz,{children:[e.jsx(x.Form.ESignature,{...d,id:a,label:i,onChange:T,value:h,...null!==b&&{loadingProgress:b}}),(r?.message||g||_)&&null===b?g>0?e.jsxs(sz,{children:[A.current?.errorMessage||om.ESIGNATURE.UPLOAD,e.jsx(uz,{type:"button",onClick:()=>T(h),children:"Please try again."}),g>=3&&e.jsx(cz,{type:"warning","data-testid":"upload-refresh-alert",children:"Refresh this page if you cannot upload your signature."})]}):_>0&&M(f)?e.jsxs(sz,{children:["Failed to load.",e.jsx(uz,{type:"button",onClick:()=>C(f.fileId,f.fileUrl),children:"Please try again."}),_>=3&&e.jsx(cz,{type:"warning","data-testid":"load-refresh-alert",children:"Refresh this page if your signature failed to load."})]}):e.jsx(sz,{children:r?.message}):null,e.jsx(YL,{id:a,message:p})]})},ErrorField:n=>{const{id:r,schema:{children:i}}=n,{setFieldValidationConfig:a}=Dk();return t.useEffect((()=>{a(r,Cx().test((()=>!1)),[])}),[]),i?e.jsx(uU,{children:i}):null},FileUploadInner:Pz,FileUpload:t=>e.jsx($z,{children:e.jsx(Pz,{...t})}),get EFileStatus(){return exports.EFileStatus},HiddenField:n=>{const{id:r,name:i,onBlur:a,onChange:o,schema:{showIf:s,uiType:u,validation:c,valueType:l,value:d,...f},value:p}=n,{setFieldValidationConfig:h}=Dk(),{setValue:m}=xe();return t.useEffect((()=>{let e;switch(l){case"null":e=Cx();break;case"number":e=jx();break;case"boolean":e=Dx();break;default:e=zx()}h(r,e,c)}),[c,l]),t.useEffect((()=>{"null"===l&&null!==p?m(r,null):hE(d)||p===d||m(r,d)}),[m,r,l,d,p]),e.jsx("input",{onBlur:a,onChange:o,...f,type:"hidden",id:r,"data-testid":r,name:i,value:d??p??""})},HistogramSlider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,bins:u,interval:c,validation:l,disabled:d,readOnly:f,className:p,ariaLabels:h,customOptions:m},value:g,warning:y}=n,{resetField:_}=xe(),[v,b]=t.useState(void 0),{setFieldValidationConfig:E}=Dk();t.useEffect((()=>{if(g)b([g.from,g.to]);else{const e=Math.min(...u.map((e=>e.minValue))),t=Math.max(...u.map((e=>e.minValue)))+c;_(a,{defaultValue:{from:e,to:t},keepDirty:!0}),b([e,t])}}),[g]),t.useEffect((()=>{const e=l?.find((e=>"required"in e)),t=l?.find((e=>"bin"in e&&e.bin)),n=l?.find((e=>"incremental"in e&&e.incremental)),r=l?.find((e=>"withinRange"in e&&e.withinRange));E(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue)));return Number.isInteger((t-r)/c)&&Number.isInteger((n-r)/c)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue))),i=Math.max(...u.map((e=>e.minValue)))+c;return!(t<r||n>i)})),l)}),[l,u,c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.HistogramSlider,{...m,id:a,"data-testid":exports.TestHelper.generateId(a,"histogram-slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},value:v,bins:u,interval:c,disabled:d,readOnly:f,className:p,ariaLabels:h}),e.jsx(YL,{id:a,message:y})]})},ImageUploadInner:$Z,ImageUpload:t=>e.jsx(Zz,{children:e.jsx($Z,{...t})}),ACCEPTED_FILE_TYPES:Bz,get EImageStatus(){return exports.EImageStatus},LocationField:n=>{const{error:r,formattedLabel:i,id:o,schema:{className:s="location",mapApi:u,disabled:c,gettingCurrentLocationFetchMessage:l,interactiveMapPinIconUrl:d,label:f,locationInputPlaceholder:p,locationListTitle:h,locationModalStyles:m,mapBannerText:g,mapPanZoom:y,mustHavePostalCode:_,readOnly:v,staticMapPinColor:b,validation:E,hasExplicitEdit:S,locationSelectionMode:A="default",disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O,legendItems:C},value:N,warning:D}=n,[L,I]=t.useState(!1),{setValue:k}=xe(),{setFieldValidationConfig:$}=Dk(),{dispatchFieldEvent:R,addFieldEventListener:F,removeFieldEventListener:z}=yI();t.useEffect((()=>(F("show-location-modal",o,Z),R("show-location-modal-ready",o),()=>{z("show-location-modal",o,Z)})),[]),t.useEffect((()=>{const e=E?.find((e=>"required"in e)),t=E?.find((e=>"postalCode"in e));$(o,Qw({address:zx(),blockNo:zx(),building:zx(),lat:jx(),lng:jx(),postalCode:zx(),roadName:zx(),x:jx(),y:jx()}).test("is-required",e?.errorMessage||om.COMMON.FIELD_REQUIRED,(t=>!e?.required||!!t&&!!t.lat&&!!t.lng)).test("must-have-postal-code",t?.errorMessage||om.LOCATION.MUST_HAVE_POSTAL_CODE,(t=>!e||!_||exports.LocationHelper.hasGotAddressValue(t.postalCode))),E)}),[E]);const P=(e,t=!0)=>{k(o,e,{shouldDirty:t})},j=()=>{v||c||(I(!0),R("show-location-modal",o))},Z=()=>{I(!0)};return e.jsxs("div",{id:o,"data-testid":exports.TestHelper.generateId(o),className:s,children:[e.jsx(BZ,{id:o,label:i,className:s,locationInputPlaceholder:p,onChange:e=>e.currentTarget.blur(),onFocus:j,value:N?.address||"",errorMessage:r?.message,disabled:"explicit"===S&&!!N?.address||c,readOnly:v}),S&&N?.address&&e.jsx(a.Button.Default,{id:exports.TestHelper.generateId(o,"edit-button"),"data-testid":exports.TestHelper.generateId(o,"edit-button"),styleType:"secondary",onClick:()=>{!R("click-edit-button",o)||I(!0)},type:"button",children:"Edit"}),!!N?.lat&&!!N?.lng&&e.jsx(GL,{id:o,className:`${s}-static-map`,lat:N.lat,lng:N.lng,staticMapPinColor:b,onClick:j,disabled:c}),e.jsx(t.Suspense,{fallback:null,children:VZ&&e.jsx(VZ,{id:o,className:s,showLocationModal:L,onClose:()=>{I(!1),R("hide-location-modal",o)},formValues:N,onConfirm:P,updateFormValues:P,mapPanZoom:y,mapApi:u,interactiveMapPinIconUrl:d,gettingCurrentLocationFetchMessage:l,mustHavePostalCode:_,locationModalStyles:m,locationListTitle:h,mapBannerText:g,locationSelectionMode:A,disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O,legendItems:C})}),e.jsx(YL,{id:o,message:D})]})},GeolocationPositionErrorWrapper:HZ,MaskedField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:{label:u,uiType:c,validation:l,maskRegex:d,iconMask:f,iconUnmask:p,...h},warning:m,...g}=n,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Dk();t.useEffect((()=>{E(a,zx(),l);const e=l?.find((e=>"max"in e)),t=l?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n)}),[l]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]);const S=t=>{if(!t)return;const n=H[t];return e.jsx(n,{"data-testid":t})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MaskedInput,{...h,...g,...v,id:a,"data-testid":exports.TestHelper.generateId(a,c),label:i,onChange:e=>{o(e)},value:y,errorMessage:r?.message,maskRegex:(()=>{if(d)try{const e=d.match(/\/(.*)\/([a-z]+)?/);return new RegExp(e[1],e[2])}catch(e){console.warn(`invalid regex pattern: ${d}`)}})(),iconMask:S(f),iconUnmask:S(p)}),e.jsx(YL,{id:a,message:m})]})},MultiSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u=[],validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||[]),{setFieldValidationConfig:y}=Dk();t.useEffect((()=>{const e=c?.find((e=>"required"in e));y(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),c)}),[c]),_s((()=>{const e=d?.filter((e=>u.find((t=>t.value===e))));h(a,e)}),[u]),t.useEffect((()=>{g(d||[])}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MultiSelect,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOptions:e=>{const t=e.map((e=>e.value));o({target:{value:t}})},selectedOptions:u.filter((e=>m.includes(e.value))),valueExtractor:e=>e.value,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},OtpVerificationField:n=>{const{error:r,id:i,value:a,formattedLabel:o,onChange:s,warning:u,schema:{validation:c,request:l,verification:d,withPrefix:f,verifyOtpCountdownTimer:p,prefixSeparator:h,type:m,...g}}=n,[y,_]=t.useState(a?.otpCode||""),[v,b]=t.useState(a?.otpPrefix),E=t.useRef(a?.transactionId),S=t.useRef(-1),A=t.useRef(-1),w=a?.state||"default",T=a?.contact||"",M={number:"phone-number"===m?T:"",countryCode:"+65"},O=c?.find((e=>"otp-type"in e)),C=c?.find((e=>"required"in e)),{setFieldValidationConfig:N}=Dk(),{formState:D,setError:L,clearErrors:I}=xe(),{submitCount:k}=D;t.useEffect((()=>{N(i,Qw().test(GZ.IS_OTP_VERIFIED,C?.errorMessage||R(),(e=>!C?.required||"verified"===e?.state)),c)}),[c,w]);const $=async()=>{const e=O?.["otp-type"]??void 0;if("email"===e&&(t=T,!zx().required().email().isValidSync(t)))throw L(i,{type:GZ.IS_EMAIL_VALID,message:O?.errorMessage||om.OTP_VERIFICATION.INVALID_EMAIL}),new Error;var t;const n=`${M.countryCode}${M.number}`;if("phone-number"===e&&!(e=>ez.isSingaporeNumber(e))(n))throw L(i,{type:GZ.IS_PHONE_NUMBER_VALID,message:O?.errorMessage||om.OTP_VERIFICATION.INVALID_PHONE}),new Error;const r={type:m,..."email"===m?{email:T}:{phoneNo:n},...void 0!==f&&{withPrefix:f}},a=await new fl("",void 0,void 0,!0).post(l.endpoint.url,r).catch((e=>{const t=e?.message||om.OTP_VERIFICATION.SEND_OTP_FAILED;throw L(i,{type:GZ.SEND_OTP_FAILED,message:t}),new Error(t)})),o=a?.transactionId??a?.data?.transactionId,u=a?.prefix??a?.data?.prefix;E.current=o,u&&b(u),I(i),S.current=k,s({target:{value:{contact:"email"===e?T:M.number,otpPrefix:u??v,type:m,state:"sent"}}})},R=()=>"default"===w?"email"===m?om.OTP_VERIFICATION.EMAIL_VERIFICATION_REQUIRED:om.OTP_VERIFICATION.PHONE_VERIFICATION_REQUIRED:"sent"===w?om.OTP_VERIFICATION.OTP_REQUIRED:void 0,F={...g,id:i,"data-testid":exports.TestHelper.generateId(i,"otp-verification-field"),label:o,otpState:w,onOtpStateChange:e=>{"default"===e&&(_(""),b(void 0),E.current=void 0,s({target:{value:{...a,state:void 0,additionalData:void 0,otpPrefix:void 0}}}))},onSendOtp:$,onResendOtp:$,onVerifyOtp:async e=>{const t="email"===m?T:M.number,n=await new fl("",void 0,void 0,!0).post(d.endpoint.url,{transactionId:E.current,otp:e,otpPrefix:v}).catch((e=>{const t=e?.message||om.OTP_VERIFICATION.OTP_VERIFICATION_FAILED;throw L(i,{type:GZ.OTP_VERIFICATION_FAILED,message:t}),new Error(t)}));s({target:{value:{contact:t,otpPrefix:v,type:m,state:"verified",additionalData:n?.additionalData??n?.data?.additionalData}}})},sendOtpError:(()=>{if("sent"===w)return;if(r?.type===GZ.IS_EMAIL_VALID||r?.type===GZ.IS_PHONE_NUMBER_VALID||r?.type===GZ.SEND_OTP_FAILED)return r?.message;return D.isSubmitted&&k>A.current&&r?.type===GZ.IS_OTP_VERIFIED?r?.message:void 0})(),verifyOtpError:(()=>{if("sent"!==w)return;return r?.type===GZ.IS_OTP_VERIFIED&&k>S.current||r?.type===GZ.OTP_VERIFICATION_FAILED||r?.type===GZ.API_ERROR?r?.message:void 0})(),otpValue:{value:y,...v&&{prefix:v},...h&&{prefixSeparator:h}},onOtpChange:e=>{I(i),_(e)},...void 0!==l.placeholder&&{sendOtpPlaceholder:l.placeholder},...void 0!==p&&{verifyOtpCountdownTimer:p},...void 0!==d.showThumbnail&&{showVerifyOtpThumbnail:d.showThumbnail},...void 0!==d.title&&{verifyOtpTitle:d.title},...void 0!==d.message&&{verifyOtpMessage:d.message}};return e.jsxs(e.Fragment,{children:["email"===m?e.jsx(x.Form.OtpVerification,{...F,type:"email",emailValue:T,onEmailChange:e=>{A.current=k,I(i),s({target:{value:{...a,contact:e}}})}}):e.jsx(x.Form.OtpVerification,{...F,type:"phone-number",phoneNumberValue:M,onPhoneNumberChange:e=>{A.current=k,I(i);let t=e.number;e.number||(t=""),s({target:{value:{...a,contact:t}}})},fixedCountry:!0}),e.jsx(YL,{id:i,message:u})]})},get EOtpVerificationErrorType(){return GZ},NestedMultiSelect:n=>{const{schema:{label:r,validation:i,options:a=[],...o},id:s,value:u,formattedLabel:c,onChange:l,onBlur:d,error:f,warning:p,...h}=n,{setValue:m}=xe(),{setFieldValidationConfig:g}=Dk(),[y,_]=t.useState(u),[v,b]=t.useState([]),E=t.useCallback((e=>{const t=[],n=(e,r)=>{for(const i in e){const a=[...r,i],o=e[i];"string"==typeof o?t.push(a):n(o,a)}};return n(e,[]),t}),[]);t.useEffect((()=>{const e=i?.find((e=>"required"in e));g(s,Qw().test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!e?.required||!!t&&!!Object.keys(t).length)),i)}),[i]),_s((()=>{const e=(t,n)=>{const r={};for(const i of t){const{key:t,subItems:a}=i,o=n[t];if(o){const n="string"==typeof o?o:e(a||[],o);Object.keys(n).length?r[t]=n:delete r[t]}}return r},t=u?e(a,u):u;m(s,t)}),[a]),t.useEffect((()=>{_(u);const e=E(u);b(e)}),[E,y,u]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.NestedMultiSelect,{...o,...h,id:s,"data-testid":exports.TestHelper.generateId(s),label:c,options:a,onSelectOptions:(e,t)=>{const n=((e,t)=>{const n={};return e.forEach(((e,r)=>{e.reduce(((n,i,a)=>(a===e.length-1?n[i]=t[r]:n[i]||(n[i]={}),n[i])),n)})),n})(e,t);l({target:{value:n}})},onBlur:d,selectedKeyPaths:v,errorMessage:f?.message}),e.jsx(YL,{id:s,message:p})]})},RadioButtonGroup:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||""),{setFieldValidationConfig:v}=Dk();t.useEffect((()=>{v(a,zx(),f)}),[f]),ys((()=>{d.find((e=>e.value===h))||g(a,"")}),[d]),t.useEffect((()=>{_(h||"")}),[h]);const b=e=>{o({target:{value:e}})},E=e=>y===e,S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(uU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:(()=>{switch(u?.styleType){case"toggle":return d.length>0&&"toggle"===u.styleType&&e.jsx(XZ,{className:s?`${s} ${s}-radio-container`:void 0,$layoutType:u?.layoutType??"horizontal",children:d.map(((n,i)=>{const o=S();return t.createElement(QZ,{...p,key:i,type:"radio",id:o,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??n.disabled,name:o,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(n.value),onChange:()=>b(n.value),error:!!r?.message,compositeSection:n.children?{children:e.jsx(uU,{children:n.children}),collapsible:!1}:null,subLabel:!!n.subLabel&&A(n.subLabel)},A(n.label))}))});case"image-button":return d.length>0&&e.jsx(JZ,{className:s?`${s} ${s}-radio-container`:void 0,children:d.map(((e,n)=>{const i=S();return t.createElement(qZ,{...p,type:"button",key:n,id:i,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??e.disabled,name:i,selected:E(e.value),onClick:()=>b(e.value),imgSrc:e.imgSrc,error:!!r?.message},e.label)}))});default:return d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(KZ,{className:s?`${s}-radio-container`:void 0,children:[e.jsx(WZ,{...p,className:s,id:r,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??t.disabled,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx(YZ,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}})()}),e.jsx(YL,{id:a,message:m})]})},RangeSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d={from:void 0,to:void 0},warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d.from||""),[y,_]=t.useState(d.to||""),{setFieldValidationConfig:v}=Dk(),b=t.useRef(!1);t.useEffect((()=>{const e=c?.find((e=>"required"in e));v(a,Qw().shape({from:zx(),to:zx()}).test("is-empty-string",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e?.required||t.from?.length>0&&t.to?.length>0)),c)}),[c]),ys((()=>{const e={};u.from.find((e=>e.value===d.from))||(e.from=""),u.to.find((e=>e.value===d.to))||(e.to=""),h(a,{...d,...e})}),[u]),t.useEffect((()=>{_(d.from),g(d.to)}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.RangeSelect,{...l,...p,id:a,onHideOptions:()=>{b.current?b.current=!1:d.from&&d.to||o({target:{value:{from:void 0,to:void 0}}})},"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOption:e=>{void 0===e.from&&void 0===e.to&&o({target:{value:{from:void 0,to:void 0}}}),e.from&&o({target:{value:{from:e.from.value,to:void 0}}}),e.to&&(b.current=!0,o({target:{value:{to:e.to.value,from:y}}}))},selectedOptions:{from:u.from.find((({value:e})=>e===y)),to:u.to.find((({value:e})=>e===m))},valueToStringFunction:e=>`${e.from} - ${e.to}`,valueExtractor:e=>({from:e.value,to:e.value}),displayValueExtractor:e=>e.label,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},ResetButton:t=>{const{id:n,schema:{disabled:r,ignoreDefaultValues:i,label:o,...s},...u}=t,{reset:c,getValues:l}=xe(),{resetFields:d}=Nk(),{formSchema:{defaultValues:f}}=Ck();return e.jsx(a.Button.Default,{...s,...u,disabled:r,"data-testid":n,id:n,type:"reset",onClick:()=>{if(i){const e=l();Object.entries(e).forEach((([t,n])=>{Hr(n)?e[t]=[]:o$(n)||iI(n)?e[t]="":Rr(n)&&(e[t]={})})),c(e),d(e)}else c(),d(f)},children:o})},Select:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||""),{setFieldValidationConfig:y}=Dk();t.useEffect((()=>{y(a,zx(),c)}),[c]),ys((()=>{u.find((e=>e.value===d))||h(a,"")}),[u]),t.useEffect((()=>{g(d||"")}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Select,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a,"select"),label:i,errorMessage:r?.message,options:u,onSelectOption:(e,t)=>{o({target:{value:t}})},selectedOption:u.find((({value:e})=>e===m)),displayValueExtractor:e=>e.label,valueExtractor:e=>e.value,listExtractor:e=>e.label}),e.jsx(YL,{id:a,message:f})]})},SelectHistogram:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,validation:u,disabled:c,readOnly:l,className:d,histogramSlider:f,customOptions:p},value:h,warning:m,...g}=n,{bins:y,interval:_,...v}=f,{resetField:b}=xe(),[E,S]=t.useState([0,0]),{setFieldValidationConfig:A}=Dk();t.useEffect((()=>{if(h)S([h.from,h.to]);else{const e=Math.min(...y.map((e=>e.minValue))),t=Math.max(...y.map((e=>e.minValue)))+_;b(a,{defaultValue:{from:e,to:t},keepDirty:!0}),S([e,t])}}),[h]),t.useEffect((()=>{const e=u?.find((e=>"required"in e)),t=u?.find((e=>"bin"in e&&e.bin)),n=u?.find((e=>"incremental"in e&&e.incremental)),r=u?.find((e=>"withinRange"in e&&e.withinRange));A(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue)));return Number.isInteger((t-r)/_)&&Number.isInteger((n-r)/_)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue))),i=Math.max(...y.map((e=>e.minValue)))+_;return!(t<r||n>i)})),u)}),[u,y,_]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.SelectHistogram,{...g,id:a,"data-testid":exports.TestHelper.generateId(a,"select-histogram"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},disabled:c,readOnly:l,className:d,rangeLabelPrefix:p?.rangeLabelPrefix,rangeLabelSuffix:p?.rangeLabelSuffix,value:E,histogramSlider:{bins:y,interval:_,...v}}),e.jsx(YL,{id:a,message:m})]})},Slider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,customOptions:u,validation:c,disabled:l,readOnly:d,className:f,ariaLabel:p},value:h,warning:m}=n,[g,y]=t.useState(),{setFieldValidationConfig:_}=Dk();t.useEffect((()=>{const e=c?.find((e=>"min"in e)),t=c?.find((e=>"max"in e)),n=c?.find((e=>"increment"in e));_(a,jx().test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(t=>{if("number"!=typeof t||!n)return!0;const r=n.increment,i=(e?.min??0)-t;return Number.isInteger(i/r)})),c),(e||t||n)&&y({min:e?.min,max:t?.max,step:n?.increment})}),[c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Slider,{...u,...g,id:a,"data-testid":exports.TestHelper.generateId(a,"slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{o({target:{value:e}})},value:h,disabled:l,readOnly:d,className:f,ariaLabel:p}),e.jsx(YL,{id:a,message:m})]})},SubmitButton:n=>{const{id:r,schema:{disabled:i,label:o,...s},...u}=n,{submitHandler:c,wrapInForm:l}=Lk(),{setFieldValidationConfig:d}=Dk(),{hardValidationSchema:f}=$k(),p=$e({disabled:"invalid-form"!==i}),[h,m]=t.useState(!0===i);t.useEffect((()=>{d(r,Cx())}),[]),t.useEffect((()=>{"invalid-form"!==i&&m(!!i)}),[i]),ys((()=>{(async()=>{if("invalid-form"===i)try{await f.validate(p),m(!1)}catch(e){m(!0)}})()}),[p,f]);return e.jsx(a.Button.Default,{...s,...u,disabled:h,"data-testid":r,id:r,onClick:e=>{l||(e.preventDefault(),c?.())},type:"submit",children:o})},Switch:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,validation:d,...f},value:p,warning:h}=n,[m,g]=t.useState(p||void 0),{setFieldValidationConfig:y}=Dk();t.useEffect((()=>{y(a,Dx().strict(),d)}),[d]),t.useEffect((()=>{g(p)}),[p]);const _=e=>{o({target:{value:e}})},v=e=>m===e,b=e=>`${a}-${e}`;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:e.jsxs(eU,{className:s,role:"radiogroup","aria-label":"string"==typeof l?l:$L(l.mainLabel,{allowedTags:[]}),children:[e.jsx(T.Toggle,{...f,type:"yes",id:b("yes"),"data-testid":exports.TestHelper.generateId(a,"switch-yes"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!0),onChange:()=>_(!0),indicator:!0,name:a,error:!!r?.message,children:"Yes"}),e.jsx(T.Toggle,{...f,type:"no",id:b("no"),"data-testid":exports.TestHelper.generateId(a,"switch-no"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!1),onChange:()=>_(!1),indicator:!0,name:a,error:!!r?.message,children:"No"})]})}),e.jsx(YL,{id:a,message:h})]})},TextField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:u,warning:c,...l}=n,{customOptions:d,inputMode:f,label:p,uiType:h,validation:m,...g}=u,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Dk(),S=t.useRef(null),A=t.useRef(0);t.useEffect((()=>{switch(h){case"numeric-field":{E(a,jx(),m);const e=m?.find((e=>"min"in e)),t=m?.find((e=>"max"in e)),n={...v};e?.min>0&&(n.min=e.min),t?.max>0&&(n.max=t.max),b(n);break}case"email-field":{const e=m?.find((e=>e.email));E(a,zx().email(e?.errorMessage||om.EMAIL.INVALID),m);const t=m?.find((e=>"max"in e)),n=m?.find((e=>"length"in e)),r={...v};t?.max>0?r.maxLength=t.max:n?.length>0&&(r.maxLength=n.length),b(r);break}case"text-field":{E(a,zx(),m);const e=m?.find((e=>"max"in e)),t=m?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n);break}}}),[m]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]),t.useEffect((()=>{"text-field"===h&&document?.activeElement===S.current&&S.current.selectionEnd!==A.current&&S.current.setSelectionRange(A.current,A.current)}),[y]),t.useEffect((()=>{"text-field"===u.uiType&&"uppercase"===u.customOptions?.textTransform&&y&&_((e=>e?.toString().toUpperCase()))}),["text-field"===u.uiType&&u.customOptions?.textTransform]);const w=()=>!!d?.addOn,T=w()?x.Form.InputGroup:x.Form.Input;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...g,...l,...v,id:a,"data-testid":exports.TestHelper.generateId(a,h),ref:S,type:(()=>{switch(h){case"numeric-field":return"number";case"email-field":return"email";default:return"text"}})(),label:i,onPaste:e=>{const t=e.clipboardData.getData("text");(d?.preventCopyAndPaste||"numeric-field"===h&&/e/i.test(t))&&e.preventDefault()},onDrop:e=>d?.preventDragAndDrop?e.preventDefault():null,inputMode:(()=>{if(f)return f;switch(h){case"numeric-field":return"numeric";case"email-field":return"email";case"text-field":return"text";default:return"none"}})(),onChange:e=>{if("numeric-field"===h){const t=!isNaN(parseFloat(e.target.value))?+e.target.value:void 0;return o({target:{value:t}}),void _(t)}"text-field"===u.uiType?(A.current=e.target.selectionEnd,"uppercase"===u.customOptions?.textTransform&&(e.target.value=e.target.value.toUpperCase()),o(e)):o(e),_(e.target.value)},onKeyDown:e=>{"numeric-field"===h&&"e"===e.key.toLowerCase()&&e.preventDefault()},value:y,errorMessage:r?.message,addon:(()=>{if(w()){if("label"===d.addOn.type)return{type:"label",position:d.addOn.position,attributes:{value:d.addOn.value}};if("icon"===d.addOn.type){const{icon:t,position:n,color:r}=d.addOn,i=H[t];return{type:"custom",position:n,attributes:{children:e.jsx(tU,{as:i,$color:r})}}}}})()}),e.jsx(YL,{id:a,message:c})]})},Textarea:Y$,TimeField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{is24HourFormat:s,label:u,placeholder:c,useCurrentTime:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||""),{setFieldValidationConfig:_}=Dk();t.useEffect((()=>{_(a,zx(),d)}),[d]),t.useEffect((()=>{if(l&&!p){const e=s?"H:mm":"h:mma";setTimeout((()=>v(e)))}else y(p)}),[p,l,s]);const v=e=>{const t=sm.formatDateTime(Af.now().toString().toUpperCase(),e,"time");y(t),o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Timepicker,{...f,...m,id:a,"data-testid":exports.TestHelper.generateId(a,"time"),label:i,errorMessage:r?.message,value:g,placeholder:c,format:s?"24hr":"12hr",onChange:e=>{o({target:{value:e}})}}),e.jsx(YL,{id:a,message:h})]})},get EFieldType(){return exports.EFieldType},UnitNumberField:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{label:s,validation:u,...c},value:l,warning:d,...f}=n,[p,h]=t.useState(l||""),{setFieldValidationConfig:m}=Dk();t.useEffect((()=>{const e=u?.find((e=>"unitNumberFormat"in e));m(a,zx().matches(/^([a-zA-Z0-9]{1,3}-[a-zA-Z0-9]{1,5})$/,{excludeEmptyString:!0,message:e?.errorMessage||om.UNIT_NUMBER.INVALID}),u)}),[u]),t.useEffect((()=>{h(l||"")}),[l]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.UnitNumberInput,{...c,...f,id:a,"data-testid":exports.TestHelper.generateId(a,"unit-number"),label:r,value:p,onChange:e=>{o({target:{value:e}})},errorMessage:i?.message}),e.jsx(YL,{id:a,message:d})]})}});const iU=({id:t,children:n,childSchema:r})=>{if("columns"in r){if((i=r.columns)&&("xxs"in i||"xs"in i||"sm"in i||"md"in i||"lg"in i||"xl"in i||"xxl"in i)){const{xxs:i,xs:a,sm:o,md:s,lg:u,xl:c,xxl:d,...f}=r.columns||{};return e.jsx(l.Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),xlCols:c,lgCols:u,mdCols:s,smCols:o,xsCols:a,xxlCols:d,xxsCols:i,...f,children:n})}const{desktop:a,tablet:o,mobile:s,...u}=r.columns||{};return e.jsx(P.V2_Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),desktopCols:a??12,tabletCols:o,mobileCols:s,...u,children:n})}var i;return e.jsx(e.Fragment,{children:n})},aU=({id:n,renderRules:r,children:i,schema:a})=>{const{formValidationConfig:o,removeFieldValidationConfig:s}=Dk(),[u,c]=t.useState(void 0),{formValues:l}=Nk(),{unregister:d}=xe();_s((()=>{if(dE(r))return;const e=f();if(e!==u){if(!e){[n,...p(a)].forEach((e=>{s(e),d(e)}))}c(e)}}),[o,l,r]);const f=()=>{if(dE(r))return!0;let e=!1;return r.forEach((t=>{if(!e){const n={};Object.entries(t).forEach((([e,t])=>{if(t.find((e=>e.shown))&&!o?.[e])return void(n[e]={schema:Cx().test("shown",(()=>!1)),validationRules:[]});const r=o?.[e]?.schema.type;if(r){let i=KL.mapSchemaType(r);"number"===r&&(i=i.nullable().transform(((e,t)=>!isNaN(parseFloat(t?.toString()))?+t:void 0))),n[e]={schema:i,validationRules:t}}}));const r=KL.buildSchema(n);try{r.validateSync(l),e=!0}catch(e){}}})),e},p=e=>{const t=e.children,r=[];switch(e.uiType){case"chips":r.push(n+"-textarea");break;case"checkbox":case"radio":e.options.forEach((e=>{const t=e.children;!dE(t)&&un(t)&&Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))}))}))}return dE(t)||!un(t)||Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))})),r};return dE(r)||u?e.jsx(e.Fragment,{children:i}):null},oU=Object.keys(exports.EFieldType),sU=Object.keys(exports.EElementType),uU=n=>{const{id:r,schema:i,children:a}=n,{showIf:o,uiType:s,children:u,...c}=i||{},{warnings:l}=$k(),[d,f]=t.useState(null),{control:p}=xe(),{getCustomComponent:h}=mI(),{formSchema:{overrides:m},overrideSchema:g}=Ck();gI((()=>{const n=g(u||a,m);if("object"==typeof n){const r=[];Object.keys(n).forEach((i=>{const a=n[i];if(dE(a)||"object"!=typeof a)return;let o=e.jsx(t.Fragment,{children:om.GENERIC.UNSUPPORTED},i);if("referenceKey"in a){const n=a.referenceKey.toUpperCase();o=h(a.referenceKey)||h$[p$[n]]?y(i,a)(_):h$[f$[n]]?y(i,a)(v):e.jsx(t.Fragment,{},i)}else"uiType"in a&&(oU.includes(a.uiType.toUpperCase())?o=y(i,a)(_):sU.includes(a.uiType.toUpperCase())&&(o=y(i,a)(v)));r.push(o)})),f(r)}else f("string"==typeof n?n:om.GENERIC.UNSUPPORTED)}),[u||a,m,p,l,h]);const y=(t,n)=>r=>e.jsx(aU,{id:t,...n&&"showIf"in n&&{renderRules:n.showIf},schema:n,children:r(t,n)},t),_=(t,n)=>{let r;return"uiType"in n?r=rU[exports.EFieldType[n.uiType?.toUpperCase()]]:"referenceKey"in n&&(r=h$[p$[n.referenceKey?.toUpperCase()]]||h(n.referenceKey)),r?e.jsx(iU,{id:t,childSchema:n,children:e.jsx(Z$,{id:t,schema:n,Field:r,warning:l?.[t]})}):null},v=(t,n)=>{let r;return"uiType"in n?r=Wk[exports.EElementType[n.uiType?.toUpperCase()]]||uU:"referenceKey"in n&&(r=h$[f$[n.referenceKey?.toUpperCase()]]),e.jsx(iU,{id:t,childSchema:n,children:e.jsx(r,{schema:n,id:t})})},b=s;return b?e.jsx(b,{...c,id:r,"data-testid":exports.TestHelper.generateId(r,s),children:d}):e.jsx(e.Fragment,{children:d})},cU=V.default(l.Layout.Container)`
|
|
1129
|
+
`;var nU;exports.EFieldType=void 0,(nU=exports.EFieldType||(exports.EFieldType={})).BUTTON="ButtonField",nU.CHECKBOX="CheckboxGroup",nU.CHIPS="Chips",nU["CONTACT-FIELD"]="ContactField",nU["DATE-FIELD"]="DateField",nU["DATE-RANGE-FIELD"]="DateRangeField",nU["EMAIL-FIELD"]="TextField",nU["E-SIGNATURE-FIELD"]="ESignatureField",nU["ERROR-FIELD"]="ErrorField",nU["FILE-UPLOAD"]="FileUpload",nU["HIDDEN-FIELD"]="HiddenField",nU["HISTOGRAM-SLIDER"]="HistogramSlider",nU["IMAGE-UPLOAD"]="ImageUpload",nU["LOCATION-FIELD"]="LocationField",nU["MASKED-FIELD"]="MaskedField",nU["MULTI-SELECT"]="MultiSelect",nU["NESTED-MULTI-SELECT"]="NestedMultiSelect",nU["RANGE-SELECT"]="RangeSelect",nU["NUMERIC-FIELD"]="TextField",nU["OTP-VERIFICATION-FIELD"]="OtpVerificationField",nU.RADIO="RadioButtonGroup",nU.RESET="ResetButton",nU.SELECT="Select",nU["SELECT-HISTOGRAM"]="SelectHistogram",nU.SLIDER="Slider",nU.SUBMIT="SubmitButton",nU.SWITCH="Switch",nU.TEXTAREA="Textarea",nU["TEXT-FIELD"]="TextField",nU["TIME-FIELD"]="TimeField",nU["UNIT-NUMBER-FIELD"]="UnitNumberField";var rU=Object.freeze({__proto__:null,ButtonField:t=>{const{schema:{label:n,uiType:r,startIcon:i,endIcon:a,href:o,target:s,...u},id:c,...l}=t,{dispatchFieldEvent:d}=yI(),f=t=>{if(!t)return null;const n=H[t];return e.jsx(n,{})};return e.jsxs(m$,{type:"button",...u,...l,onClick:e=>{d("click",c,e),o&&(e=>{try{return!!new URL(e)}catch{return!1}})(o)&&(s?window.open(o,s,"noopener noreferrer"):window.location.href=o)},children:[f(i),n,f(a)]})},CheckboxGroup:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||[]),{setFieldValidationConfig:v}=Dk();t.useEffect((()=>{const e=f?.find((e=>"required"in e));v(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),f)}),[f]),ys((()=>{const e=h?.filter((e=>d.find((t=>t.value===e))));g(a,e)}),[d]),t.useEffect((()=>{_(h||[])}),[h]);const b=(e,t)=>{const n=d.find((e=>!0===e.none));let r=[...y];t?r=r.includes(e)?[]:[e]:r.includes(e)?r=$$(r,e,n?.value):(r.push(e),r=$$(r,n?.value)),o({target:{value:r}})},E=e=>y.includes(e),S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(uU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:r,errorMessage:i?.message,children:e.jsx("div",{role:"group",children:"toggle"===u?.styleType?d.length>0&&"toggle"===u.styleType&&e.jsx(P$,{$layoutType:u?.layoutType??"horizontal",className:s?`${s}-checkbox-container`:void 0,children:d.map(((t,n)=>{const r=S();return e.jsx(j$,{type:"checkbox","data-testid":exports.TestHelper.generateId(a,"toggle"),id:r,className:s,disabled:c??t.disabled,focusableWhenDisabled:c,name:r,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(t.value),onChange:()=>b(t.value,t.none),error:!!i?.message,compositeSection:t.children?{children:e.jsx(uU,{children:t.children}),collapsible:!1}:null,subLabel:!!t.subLabel&&A(t.subLabel),children:A(t.label)},n)}))}):d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(z$,{className:s?`${s}-checkbox-container`:void 0,children:[e.jsx(F$,{...p,"data-testid":exports.TestHelper.generateId(a,"checkbox"),id:r,className:s,disabled:c??t.disabled,name:r,value:t.value,focusableWhenDisabled:c,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx(R$,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))})}),e.jsx(YL,{id:a,message:m})]})},Chips:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{disabled:s,label:u,options:c,textarea:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||[]),[_,v]=t.useState(!1),[b,E]=t.useState(!0),{setValue:S,unregister:A}=xe(),{setFieldValidationConfig:w,removeFieldValidationConfig:T}=Dk();t.useEffect((()=>{_||A(O())}),[]),t.useEffect((()=>{const e=d?.find((e=>"required"in e)),t=d?.find((e=>"max"in e)),n=d?.find((e=>"length"in e));w(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),d),1!==t?.max&&1!==n?.length||E(!1)}),[d]),ys((()=>{const e=[...c.map((e=>e.value)),l?.label],t=p?.filter((t=>e.includes(t)));S(a,t)}),[c]),t.useEffect((()=>{p?.includes(C())?N(!0):N(),y(p||[])}),[p]);const M=e=>g.includes(e),O=()=>`${a}-textarea`,C=()=>"string"==typeof l?.label?l?.label:l?.label?.mainLabel,N=(e=!1)=>{v(e),e||T(O())},D=e=>{let t=[...g];if(t.includes(e))return t=t.filter((t=>t!==e)),void o({target:{value:t}});b?t.push(e):t=[e],o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsxs(x.Form.CustomField,{label:i,errorMessage:r?.message,...m,children:[e.jsxs(W$,{"data-testid":exports.TestHelper.generateId(a,"chips"),$showTextarea:_,children:[c.map(((e,n)=>t.createElement(uT,{...f,key:n,onClick:()=>D(e.value),isActive:M(e.value),disabled:s??e.disabled},e.label))),(()=>{if(!l?.label)return;const t=C();return e.jsx(uT,{...f,onClick:()=>{D(t)},isActive:M(t),children:t})})()]}),(()=>{if(!l?.label)return e.jsx(e.Fragment,{});const t=O(),n={uiType:"textarea",className:f.className?`${f.className}-textarea`:void 0,...l};return _?e.jsx(Z$,{id:t,schema:n,Field:Y$}):e.jsx(e.Fragment,{})})()]}),e.jsx(YL,{id:a,message:h})]})},ContactField:n=>{const{isDirty:r,formattedLabel:i,error:a,id:o,name:s,onChange:u,schema:{defaultCountry:c,disabled:l,enableSearch:d,label:f,placeholder:p,validation:h,...m},value:g,warning:y,..._}=n,{resetField:v}=xe(),[b,E]=t.useState(g||""),S=kk(c),[A,w]=t.useState(c),[T]=t.useState((()=>{const e=new Map;return q$.forEach((t=>{const[n,...r]=t,i=r.find((e=>/^\d+$/.test(e)));e.set(n,i)})),e})()),[M,O]=t.useState(),[C,N]=t.useState(),[D,L]=t.useState(void 0),{setFieldValidationConfig:I}=Dk();t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber,r=e?.errorMessage;T.has(n)?(w(n),L(!0)):["default","house","mobile"].includes(t)?(w("Singapore"),L(!0)):L(!1),N(t),I(o,zx().test("singaporeNumber",r||om.CONTACT.INVALID_SINGAPORE_NUMBER,(e=>!e||!t||ez.isSingaporeNumber(e,t))).test("internationalNumber",r||om.CONTACT.INVALID_INTERNATIONAL_NUMBER,(e=>!(e&&!t&&n)||ez.isInternationalNumber(M?.name,e))),h)}),[h,M]),t.useEffect((()=>{const e=A||"Singapore";O({name:e,prefix:T.get(e)})}),[A,T]),t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber;!c||S===c||T.has(n)||["default","house","mobile"].includes(t)||w(c)}),[h,c]),t.useEffect((()=>{if(void 0!==D&&!r){const{prefix:e,number:t}=ez.getParsedPhoneNumber(g||""),n=e.replace(/\+/g,""),r=(e=>{for(const[t,,,n]of q$)if(t===e)return n})(A||"Singapore");if(!D||D&&n===r){const n=k({countryCode:e||r,number:t});v(o,{defaultValue:n,keepDirty:!0})}else{const e=k({countryCode:"",number:""});v(o,{defaultValue:e,keepDirty:!0})}}}),[g,r,D,A]);const k=e=>{const{countryCode:t,number:n}=e,r=t.replace(/\+/g,"");if(!1===D&&r!==M?.prefix){const e=((e,t)=>{for(const[n,r]of t.entries())if(r===e)return n})(r,T);e&&O({name:e,prefix:t})}return E(n),ez.formatPhoneNumber(e.countryCode,e.number)||""};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.PhoneNumberInput,{...m,..._,"data-testid":exports.TestHelper.generateId(o,"contact"),disabled:l,enableSearch:d,errorMessage:a?.message,fixedCountry:D,id:o,label:i,name:s,placeholder:(()=>{if(p)return p;if(C){return`Enter ${"mobile"===C?"mobile":"home"} number`}return"Enter contact number"})(),value:(()=>{if(!M)return;const{prefix:e}=M;return{number:b,countryCode:e}})(),onChange:e=>{const t=k(e);u({target:{value:t}})}}),e.jsx(YL,{id:o,message:y})]})},DateField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{label:u,useCurrentDate:c,dateFormat:l=tz,validation:d,...f},value:p,warning:h,...m}=n,{setValue:g}=xe(),[y,_]=t.useState(p||""),[v,b]=t.useState(),{setFieldValidationConfig:E}=Dk();t.useEffect((()=>{const e=d?.find((e=>"dateFormat"in e&&e.dateFormat)),t=d?.find((e=>"future"in e)),n=d?.find((e=>"past"in e)),r=d?.find((e=>"notFuture"in e)),i=d?.find((e=>"notPast"in e)),o=d?.find((e=>"minDate"in e)),s=d?.find((e=>"maxDate"in e)),u=d?.find((e=>"excludedDates"in e)),c=d?.find((e=>"withinDays"in e)),f=d?.find((e=>"beyondDays"in e)),p=sm.toLocalDateOrTime(o?.minDate,l,"date"),h=sm.toLocalDateOrTime(s?.maxDate,l,"date");E(a,zx().test("is-date",e?.errorMessage||om.DATE.INVALID,(e=>!e||""===e||!!w(e)&&!!sm.toLocalDateOrTime(e,l,"date"))).test("future",t?.errorMessage||om.DATE.MUST_BE_FUTURE,(e=>{if(!w(e)||!t?.future)return!0;const n=sm.toLocalDateOrTime(e,l,"date");return!!n?.isAfter(bf.now())})).test("past",n?.errorMessage||om.DATE.MUST_BE_PAST,(e=>{if(!w(e)||!n?.past)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!!t?.isBefore(bf.now())})).test("not-future",r?.errorMessage||om.DATE.CANNOT_BE_FUTURE,(e=>{if(!w(e)||!r?.notFuture)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(bf.now())})).test("not-past",i?.errorMessage||om.DATE.CANNOT_BE_PAST,(e=>{if(!w(e)||!i?.notPast)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(bf.now())})).test("min-date",o?.errorMessage||om.DATE.MIN_DATE(sm.formatDateTime(o?.minDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!p)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(p)})).test("max-date",s?.errorMessage||om.DATE.MAX_DATE(sm.formatDateTime(s?.maxDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!h)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(h)})).test("excluded-dates",u?.errorMessage||om.DATE.DISABLED_DATES,(e=>!w(e)||!u||!u.excludedDates.includes(e))).test("within-days",c?.errorMessage||c?.withinDays&&om.DATE.WITHIN_DAYS(c?.withinDays),(e=>!w(e)||!c||sm.checkWithinDays(e,{...c.withinDays,dateFormat:l}))).test("beyond-days",f?.errorMessage||f?.beyondDays&&om.DATE.BEYOND_DAYS(f?.beyondDays),(e=>!w(e)||!f||sm.checkBeyondDays(e,{...f.beyondDays,dateFormat:l}))),d);const m=c?.withinDays&&sm.calculateDisabledWithinDaysRange({...c.withinDays,dateFormat:l}),g=f?.beyondDays&&sm.calculateDisabledBeyondDaysRange({...f.beyondDays,dateFormat:l}),y=A([p,t?.future&&bf.now().plusDays(1),i?.notPast&&bf.now(),m?.startDate,g?.startDate]),_=S([h,n?.past&&bf.now().minusDays(1),r?.notFuture&&bf.now(),m?.endDate,g?.endDate]),v=[...u?.excludedDates||[]];(y||_||v)&&b((e=>({...e,minDate:y?.format(nz),maxDate:_?.format(nz),disabledDates:v})))}),[d]),t.useEffect((()=>{if(l)if(p)if(w(p)){const e=sm.toLocalDateOrTime(p,l,"date");_(sm.formatDateTime(e?.toString(),tz,"date",om.DATE.INVALID))}else _(om.DATE.INVALID);else if(!o)if(c){const e=sm.formatDateTime(bf.now().toString(),l,"date");g(a,e);const t=sm.formatDateTime(bf.now().toString(),tz,"date");_(t)}else _(void 0)}),[c,p,l,o]);const S=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],A=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],w=e=>e&&e!==om.DATE.INVALID;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateInput,{...f,...m,...v,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:e=>{s({target:{value:sm.formatDateTime(e,l,"date",om.DATE.INVALID)}})},value:y}),e.jsx(YL,{id:a,message:h})]})},DateRangeField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{dateFormat:u=iz,label:c,validation:l,variant:d,...f},value:p={from:void 0,to:void 0},warning:h,...m}=n,[g,y]=t.useState(p.from||""),[_,v]=t.useState(p.to||""),[b,E]=t.useState(),{setFieldValidationConfig:S}=Dk(),[A,w]=t.useState([]);ys((()=>{S(a,Qw().shape({from:zx(),to:zx()}).test({name:"is-empty-string",test(e,t){w(t.schema.describe().meta?.rules??[]);const n=N(t.schema.describe().meta?.rules,"required");if(!e||!n)return!0;return!!(e.from?.length>0&&e.to?.length>0)||t.createError({message:n?.errorMessage??om.DATE_RANGE.REQUIRED})}}).test({name:"is-date",test(e,t){const n=l?.find((e=>!!e&&"dateFormat"in e&&e.dateFormat));if(FL.exports.isEmpty(e?.from)||FL.exports.isEmpty(e?.to))return!0;return!(!O(e.from)||!O(e.to)||!sm.toLocalDateOrTime(e.from,u,"date")||!sm.toLocalDateOrTime(e.to,u,"date"))||t.createError({message:n?.errorMessage||om.DATE_RANGE.INVALID})}}).test({name:"number-of-days",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"numberOfDays"),r=n?.numberOfDays;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date");return!!sm.toLocalDateOrTime(e.to,u,"date").equals(i.plusDays(r-1))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_HAVE_NUMBER_OF_DAYS(r)})}}).test({name:"future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"future");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isAfter(bf.now())||!i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_FUTURE})}}).test({name:"past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"past");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isBefore(bf.now())||!i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_PAST})}}).test({name:"not-future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notFuture");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isAfter(bf.now())||i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_FUTURE})}}).test({name:"not-past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notPast");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isBefore(bf.now())||i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_PAST})}}).test({name:"min-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"minDate"),r=n?.minDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isBefore(i)||o?.isBefore(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MIN_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"max-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"maxDate"),r=n?.maxDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isAfter(i)||o?.isAfter(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MAX_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"excluded-dates",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"excludedDates"),r=n?.excludedDates;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date"),a=sm.toLocalDateOrTime(e.to,u,"date");try{const e=r.map((e=>sm.toLocalDateOrTime(e,u,"date")));for(const r of e)if(i.isEqual(r)||a.isEqual(r))return t.createError({message:n?.errorMessage??om.DATE_RANGE.DISABLED_DATES});return!0}catch{return!1}}}),l);const e=N(A,"future"),t=N(A,"past"),n=N(A,"notFuture"),r=N(A,"notPast"),i=N(A,"minDate"),o=N(A,"maxDate"),s=N(A,"excludedDates"),c=N(A,"numberOfDays"),f=sm.toLocalDateOrTime(i?.minDate,u,"date"),p=sm.toLocalDateOrTime(o?.maxDate,u,"date"),h=M([f,e?.future&&bf.now().plusDays(1),r?.notPast&&bf.now()]),m=T([p,t?.past&&bf.now().minusDays(1),n?.notFuture&&bf.now()]),g=s?.excludedDates,y=c?.numberOfDays;E((e=>({...e,minDate:h?.format(az),maxDate:m?.format(az),disabledDates:g,numberOfDays:y})))}),[l,A]),t.useEffect((()=>{C(rz.START)}),[p.from,u,o]),t.useEffect((()=>{C(rz.END)}),[p.to,u,o]);const T=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],M=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],O=e=>e&&e!==om.DATE_RANGE.INVALID,C=e=>{const t=e===rz.START?p.from:p.to,n=e===rz.START?y:v;if(u)if(t)if(O(t)){const e=sm.toLocalDateOrTime(t,u,"date");n(sm.formatDateTime(e?.toString(),iz,"date",om.DATE_RANGE.INVALID))}else n(om.DATE_RANGE.INVALID);else o||n(void 0)},N=(e,t)=>{const n=e?.find((e=>t in e)),r=l?.find((e=>!!e&&t in e));return FL.exports.isEmpty(n)?FL.exports.isEmpty(r)?void 0:r:n};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateRangeInput,{...f,...m,...b,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:(e,t)=>{s({target:{value:{from:sm.formatDateTime(e,u,"date",om.DATE_RANGE.INVALID),to:sm.formatDateTime(t,u,"date",om.DATE_RANGE.INVALID)}}})},value:g,valueEnd:_,variant:d}),e.jsx(YL,{id:a,message:h})]})},get TDateRangeInputType(){return rz},ESignatureField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,uiType:u,upload:c,validation:l,...d},value:f,warning:p}=n,[h,m]=t.useState(null),[g,y]=t.useState(0),[_,v]=t.useState(0),[b,E]=t.useState(null),{setFieldValidationConfig:S}=Dk(),A=t.useRef(null),{clearErrors:w}=xe();t.useEffect((()=>{const e=l?.find((e=>"upload"in e&&e.upload));A.current=e,S(a,Qw().shape({fileId:zx().required(),dataURL:zx(),fileUrl:zx(),uploadResponse:Cx().nullable()}).default(void 0),l)}),[l]),t.useEffect((()=>{if(v(0),M(f)){if(f.dataURL)m(f.dataURL);else if(f.fileUrl){const e=C(f.fileId,f.fileUrl);return()=>e.abort()}}else m(null)}),[f]);const T=async e=>{if(!e)return m(null),v(0),y(0),E(null),void o({target:{value:null}});const t=um();if(m(e),v(0),dE(c))o({target:{value:{fileId:t,dataURL:e}}});else try{const n=await O(t,e);o({target:{value:{fileId:t,..."base64"===c.type&&{dataURL:e},fileUrl:n?.data?.fileUrl,uploadResponse:n}}}),w(a),y(0)}catch(e){y((e=>e+1)),E(null)}},M=e=>!!e,O=async(e,t)=>{E(0);const n=new FormData;if(n.append("fileId",e),c.sessionId&&n.append("sessionId",c.sessionId),"base64"===c.type)n.append("dataURL",t);else if("multipart"===c.type){const r=await exports.FileHelper.dataUrlToBlob(t),i=exports.FileHelper.blobToFile(r,{name:e,lastModified:Date.now()});n.append("file",i,e)}const r=await new fl("",void 0,void 0,!0).post(c.url,n,{headers:{"Content-Type":"base64"===c.type?"application/json":"multipart/form-data",...c.headers},onUploadProgress:e=>{const{loaded:t,total:n}=e;E(t/n)}});return E(null),r},C=(e,t)=>{const n=new AbortController;return(async()=>{try{const r=await new fl("",void 0,void 0,!1,{responseType:"blob"}).get(t,{signal:n.signal}),i=await exports.FileHelper.getType(new File([r],e)),a=new File([r],e,{type:i.mime}),o=await exports.FileHelper.fileToDataUrl(a);m(o),v(0)}catch(e){if(e instanceof Kc)return;v((e=>e+1))}})(),n};return e.jsxs(oz,{children:[e.jsx(x.Form.ESignature,{...d,id:a,label:i,onChange:T,value:h,...null!==b&&{loadingProgress:b}}),(r?.message||g||_)&&null===b?g>0?e.jsxs(sz,{children:[A.current?.errorMessage||om.ESIGNATURE.UPLOAD,e.jsx(uz,{type:"button",onClick:()=>T(h),children:"Please try again."}),g>=3&&e.jsx(cz,{type:"warning","data-testid":"upload-refresh-alert",children:"Refresh this page if you cannot upload your signature."})]}):_>0&&M(f)?e.jsxs(sz,{children:["Failed to load.",e.jsx(uz,{type:"button",onClick:()=>C(f.fileId,f.fileUrl),children:"Please try again."}),_>=3&&e.jsx(cz,{type:"warning","data-testid":"load-refresh-alert",children:"Refresh this page if your signature failed to load."})]}):e.jsx(sz,{children:r?.message}):null,e.jsx(YL,{id:a,message:p})]})},ErrorField:n=>{const{id:r,schema:{children:i}}=n,{setFieldValidationConfig:a}=Dk();return t.useEffect((()=>{a(r,Cx().test((()=>!1)),[])}),[]),i?e.jsx(uU,{children:i}):null},FileUploadInner:Pz,FileUpload:t=>e.jsx($z,{children:e.jsx(Pz,{...t})}),get EFileStatus(){return exports.EFileStatus},HiddenField:n=>{const{id:r,name:i,onBlur:a,onChange:o,schema:{showIf:s,uiType:u,validation:c,valueType:l,value:d,...f},value:p}=n,{setFieldValidationConfig:h}=Dk(),{setValue:m}=xe();return t.useEffect((()=>{let e;switch(l){case"null":e=Cx();break;case"number":e=jx();break;case"boolean":e=Dx();break;default:e=zx()}h(r,e,c)}),[c,l]),t.useEffect((()=>{"null"===l&&null!==p?m(r,null):hE(d)||p===d||m(r,d)}),[m,r,l,d,p]),e.jsx("input",{onBlur:a,onChange:o,...f,type:"hidden",id:r,"data-testid":r,name:i,value:d??p??""})},HistogramSlider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,bins:u,interval:c,validation:l,disabled:d,readOnly:f,className:p,ariaLabels:h,customOptions:m},value:g,warning:y}=n,{resetField:_}=xe(),[v,b]=t.useState(void 0),{setFieldValidationConfig:E}=Dk();t.useEffect((()=>{if(g)b([g.from,g.to]);else{const e=Math.min(...u.map((e=>e.minValue))),t=Math.max(...u.map((e=>e.minValue)))+c;_(a,{defaultValue:{from:e,to:t},keepDirty:!0}),b([e,t])}}),[g]),t.useEffect((()=>{const e=l?.find((e=>"required"in e)),t=l?.find((e=>"bin"in e&&e.bin)),n=l?.find((e=>"incremental"in e&&e.incremental)),r=l?.find((e=>"withinRange"in e&&e.withinRange));E(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue)));return Number.isInteger((t-r)/c)&&Number.isInteger((n-r)/c)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue))),i=Math.max(...u.map((e=>e.minValue)))+c;return!(t<r||n>i)})),l)}),[l,u,c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.HistogramSlider,{...m,id:a,"data-testid":exports.TestHelper.generateId(a,"histogram-slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},value:v,bins:u,interval:c,disabled:d,readOnly:f,className:p,ariaLabels:h}),e.jsx(YL,{id:a,message:y})]})},ImageUploadInner:$Z,ImageUpload:t=>e.jsx(Zz,{children:e.jsx($Z,{...t})}),ACCEPTED_FILE_TYPES:Bz,get EImageStatus(){return exports.EImageStatus},LocationField:n=>{const{error:r,formattedLabel:i,id:o,schema:{className:s="location",mapApi:u,disabled:c,gettingCurrentLocationFetchMessage:l,interactiveMapPinIconUrl:d,label:f,locationInputPlaceholder:p,locationListTitle:h,locationModalStyles:m,mapBannerText:g,mapPanZoom:y,mustHavePostalCode:_,readOnly:v,staticMapPinColor:b,validation:E,hasExplicitEdit:S,locationSelectionMode:A="default",disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O,legendItems:C},value:N,warning:D}=n,[L,I]=t.useState(!1),{setValue:k}=xe(),{setFieldValidationConfig:$}=Dk(),{dispatchFieldEvent:R,addFieldEventListener:F,removeFieldEventListener:z}=yI();t.useEffect((()=>(F("show-location-modal",o,Z),R("show-location-modal-ready",o),()=>{z("show-location-modal",o,Z)})),[]),t.useEffect((()=>{const e=E?.find((e=>"required"in e)),t=E?.find((e=>"postalCode"in e));$(o,Qw({address:zx(),blockNo:zx(),building:zx(),lat:jx(),lng:jx(),postalCode:zx(),roadName:zx(),x:jx(),y:jx()}).test("is-required",e?.errorMessage||om.COMMON.FIELD_REQUIRED,(t=>!e?.required||!!t&&!!t.lat&&!!t.lng)).test("must-have-postal-code",t?.errorMessage||om.LOCATION.MUST_HAVE_POSTAL_CODE,(t=>!e||!_||exports.LocationHelper.hasGotAddressValue(t.postalCode))),E)}),[E]);const P=(e,t=!0)=>{k(o,e,{shouldDirty:t})},j=()=>{v||c||(I(!0),R("show-location-modal",o))},Z=()=>{I(!0)};return e.jsxs("div",{id:o,"data-testid":exports.TestHelper.generateId(o),className:s,children:[e.jsx(BZ,{id:o,label:i,className:s,locationInputPlaceholder:p,onChange:e=>e.currentTarget.blur(),onFocus:j,value:N?.address||"",errorMessage:r?.message,disabled:"explicit"===S&&!!N?.address||c,readOnly:v}),S&&N?.address&&e.jsx(a.Button.Default,{id:exports.TestHelper.generateId(o,"edit-button"),"data-testid":exports.TestHelper.generateId(o,"edit-button"),styleType:"secondary",onClick:()=>{!R("click-edit-button",o)||I(!0)},type:"button",children:"Edit"}),!!N?.lat&&!!N?.lng&&e.jsx(GL,{id:o,className:`${s}-static-map`,lat:N.lat,lng:N.lng,staticMapPinColor:b,onClick:j,disabled:c}),e.jsx(t.Suspense,{fallback:null,children:VZ&&e.jsx(VZ,{id:o,className:s,showLocationModal:L,onClose:()=>{I(!1),R("hide-location-modal",o)},formValues:N,onConfirm:P,updateFormValues:P,mapPanZoom:y,mapApi:u,interactiveMapPinIconUrl:d,gettingCurrentLocationFetchMessage:l,mustHavePostalCode:_,locationModalStyles:m,locationListTitle:h,mapBannerText:g,locationSelectionMode:A,disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O,legendItems:C})}),e.jsx(YL,{id:o,message:D})]})},GeolocationPositionErrorWrapper:HZ,MaskedField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:{label:u,uiType:c,validation:l,maskRegex:d,iconMask:f,iconUnmask:p,...h},warning:m,...g}=n,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Dk();t.useEffect((()=>{E(a,zx(),l);const e=l?.find((e=>"max"in e)),t=l?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n)}),[l]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]);const S=t=>{if(!t)return;const n=H[t];return e.jsx(n,{"data-testid":t})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MaskedInput,{...h,...g,...v,id:a,"data-testid":exports.TestHelper.generateId(a,c),label:i,onChange:e=>{o(e)},value:y,errorMessage:r?.message,maskRegex:(()=>{if(d)try{const e=d.match(/\/(.*)\/([a-z]+)?/);return new RegExp(e[1],e[2])}catch(e){console.warn(`invalid regex pattern: ${d}`)}})(),iconMask:S(f),iconUnmask:S(p)}),e.jsx(YL,{id:a,message:m})]})},MultiSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u=[],validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||[]),{setFieldValidationConfig:y}=Dk();t.useEffect((()=>{const e=c?.find((e=>"required"in e));y(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),c)}),[c]),_s((()=>{const e=d?.filter((e=>u.find((t=>t.value===e))));h(a,e)}),[u]),t.useEffect((()=>{g(d||[])}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MultiSelect,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOptions:e=>{const t=e.map((e=>e.value));o({target:{value:t}})},selectedOptions:u.filter((e=>m.includes(e.value))),valueExtractor:e=>e.value,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},OtpVerificationField:n=>{const{error:r,id:i,value:a,formattedLabel:o,onChange:s,warning:u,schema:{validation:c,request:l,verification:d,withPrefix:f,verifyOtpCountdownTimer:p,prefixSeparator:h,type:m,...g}}=n,[y,_]=t.useState(a?.otpCode||""),[v,b]=t.useState(a?.otpPrefix),E=t.useRef(a?.transactionId),S=t.useRef(-1),A=t.useRef(-1),w=a?.state||"default",T=a?.contact||"",M={number:"phone-number"===m?T:"",countryCode:"+65"},O=c?.find((e=>"otp-type"in e)),C=c?.find((e=>"required"in e)),{setFieldValidationConfig:N}=Dk(),{formState:D,setError:L,clearErrors:I}=xe(),{submitCount:k}=D;t.useEffect((()=>{N(i,Qw().test(GZ.IS_OTP_VERIFIED,C?.errorMessage||R(),(e=>!C?.required||"verified"===e?.state)),c)}),[c,w]);const $=async()=>{const e=O?.["otp-type"]??void 0;if("email"===e&&(t=T,!zx().required().email().isValidSync(t)))throw L(i,{type:GZ.IS_EMAIL_VALID,message:O?.errorMessage||om.OTP_VERIFICATION.INVALID_EMAIL}),new Error;var t;const n=`${M.countryCode}${M.number}`;if("phone-number"===e&&!(e=>ez.isSingaporeNumber(e))(n))throw L(i,{type:GZ.IS_PHONE_NUMBER_VALID,message:O?.errorMessage||om.OTP_VERIFICATION.INVALID_PHONE}),new Error;const r={type:m,..."email"===m?{email:T}:{phoneNo:n},...void 0!==f&&{withPrefix:f}},a=await new fl("",void 0,void 0,!0).post(l.endpoint.url,r).catch((e=>{const t=e?.message||om.OTP_VERIFICATION.SEND_OTP_FAILED;throw L(i,{type:GZ.SEND_OTP_FAILED,message:t}),new Error(t)})),o=a?.transactionId??a?.data?.transactionId,u=a?.prefix??a?.data?.prefix;E.current=o,u&&b(u),I(i),S.current=k,s({target:{value:{contact:"email"===e?T:M.number,otpPrefix:u??v,type:m,state:"sent"}}})},R=()=>"default"===w?"email"===m?om.OTP_VERIFICATION.EMAIL_VERIFICATION_REQUIRED:om.OTP_VERIFICATION.PHONE_VERIFICATION_REQUIRED:"sent"===w?om.OTP_VERIFICATION.OTP_REQUIRED:void 0,F={...g,id:i,"data-testid":exports.TestHelper.generateId(i,"otp-verification-field"),label:o,otpState:w,onOtpStateChange:e=>{"default"===e&&(_(""),b(void 0),E.current=void 0,s({target:{value:{...a,state:void 0,additionalData:void 0,otpPrefix:void 0}}}))},onSendOtp:$,onResendOtp:$,onVerifyOtp:async e=>{const t="email"===m?T:M.number,n=await new fl("",void 0,void 0,!0).post(d.endpoint.url,{transactionId:E.current,otp:e,otpPrefix:v}).catch((e=>{const t=e?.message||om.OTP_VERIFICATION.OTP_VERIFICATION_FAILED;throw L(i,{type:GZ.OTP_VERIFICATION_FAILED,message:t}),new Error(t)}));s({target:{value:{contact:t,otpPrefix:v,type:m,state:"verified",additionalData:n?.additionalData??n?.data?.additionalData}}})},sendOtpError:(()=>{if("sent"===w)return;if(r?.type===GZ.IS_EMAIL_VALID||r?.type===GZ.IS_PHONE_NUMBER_VALID||r?.type===GZ.SEND_OTP_FAILED)return r?.message;return D.isSubmitted&&k>A.current&&r?.type===GZ.IS_OTP_VERIFIED?r?.message:void 0})(),verifyOtpError:(()=>{if("sent"!==w)return;return r?.type===GZ.IS_OTP_VERIFIED&&k>S.current||r?.type===GZ.OTP_VERIFICATION_FAILED||r?.type===GZ.API_ERROR?r?.message:void 0})(),otpValue:{value:y,...v&&{prefix:v},...h&&{prefixSeparator:h}},onOtpChange:e=>{I(i),_(e)},...void 0!==l.placeholder&&{sendOtpPlaceholder:l.placeholder},...void 0!==p&&{verifyOtpCountdownTimer:p},...void 0!==d.showThumbnail&&{showVerifyOtpThumbnail:d.showThumbnail},...void 0!==d.title&&{verifyOtpTitle:d.title},...void 0!==d.message&&{verifyOtpMessage:d.message}};return e.jsxs(e.Fragment,{children:["email"===m?e.jsx(x.Form.OtpVerification,{...F,type:"email",emailValue:T,onEmailChange:e=>{A.current=k,I(i),s({target:{value:{...a,contact:e}}})}}):e.jsx(x.Form.OtpVerification,{...F,type:"phone-number",phoneNumberValue:M,onPhoneNumberChange:e=>{A.current=k,I(i);let t=e.number;e.number||(t=""),s({target:{value:{...a,contact:t}}})},fixedCountry:!0}),e.jsx(YL,{id:i,message:u})]})},get EOtpVerificationErrorType(){return GZ},NestedMultiSelect:n=>{const{schema:{label:r,validation:i,options:a=[],...o},id:s,value:u,formattedLabel:c,onChange:l,onBlur:d,error:f,warning:p,...h}=n,{setValue:m}=xe(),{setFieldValidationConfig:g}=Dk(),[y,_]=t.useState(u),[v,b]=t.useState([]),E=t.useCallback((e=>{const t=[],n=(e,r)=>{for(const i in e){const a=[...r,i],o=e[i];"string"==typeof o?t.push(a):n(o,a)}};return n(e,[]),t}),[]);t.useEffect((()=>{const e=i?.find((e=>"required"in e));g(s,Qw().test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!e?.required||!!t&&!!Object.keys(t).length)),i)}),[i]),_s((()=>{const e=(t,n)=>{const r={};for(const i of t){const{key:t,subItems:a}=i,o=n[t];if(o){const n="string"==typeof o?o:e(a||[],o);Object.keys(n).length?r[t]=n:delete r[t]}}return r},t=u?e(a,u):u;m(s,t)}),[a]),t.useEffect((()=>{_(u);const e=E(u);b(e)}),[E,y,u]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.NestedMultiSelect,{...o,...h,id:s,"data-testid":exports.TestHelper.generateId(s),label:c,options:a,onSelectOptions:(e,t)=>{const n=((e,t)=>{const n={};return e.forEach(((e,r)=>{e.reduce(((n,i,a)=>(a===e.length-1?n[i]=t[r]:n[i]||(n[i]={}),n[i])),n)})),n})(e,t);l({target:{value:n}})},onBlur:d,selectedKeyPaths:v,errorMessage:f?.message}),e.jsx(YL,{id:s,message:p})]})},RadioButtonGroup:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||""),{setFieldValidationConfig:v}=Dk();t.useEffect((()=>{v(a,zx(),f)}),[f]),ys((()=>{d.find((e=>e.value===h))||g(a,"")}),[d]),t.useEffect((()=>{_(h||"")}),[h]);const b=e=>{o({target:{value:e}})},E=e=>y===e,S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(uU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:e.jsx("div",{role:"radiogroup",tabIndex:0,children:(()=>{switch(u?.styleType){case"toggle":return d.length>0&&"toggle"===u.styleType&&e.jsx(XZ,{className:s?`${s} ${s}-radio-container`:void 0,$layoutType:u?.layoutType??"horizontal",children:d.map(((n,i)=>{const o=S();return t.createElement(QZ,{...p,key:i,type:"radio",id:o,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??n.disabled,focusableWhenDisabled:c,name:o,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(n.value),onChange:()=>b(n.value),error:!!r?.message,compositeSection:n.children?{children:e.jsx(uU,{children:n.children}),collapsible:!1}:null,subLabel:!!n.subLabel&&A(n.subLabel)},A(n.label))}))});case"image-button":return d.length>0&&e.jsx(JZ,{className:s?`${s} ${s}-radio-container`:void 0,children:d.map(((e,n)=>{const i=S();return t.createElement(qZ,{...p,type:"button",key:n,id:i,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??e.disabled,focusableWhenDisabled:c,name:i,selected:E(e.value),onClick:()=>b(e.value),imgSrc:e.imgSrc,error:!!r?.message},e.label)}))});default:return d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(KZ,{className:s?`${s}-radio-container`:void 0,children:[e.jsx(WZ,{...p,className:s,id:r,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??t.disabled,focusableWhenDisabled:c,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx(YZ,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}})()})}),e.jsx(YL,{id:a,message:m})]})},RangeSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d={from:void 0,to:void 0},warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d.from||""),[y,_]=t.useState(d.to||""),{setFieldValidationConfig:v}=Dk(),b=t.useRef(!1);t.useEffect((()=>{const e=c?.find((e=>"required"in e));v(a,Qw().shape({from:zx(),to:zx()}).test("is-empty-string",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e?.required||t.from?.length>0&&t.to?.length>0)),c)}),[c]),ys((()=>{const e={};u.from.find((e=>e.value===d.from))||(e.from=""),u.to.find((e=>e.value===d.to))||(e.to=""),h(a,{...d,...e})}),[u]),t.useEffect((()=>{_(d.from),g(d.to)}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.RangeSelect,{...l,...p,id:a,onHideOptions:()=>{b.current?b.current=!1:d.from&&d.to||o({target:{value:{from:void 0,to:void 0}}})},"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOption:e=>{void 0===e.from&&void 0===e.to&&o({target:{value:{from:void 0,to:void 0}}}),e.from&&o({target:{value:{from:e.from.value,to:void 0}}}),e.to&&(b.current=!0,o({target:{value:{to:e.to.value,from:y}}}))},selectedOptions:{from:u.from.find((({value:e})=>e===y)),to:u.to.find((({value:e})=>e===m))},valueToStringFunction:e=>`${e.from} - ${e.to}`,valueExtractor:e=>({from:e.value,to:e.value}),displayValueExtractor:e=>e.label,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},ResetButton:t=>{const{id:n,schema:{disabled:r,ignoreDefaultValues:i,label:o,...s},...u}=t,{reset:c,getValues:l}=xe(),{resetFields:d}=Nk(),{formSchema:{defaultValues:f}}=Ck();return e.jsx(a.Button.Default,{...s,...u,disabled:r,"data-testid":n,id:n,type:"reset",onClick:()=>{if(i){const e=l();Object.entries(e).forEach((([t,n])=>{Hr(n)?e[t]=[]:o$(n)||iI(n)?e[t]="":Rr(n)&&(e[t]={})})),c(e),d(e)}else c(),d(f)},children:o})},Select:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||""),{setFieldValidationConfig:y}=Dk();t.useEffect((()=>{y(a,zx(),c)}),[c]),ys((()=>{u.find((e=>e.value===d))||h(a,"")}),[u]),t.useEffect((()=>{g(d||"")}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Select,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a,"select"),label:i,errorMessage:r?.message,options:u,onSelectOption:(e,t)=>{o({target:{value:t}})},selectedOption:u.find((({value:e})=>e===m)),displayValueExtractor:e=>e.label,valueExtractor:e=>e.value,listExtractor:e=>e.label}),e.jsx(YL,{id:a,message:f})]})},SelectHistogram:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,validation:u,disabled:c,readOnly:l,className:d,histogramSlider:f,customOptions:p},value:h,warning:m,...g}=n,{bins:y,interval:_,...v}=f,{resetField:b}=xe(),[E,S]=t.useState([0,0]),{setFieldValidationConfig:A}=Dk();t.useEffect((()=>{if(h)S([h.from,h.to]);else{const e=Math.min(...y.map((e=>e.minValue))),t=Math.max(...y.map((e=>e.minValue)))+_;b(a,{defaultValue:{from:e,to:t},keepDirty:!0}),S([e,t])}}),[h]),t.useEffect((()=>{const e=u?.find((e=>"required"in e)),t=u?.find((e=>"bin"in e&&e.bin)),n=u?.find((e=>"incremental"in e&&e.incremental)),r=u?.find((e=>"withinRange"in e&&e.withinRange));A(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue)));return Number.isInteger((t-r)/_)&&Number.isInteger((n-r)/_)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue))),i=Math.max(...y.map((e=>e.minValue)))+_;return!(t<r||n>i)})),u)}),[u,y,_]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.SelectHistogram,{...g,id:a,"data-testid":exports.TestHelper.generateId(a,"select-histogram"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},disabled:c,readOnly:l,className:d,rangeLabelPrefix:p?.rangeLabelPrefix,rangeLabelSuffix:p?.rangeLabelSuffix,value:E,histogramSlider:{bins:y,interval:_,...v}}),e.jsx(YL,{id:a,message:m})]})},Slider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,customOptions:u,validation:c,disabled:l,readOnly:d,className:f,ariaLabel:p},value:h,warning:m}=n,[g,y]=t.useState(),{setFieldValidationConfig:_}=Dk();t.useEffect((()=>{const e=c?.find((e=>"min"in e)),t=c?.find((e=>"max"in e)),n=c?.find((e=>"increment"in e));_(a,jx().test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(t=>{if("number"!=typeof t||!n)return!0;const r=n.increment,i=(e?.min??0)-t;return Number.isInteger(i/r)})),c),(e||t||n)&&y({min:e?.min,max:t?.max,step:n?.increment})}),[c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Slider,{...u,...g,id:a,"data-testid":exports.TestHelper.generateId(a,"slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{o({target:{value:e}})},value:h,disabled:l,readOnly:d,className:f,ariaLabel:p}),e.jsx(YL,{id:a,message:m})]})},SubmitButton:n=>{const{id:r,schema:{disabled:i,label:o,...s},...u}=n,{submitHandler:c,wrapInForm:l}=Lk(),{setFieldValidationConfig:d}=Dk(),{hardValidationSchema:f}=$k(),p=$e({disabled:"invalid-form"!==i}),[h,m]=t.useState(!0===i);t.useEffect((()=>{d(r,Cx())}),[]),t.useEffect((()=>{"invalid-form"!==i&&m(!!i)}),[i]),ys((()=>{(async()=>{if("invalid-form"===i)try{await f.validate(p),m(!1)}catch(e){m(!0)}})()}),[p,f]);return e.jsx(a.Button.Default,{...s,...u,disabled:h,"data-testid":r,id:r,onClick:e=>{l||(e.preventDefault(),c?.())},type:"submit",children:o})},Switch:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,validation:d,...f},value:p,warning:h}=n,[m,g]=t.useState(p||void 0),{setFieldValidationConfig:y}=Dk();t.useEffect((()=>{y(a,Dx().strict(),d)}),[d]),t.useEffect((()=>{g(p)}),[p]);const _=e=>{o({target:{value:e}})},v=e=>m===e,b=e=>`${a}-${e}`;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:e.jsxs(eU,{className:s,role:"radiogroup","aria-label":"string"==typeof l?l:$L(l.mainLabel,{allowedTags:[]}),children:[e.jsx(T.Toggle,{...f,type:"yes",id:b("yes"),"data-testid":exports.TestHelper.generateId(a,"switch-yes"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!0),onChange:()=>_(!0),indicator:!0,name:a,error:!!r?.message,children:"Yes"}),e.jsx(T.Toggle,{...f,type:"no",id:b("no"),"data-testid":exports.TestHelper.generateId(a,"switch-no"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!1),onChange:()=>_(!1),indicator:!0,name:a,error:!!r?.message,children:"No"})]})}),e.jsx(YL,{id:a,message:h})]})},TextField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:u,warning:c,...l}=n,{customOptions:d,inputMode:f,label:p,uiType:h,validation:m,...g}=u,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Dk(),S=t.useRef(null),A=t.useRef(0);t.useEffect((()=>{switch(h){case"numeric-field":{E(a,jx(),m);const e=m?.find((e=>"min"in e)),t=m?.find((e=>"max"in e)),n={...v};e?.min>0&&(n.min=e.min),t?.max>0&&(n.max=t.max),b(n);break}case"email-field":{const e=m?.find((e=>e.email));E(a,zx().email(e?.errorMessage||om.EMAIL.INVALID),m);const t=m?.find((e=>"max"in e)),n=m?.find((e=>"length"in e)),r={...v};t?.max>0?r.maxLength=t.max:n?.length>0&&(r.maxLength=n.length),b(r);break}case"text-field":{E(a,zx(),m);const e=m?.find((e=>"max"in e)),t=m?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n);break}}}),[m]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]),t.useEffect((()=>{"text-field"===h&&document?.activeElement===S.current&&S.current.selectionEnd!==A.current&&S.current.setSelectionRange(A.current,A.current)}),[y]),t.useEffect((()=>{"text-field"===u.uiType&&"uppercase"===u.customOptions?.textTransform&&y&&_((e=>e?.toString().toUpperCase()))}),["text-field"===u.uiType&&u.customOptions?.textTransform]);const w=()=>!!d?.addOn,T=w()?x.Form.InputGroup:x.Form.Input;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...g,...l,...v,id:a,"data-testid":exports.TestHelper.generateId(a,h),ref:S,type:(()=>{switch(h){case"numeric-field":return"number";case"email-field":return"email";default:return"text"}})(),label:i,onPaste:e=>{const t=e.clipboardData.getData("text");(d?.preventCopyAndPaste||"numeric-field"===h&&/e/i.test(t))&&e.preventDefault()},onDrop:e=>d?.preventDragAndDrop?e.preventDefault():null,inputMode:(()=>{if(f)return f;switch(h){case"numeric-field":return"numeric";case"email-field":return"email";case"text-field":return"text";default:return"none"}})(),onChange:e=>{if("numeric-field"===h){const t=!isNaN(parseFloat(e.target.value))?+e.target.value:void 0;return o({target:{value:t}}),void _(t)}"text-field"===u.uiType?(A.current=e.target.selectionEnd,"uppercase"===u.customOptions?.textTransform&&(e.target.value=e.target.value.toUpperCase()),o(e)):o(e),_(e.target.value)},onKeyDown:e=>{"numeric-field"===h&&"e"===e.key.toLowerCase()&&e.preventDefault()},value:y,errorMessage:r?.message,addon:(()=>{if(w()){if("label"===d.addOn.type)return{type:"label",position:d.addOn.position,attributes:{value:d.addOn.value}};if("icon"===d.addOn.type){const{icon:t,position:n,color:r}=d.addOn,i=H[t];return{type:"custom",position:n,attributes:{children:e.jsx(tU,{as:i,$color:r})}}}}})()}),e.jsx(YL,{id:a,message:c})]})},Textarea:Y$,TimeField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{is24HourFormat:s,label:u,placeholder:c,useCurrentTime:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||""),{setFieldValidationConfig:_}=Dk();t.useEffect((()=>{_(a,zx(),d)}),[d]),t.useEffect((()=>{if(l&&!p){const e=s?"H:mm":"h:mma";setTimeout((()=>v(e)))}else y(p)}),[p,l,s]);const v=e=>{const t=sm.formatDateTime(Af.now().toString().toUpperCase(),e,"time");y(t),o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Timepicker,{...f,...m,id:a,"data-testid":exports.TestHelper.generateId(a,"time"),label:i,errorMessage:r?.message,value:g,placeholder:c,format:s?"24hr":"12hr",onChange:e=>{o({target:{value:e}})}}),e.jsx(YL,{id:a,message:h})]})},get EFieldType(){return exports.EFieldType},UnitNumberField:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{label:s,validation:u,...c},value:l,warning:d,...f}=n,[p,h]=t.useState(l||""),{setFieldValidationConfig:m}=Dk();t.useEffect((()=>{const e=u?.find((e=>"unitNumberFormat"in e));m(a,zx().matches(/^([a-zA-Z0-9]{1,3}-[a-zA-Z0-9]{1,5})$/,{excludeEmptyString:!0,message:e?.errorMessage||om.UNIT_NUMBER.INVALID}),u)}),[u]),t.useEffect((()=>{h(l||"")}),[l]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.UnitNumberInput,{...c,...f,id:a,"data-testid":exports.TestHelper.generateId(a,"unit-number"),label:r,value:p,onChange:e=>{o({target:{value:e}})},errorMessage:i?.message}),e.jsx(YL,{id:a,message:d})]})}});const iU=({id:t,children:n,childSchema:r})=>{if("columns"in r){if((i=r.columns)&&("xxs"in i||"xs"in i||"sm"in i||"md"in i||"lg"in i||"xl"in i||"xxl"in i)){const{xxs:i,xs:a,sm:o,md:s,lg:u,xl:c,xxl:d,...f}=r.columns||{};return e.jsx(l.Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),xlCols:c,lgCols:u,mdCols:s,smCols:o,xsCols:a,xxlCols:d,xxsCols:i,...f,children:n})}const{desktop:a,tablet:o,mobile:s,...u}=r.columns||{};return e.jsx(P.V2_Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),desktopCols:a??12,tabletCols:o,mobileCols:s,...u,children:n})}var i;return e.jsx(e.Fragment,{children:n})},aU=({id:n,renderRules:r,children:i,schema:a})=>{const{formValidationConfig:o,removeFieldValidationConfig:s}=Dk(),[u,c]=t.useState(void 0),{formValues:l}=Nk(),{unregister:d}=xe();_s((()=>{if(dE(r))return;const e=f();if(e!==u){if(!e){[n,...p(a)].forEach((e=>{s(e),d(e)}))}c(e)}}),[o,l,r]);const f=()=>{if(dE(r))return!0;let e=!1;return r.forEach((t=>{if(!e){const n={};Object.entries(t).forEach((([e,t])=>{if(t.find((e=>e.shown))&&!o?.[e])return void(n[e]={schema:Cx().test("shown",(()=>!1)),validationRules:[]});const r=o?.[e]?.schema.type;if(r){let i=KL.mapSchemaType(r);"number"===r&&(i=i.nullable().transform(((e,t)=>!isNaN(parseFloat(t?.toString()))?+t:void 0))),n[e]={schema:i,validationRules:t}}}));const r=KL.buildSchema(n);try{r.validateSync(l),e=!0}catch(e){}}})),e},p=e=>{const t=e.children,r=[];switch(e.uiType){case"chips":r.push(n+"-textarea");break;case"checkbox":case"radio":e.options.forEach((e=>{const t=e.children;!dE(t)&&un(t)&&Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))}))}))}return dE(t)||!un(t)||Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))})),r};return dE(r)||u?e.jsx(e.Fragment,{children:i}):null},oU=Object.keys(exports.EFieldType),sU=Object.keys(exports.EElementType),uU=n=>{const{id:r,schema:i,children:a}=n,{showIf:o,uiType:s,children:u,...c}=i||{},{warnings:l}=$k(),[d,f]=t.useState(null),{control:p}=xe(),{getCustomComponent:h}=mI(),{formSchema:{overrides:m},overrideSchema:g}=Ck();gI((()=>{const n=g(u||a,m);if("object"==typeof n){const r=[];Object.keys(n).forEach((i=>{const a=n[i];if(dE(a)||"object"!=typeof a)return;let o=e.jsx(t.Fragment,{children:om.GENERIC.UNSUPPORTED},i);if("referenceKey"in a){const n=a.referenceKey.toUpperCase();o=h(a.referenceKey)||h$[p$[n]]?y(i,a)(_):h$[f$[n]]?y(i,a)(v):e.jsx(t.Fragment,{},i)}else"uiType"in a&&(oU.includes(a.uiType.toUpperCase())?o=y(i,a)(_):sU.includes(a.uiType.toUpperCase())&&(o=y(i,a)(v)));r.push(o)})),f(r)}else f("string"==typeof n?n:om.GENERIC.UNSUPPORTED)}),[u||a,m,p,l,h]);const y=(t,n)=>r=>e.jsx(aU,{id:t,...n&&"showIf"in n&&{renderRules:n.showIf},schema:n,children:r(t,n)},t),_=(t,n)=>{let r;return"uiType"in n?r=rU[exports.EFieldType[n.uiType?.toUpperCase()]]:"referenceKey"in n&&(r=h$[p$[n.referenceKey?.toUpperCase()]]||h(n.referenceKey)),r?e.jsx(iU,{id:t,childSchema:n,children:e.jsx(Z$,{id:t,schema:n,Field:r,warning:l?.[t]})}):null},v=(t,n)=>{let r;return"uiType"in n?r=Wk[exports.EElementType[n.uiType?.toUpperCase()]]||uU:"referenceKey"in n&&(r=h$[f$[n.referenceKey?.toUpperCase()]]),e.jsx(iU,{id:t,childSchema:n,children:e.jsx(r,{schema:n,id:t})})},b=s;return b?e.jsx(b,{...c,id:r,"data-testid":exports.TestHelper.generateId(r,s),children:d}):e.jsx(e.Fragment,{children:d})},cU=V.default(l.Layout.Container)`
|
|
1130
1130
|
gap: ${n.Spacing["spacing-32"]};
|
|
1131
1131
|
`,lU=V.default(l.Layout.Container)`
|
|
1132
1132
|
gap: ${n.Spacing["spacing-32"]};
|
|
@@ -1143,4 +1143,4 @@ object-assign
|
|
|
1143
1143
|
`,dU=V.default.div`
|
|
1144
1144
|
flex: 1;
|
|
1145
1145
|
`,fU=t=>{const{sectionSchema:{children:n,layoutType:r,customOptions:i={gridType:"v2"}},...a}=t;switch(r){case"grid":return(()=>{const t="v3"===i.gridType?cU:lU,r="v3"===i.gridType?"grid":"flex";return e.jsx(l.Layout.Section,{children:e.jsx(t,{type:r,children:e.jsx(uU,{...a,children:n})})})})();case"contain":return e.jsx(l.Layout.Content,{children:e.jsx(dU,{children:e.jsx(uU,{...a,children:n})})});default:return e.jsx(uU,{...a,children:n})}},pU=()=>{const{formSchema:{sections:t,overrides:n},overrideSchema:r}=Ck();return e.jsx(e.Fragment,{children:(()=>{const i=r(t,n);return i?Object.entries(i).map((([t,n],r)=>e.jsx(fU,{id:t,sectionSchema:n},`section-${r}`))):e.jsxs(e.Fragment,{children:["Unable to render Frontend Engine schema, make sure schema is declared within ",e.jsx("code",{children:"sections"}),"."]})})()})},hU=t.forwardRef(((n,r)=>{const{data:i,className:a=null,components:o,onSubmit:s,onSubmitError:u,wrapInForm:c=!0}=n,{className:l=null,defaultValues:d,id:f,stripUnknown:p,revalidationMode:h="onChange",validationMode:m="onTouched"}=i||{},{addFieldEventListener:g,dispatchFieldEvent:y,removeFieldEventListener:_}=yI(),{setCustomComponents:v}=mI(),{setSubmitHandler:b,setWrapInForm:E}=Lk(),{addWarnings:S,performSoftValidation:A,softValidationSchema:x,hardValidationSchema:w,rebuildValidationSchema:T,yupId:M}=$k(),O=function(e={}){const t=U.default.useRef(void 0),n=U.default.useRef(void 0),[r,i]=U.default.useState({isDirty:!1,isValidating:!1,isLoading:Be(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Be(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={..._t(e),formState:r});const a=t.current.control;return a._options=e,De({subject:a._subjects.state,next:e=>{Oe(e,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),U.default.useEffect((()=>a._disableForm(e.disabled)),[a,e.disabled]),U.default.useEffect((()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}}),[a,r.isDirty]),U.default.useEffect((()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,i((e=>({...e})))):a._resetDefaultValues()}),[e.values,a]),U.default.useEffect((()=>{e.errors&&a._setErrors(e.errors)}),[e.errors,a]),U.default.useEffect((()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()})),U.default.useEffect((()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})}),[e.shouldUnregister,a]),t.current.formState=Te(r,a),t.current}({mode:m,reValidateMode:h,defaultValues:d,resolver:async(e,t,n)=>(A(x,e),await function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,s){try{var u=(t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:i}))).then((function(e){return a.shouldUseNativeValidation&&bt({},a),{values:n.rawValues?r:e,errors:{}}})))}catch(e){return s(e)}return u&&u.then?u.then(void 0,s):u}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:Et((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,i=r&&r[t.type];e[t.path]=Fe(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}}(w)(e,t,n))}),{setFormSchema:C}=Ck(),{reset:N,handleSubmit:D,getValues:L,setValue:I,setError:k,trigger:$,formState:R,clearErrors:F}=O,{resetFields:z,setFields:P,getFormValues:j,registeredFields:Z}=Nk(O),B=t.useRef(Z),{checkIsFormValid:V}=((e,n)=>{const{data:r,onChange:i,onValueChange:a}=e,{stripUnknown:o}=r||{},{hardValidationSchema:s}=$k(),{formValidationConfig:u}=Dk(),{watch:c,getValues:l,formState:d,clearErrors:f}=n,{setFields:p,setField:h,getFormValues:m}=Nk(n),[g,y]=t.useState({}),[_,v]=t.useState(!1),b=kk(u),E=kk(s),S=t.useRef(void 0),A=t.useRef(void 0),x=t.useCallback(((e=!1)=>{if(!e)try{return s.validateSync(l()),!0}catch(e){return!1}return(async()=>{try{return await s.validate(l()),!0}catch(e){return!1}})()}),[l,s]),w=t.useRef((async()=>{}));return w.current=async()=>{const e=m(void 0,o),t=await x(!0);a&&Object.keys(u||{}).length&&(A.current===t&&tI(S.current,e)||a(e,t)),S.current=e,A.current=t},t.useEffect((()=>{const e=c(((e,{name:t})=>{t?h(t,e[t]):p(e)}));return()=>e.unsubscribe()}),[]),t.useEffect((()=>{if(i&&Object.keys(u||{}).length){const e=c((async()=>{const e=await x(!0);i(m(void 0,o),e)}));return x(!0).then((e=>i(m(void 0,o),e))),()=>e.unsubscribe()}}),[x,i,c,u]),t.useEffect((()=>{const e=c((async()=>{await w.current()}));return()=>e.unsubscribe()}),[c]),t.useEffect((()=>{if(b){const e=e=>Object.entries(e).map((([e,{validationRules:t}])=>[e,t])),t=e(b),n=e(u);tI(t,n)||v(!0)}}),[u]),t.useEffect((()=>{_&&E!==s&&w.current().then((()=>v(!1)))}),[_,s]),t.useEffect((()=>{const e=d.errors;if(e&&!dE(e)){const e=c((e=>{const t=Object.fromEntries(Object.entries(d.errors).filter((([e,t])=>"api"===t.type)));t&&!dE(t)&&Object.keys(t).forEach((t=>{g[t]!==e[t]&&f(t)})),y(e)}));return()=>e.unsubscribe()}}),[d,c]),{checkIsFormValid:x}})(n,O);t.useImperativeHandle(r,(()=>({addFieldEventListener:g,addCustomValidation:H,dispatchFieldEvent:y,getValues:e=>j(e,p),isDirty:R.isDirty,isValid:V,validate:$,removeFieldEventListener:_,reset:(e,t)=>{N(e,t),z("function"==typeof e?e(O.getValues())??d:e??d)},setErrors:W,clearErrors:F,setWarnings:q,setValue:I,submit:D(G,Y)})));const H=(e,t,n,r=!1)=>{KL.addCondition(e,t,n,M,r),T()},G=t.useCallback((()=>{s?.(j(void 0,p))}),[j,s,p]),Y=t.useCallback((e=>{setTimeout((()=>u?.(e)))}),[u]),W=e=>{Object.entries(e).forEach((([e,t])=>{B.current.includes(e)&&(Array.isArray(t)?k(e,{type:"api",message:t[0]}):k(e,"object"==typeof t?{type:"api",message:JSON.stringify(t)}:{type:"api",message:t}))}))},q=e=>{const t={};Object.entries(e).forEach((([e,n])=>{B.current.includes(e)&&(t[e]=n)})),S(t)};t.useEffect((()=>{P(L())}),[]),_s((()=>{N(ds(d))}),[d]),ys((()=>{C(i)}),[i||{}]),t.useEffect((()=>{v(o)}),[o]),t.useEffect((()=>{b((()=>D(G,Y)))}),[G,Y]),t.useEffect((()=>{E(c)}),[c]),t.useEffect((()=>{B.current=Z}),[Z]);const K=f?`frontend-engine-${f}`:"frontend-engine",J=[a,l].join(" ").trim(),X=c?"form":"div";return i?e.jsx(we,{...O,children:e.jsx(X,{id:K,"data-testid":f?exports.TestHelper.generateId(f,"frontend-engine"):K,className:J,noValidate:!0,onSubmit:D(G,Y),ref:r,children:e.jsx(pU,{})})}):e.jsxs(e.Fragment,{children:["Missing ",e.jsx("code",{children:"data"})," prop, unable to render Frontend Engine."]})})),mU=t.forwardRef(((t,n)=>e.jsx(hI,{recaptchaSiteKey:t.recaptchaSiteKey,children:e.jsx(hU,{...t,ref:n})})));exports.AxiosApiClient=fl,exports.Description=gT,exports.ERROR_MESSAGES=om,exports.FileUploadContext=kz,exports.FrontendEngine=mU,exports.GeolocationPositionErrorWrapper=HZ,exports.ImageContext=jz,exports.OneMapError=UL,exports.OneMapService=jL,exports.Prompt=_T,exports.RecaptchaContext=Ds,exports.Sanitize=RL,exports.commonjsGlobal=St,exports.generateRandomId=um,exports.lodash=FL,exports.useFieldEvent=yI,exports.useFormContext=xe,exports.useFrontendEngineComponent=()=>{const{addFieldEventListener:e,dispatchFieldEvent:t,removeFieldEventListener:n}=yI(),r=xe(),{setFieldValidationConfig:i,removeFieldValidationConfig:a}=Dk();return{event:{addFieldEventListener:e,dispatchFieldEvent:t,removeFieldEventListener:n},formContext:r,validation:{setValidation:i,removeValidation:a}}},exports.usePrevious=kk,exports.useWindowHelper=Rk;
|
|
1146
|
-
//# sourceMappingURL=index.
|
|
1146
|
+
//# sourceMappingURL=index.00d4458f.js.map
|