@web-site-utilities/feedback 0.0.9 → 0.0.10
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/dist/form/features/InPlaceForm/InPlaceForm.d.ts +1 -1
- package/dist/form/features/PopupForm/PopupForm.d.ts +1 -1
- package/dist/index.cjs.js +4082 -58
- package/dist/index.es.js +2823 -1970
- package/dist/index.iife.js +4083 -58
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,1226 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
`,kt=typeof window<"u"&&typeof document<"u",La=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY),Ft=Object.freeze([]),He=Object.freeze({});function Fa(e,t,r){return r===void 0&&(r=He),e.theme!==r.theme&&e.theme||t||r.theme}var xn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),za=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ba=/(^-|-$)/g;function Wr(e){return e.replace(za,"-").replace(Ba,"")}var Ua=/(a)(d)/gi,bt=52,Hr=function(e){return String.fromCharCode(e+(e>25?39:97))};function ur(e){var t,r="";for(t=Math.abs(e);t>bt;t=t/bt|0)r=Hr(t%bt)+r;return(Hr(t%bt)+r).replace(Ua,"$1-$2")}var Qt,Cn=5381,ze=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},An=function(e){return ze(Cn,e)};function Va(e){return ur(An(e)>>>0)}function Wa(e){return e.displayName||e.name||"Component"}function Jt(e){return typeof e=="string"&&!0}var _n=typeof Symbol=="function"&&Symbol.for,In=_n?Symbol.for("react.memo"):60115,Ha=_n?Symbol.for("react.forward_ref"):60112,Ga={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ja={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Rn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ya=((Qt={})[Ha]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Qt[In]=Rn,Qt);function Gr(e){return("type"in(t=e)&&t.type.$$typeof)===In?Rn:"$$typeof"in e?Ya[e.$$typeof]:Ga;var t}var qa=Object.defineProperty,Ka=Object.getOwnPropertyNames,jr=Object.getOwnPropertySymbols,Xa=Object.getOwnPropertyDescriptor,Za=Object.getPrototypeOf,Yr=Object.prototype;function kn(e,t,r){if(typeof t!="string"){if(Yr){var n=Za(t);n&&n!==Yr&&kn(e,n,r)}var a=Ka(t);jr&&(a=a.concat(jr(t)));for(var i=Gr(e),l=Gr(t),d=0;d<a.length;++d){var u=a[d];if(!(u in ja||r&&r[u]||l&&u in l||i&&u in i)){var f=Xa(t,u);try{qa(e,u,f)}catch{}}}}return e}function Ae(e){return typeof e=="function"}function vr(e){return typeof e=="object"&&"styledComponentId"in e}function we(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function qr(e,t){if(e.length===0)return"";for(var r=e[0],n=1;n<e.length;n++)r+=e[n];return r}function lt(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function dr(e,t,r){if(r===void 0&&(r=!1),!r&&!lt(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var n=0;n<t.length;n++)e[n]=dr(e[n],t[n]);else if(lt(t))for(var n in t)e[n]=dr(e[n],t[n]);return e}function Er(e,t){Object.defineProperty(e,"toString",{value:t})}function _e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var Qa=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n<t;n++)r+=this.groupSizes[n];return r},e.prototype.insertRules=function(t,r){if(t>=this.groupSizes.length){for(var n=this.groupSizes,a=n.length,i=a;t>=i;)if((i<<=1)<0)throw _e(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var l=a;l<i;l++)this.groupSizes[l]=0}for(var d=this.indexOfGroup(t+1),u=(l=0,r.length);l<u;l++)this.tag.insertRule(d,r[l])&&(this.groupSizes[t]++,d++)},e.prototype.clearGroup=function(t){if(t<this.length){var r=this.groupSizes[t],n=this.indexOfGroup(t),a=n+r;this.groupSizes[t]=0;for(var i=n;i<a;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(t){var r="";if(t>=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],a=this.indexOfGroup(t),i=a+n,l=a;l<i;l++)r+="".concat(this.tag.getRule(l)).concat(yr);return r},e})(),Ct=new Map,Pt=new Map,At=1,yt=function(e){if(Ct.has(e))return Ct.get(e);for(;Pt.has(At);)At++;var t=At++;return Ct.set(e,t),Pt.set(t,e),t},Ja=function(e,t){At=t+1,Ct.set(e,t),Pt.set(t,e)},eo="style[".concat(We,"][").concat(wn,'="').concat(Lt,'"]'),to=new RegExp("^".concat(We,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ro=function(e,t,r){for(var n,a=r.split(","),i=0,l=a.length;i<l;i++)(n=a[i])&&e.registerName(t,n)},no=function(e,t){for(var r,n=((r=t.textContent)!==null&&r!==void 0?r:"").split(yr),a=[],i=0,l=n.length;i<l;i++){var d=n[i].trim();if(d){var u=d.match(to);if(u){var f=0|parseInt(u[1],10),p=u[2];f!==0&&(Ja(p,f),ro(e,p,u[3]),e.getTag().insertRules(f,a)),a.length=0}else a.push(d)}}},Kr=function(e){for(var t=document.querySelectorAll(eo),r=0,n=t.length;r<n;r++){var a=t[r];a&&a.getAttribute(We)!==Tn&&(no(e,a),a.parentNode&&a.parentNode.removeChild(a))}};function ao(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Pn=function(e){var t=document.head,r=e||t,n=document.createElement("style"),a=(function(d){var u=Array.from(d.querySelectorAll("style[".concat(We,"]")));return u[u.length-1]})(r),i=a!==void 0?a.nextSibling:null;n.setAttribute(We,Tn),n.setAttribute(wn,Lt);var l=ao();return l&&n.setAttribute("nonce",l),r.insertBefore(n,i),n},oo=(function(){function e(t){this.element=Pn(t),this.element.appendChild(document.createTextNode("")),this.sheet=(function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,a=0,i=n.length;a<i;a++){var l=n[a];if(l.ownerNode===r)return l}throw _e(17)})(this.element),this.length=0}return e.prototype.insertRule=function(t,r){try{return this.sheet.insertRule(r,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var r=this.sheet.cssRules[t];return r&&r.cssText?r.cssText:""},e})(),io=(function(){function e(t){this.element=Pn(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,r){if(t<=this.length&&t>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e})(),so=(function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,r){return t<=this.length&&(this.rules.splice(t,0,r),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e})(),Xr=kt,lo={isServer:!kt,useCSSOMInjection:!La},On=(function(){function e(t,r,n){t===void 0&&(t=He),r===void 0&&(r={});var a=this;this.options=H(H({},lo),t),this.gs=r,this.names=new Map(n),this.server=!!t.isServer,!this.server&&kt&&Xr&&(Xr=!1,Kr(this)),Er(this,function(){return(function(i){for(var l=i.getTag(),d=l.length,u="",f=function(T){var w=(function(D){return Pt.get(D)})(T);if(w===void 0)return"continue";var E=i.names.get(w),A=l.getGroup(T);if(E===void 0||!E.size||A.length===0)return"continue";var $="".concat(We,".g").concat(T,'[id="').concat(w,'"]'),G="";E!==void 0&&E.forEach(function(D){D.length>0&&(G+="".concat(D,","))}),u+="".concat(A).concat($,'{content:"').concat(G,'"}').concat(yr)},p=0;p<d;p++)f(p);return u})(a)})}return e.registerId=function(t){return yt(t)},e.prototype.rehydrate=function(){!this.server&&kt&&Kr(this)},e.prototype.reconstructWithOptions=function(t,r){return r===void 0&&(r=!0),new e(H(H({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=(function(r){var n=r.useCSSOMInjection,a=r.target;return r.isServer?new so(a):n?new oo(a):new io(a)})(this.options),new Qa(t)));var t},e.prototype.hasNameForId=function(t,r){return this.names.has(t)&&this.names.get(t).has(r)},e.prototype.registerName=function(t,r){if(yt(t),this.names.has(t))this.names.get(t).add(r);else{var n=new Set;n.add(r),this.names.set(t,n)}},e.prototype.insertRules=function(t,r,n){this.registerName(t,r),this.getTag().insertRules(yt(t),n)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(yt(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e})(),co=/&/g,uo=/^\s*\/\/.*$/gm;function Nn(e,t){return e.map(function(r){return r.type==="rule"&&(r.value="".concat(t," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(t," ")),r.props=r.props.map(function(n){return"".concat(t," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=Nn(r.children,t)),r})}function mo(e){var t,r,n,a=He,i=a.options,l=i===void 0?He:i,d=a.plugins,u=d===void 0?Ft:d,f=function(w,E,A){return A.startsWith(r)&&A.endsWith(r)&&A.replaceAll(r,"").length>0?".".concat(t):w},p=u.slice();p.push(function(w){w.type===Nt&&w.value.includes("&")&&(w.props[0]=w.props[0].replace(co,r).replace(n,f))}),l.prefix&&p.push(Da),p.push(Oa);var T=function(w,E,A,$){E===void 0&&(E=""),A===void 0&&(A=""),$===void 0&&($="&"),t=$,r=E,n=new RegExp("\\".concat(r,"\\b"),"g");var G=w.replace(uo,""),D=ka(A||E?"".concat(A," ").concat(E," { ").concat(G," }"):G);l.namespace&&(D=Nn(D,l.namespace));var P=[];return Rt(D,Na(p.concat($a(function(_){return P.push(_)})))),P};return T.hash=u.length?u.reduce(function(w,E){return E.name||_e(15),ze(w,E.name)},Cn).toString():"",T}var fo=new On,mr=mo(),$n=s.createContext({shouldForwardProp:void 0,styleSheet:fo,stylis:mr});$n.Consumer;s.createContext(void 0);function Zr(){return s.useContext($n)}var ho=(function(){function e(t,r){var n=this;this.inject=function(a,i){i===void 0&&(i=mr);var l=n.name+i.hash;a.hasNameForId(n.id,l)||a.insertRules(n.id,l,i(n.rules,l,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,Er(this,function(){throw _e(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=mr),this.name+t.hash},e})(),po=function(e){return e>="A"&&e<="Z"};function Qr(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(r===1&&n==="-"&&e[0]==="-")return e;po(n)?t+="-"+n.toLowerCase():t+=n}return t.startsWith("ms-")?"-"+t:t}var Dn=function(e){return e==null||e===!1||e===""},Mn=function(e){var t,r,n=[];for(var a in e){var i=e[a];e.hasOwnProperty(a)&&!Dn(i)&&(Array.isArray(i)&&i.isCss||Ae(i)?n.push("".concat(Qr(a),":"),i,";"):lt(i)?n.push.apply(n,It(It(["".concat(a," {")],Mn(i),!1),["}"],!1)):n.push("".concat(Qr(a),": ").concat((t=a,(r=i)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||t in Ma||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function Ce(e,t,r,n){if(Dn(e))return[];if(vr(e))return[".".concat(e.styledComponentId)];if(Ae(e)){if(!Ae(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return[e];var a=e(t);return Ce(a,t,r,n)}var i;return e instanceof ho?r?(e.inject(r,n),[e.getName(n)]):[e]:lt(e)?Mn(e):Array.isArray(e)?Array.prototype.concat.apply(Ft,e.map(function(l){return Ce(l,t,r,n)})):[e.toString()]}function go(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(Ae(r)&&!vr(r))return!1}return!0}var bo=An(Lt),yo=(function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=(n===void 0||n.isStatic)&&go(t),this.componentId=r,this.baseHash=ze(bo,r),this.baseStyle=n,On.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var a=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))a=we(a,this.staticRulesId);else{var i=qr(Ce(this.rules,t,r,n)),l=ur(ze(this.baseHash,i)>>>0);if(!r.hasNameForId(this.componentId,l)){var d=n(i,".".concat(l),void 0,this.componentId);r.insertRules(this.componentId,l,d)}a=we(a,l),this.staticRulesId=l}else{for(var u=ze(this.baseHash,n.hash),f="",p=0;p<this.rules.length;p++){var T=this.rules[p];if(typeof T=="string")f+=T;else if(T){var w=qr(Ce(T,t,r,n));u=ze(u,w+p),f+=w}}if(f){var E=ur(u>>>0);r.hasNameForId(this.componentId,E)||r.insertRules(this.componentId,E,n(f,".".concat(E),void 0,this.componentId)),a=we(a,E)}}return a},e})(),Ot=s.createContext(void 0);Ot.Consumer;function vo(e){var t=s.useContext(Ot),r=s.useMemo(function(){return(function(n,a){if(!n)throw _e(14);if(Ae(n)){var i=n(a);return i}if(Array.isArray(n)||typeof n!="object")throw _e(8);return a?H(H({},a),n):n})(e.theme,t)},[e.theme,t]);return e.children?s.createElement(Ot.Provider,{value:r},e.children):null}var er={};function Eo(e,t,r){var n=vr(e),a=e,i=!Jt(e),l=t.attrs,d=l===void 0?Ft:l,u=t.componentId,f=u===void 0?(function(b,R){var x=typeof b!="string"?"sc":Wr(b);er[x]=(er[x]||0)+1;var y="".concat(x,"-").concat(Va(Lt+x+er[x]));return R?"".concat(R,"-").concat(y):y})(t.displayName,t.parentComponentId):u,p=t.displayName,T=p===void 0?(function(b){return Jt(b)?"styled.".concat(b):"Styled(".concat(Wa(b),")")})(e):p,w=t.displayName&&t.componentId?"".concat(Wr(t.displayName),"-").concat(t.componentId):t.componentId||f,E=n&&a.attrs?a.attrs.concat(d).filter(Boolean):d,A=t.shouldForwardProp;if(n&&a.shouldForwardProp){var $=a.shouldForwardProp;if(t.shouldForwardProp){var G=t.shouldForwardProp;A=function(b,R){return $(b,R)&&G(b,R)}}else A=$}var D=new yo(r,w,n?a.componentStyle:void 0);function P(b,R){return(function(x,y,pe){var Re=x.attrs,zt=x.componentStyle,U=x.defaultProps,Ye=x.foldedComponentIds,qe=x.styledComponentId,Ke=x.target,Bt=s.useContext(Ot),Ut=Zr(),Xe=x.shouldForwardProp||Ut.shouldForwardProp,Ze=Fa(y,Bt,U)||He,J=(function(I,te,ge){for(var be,re=H(H({},te),{className:void 0,theme:ge}),Pe=0;Pe<I.length;Pe+=1){var Ee=Ae(be=I[Pe])?be(re):be;for(var j in Ee)re[j]=j==="className"?we(re[j],Ee[j]):j==="style"?H(H({},re[j]),Ee[j]):Ee[j]}return te.className&&(re.className=we(re.className,te.className)),re})(Re,y,Ze),ve=J.as||Ke,O={};for(var ee in J)J[ee]===void 0||ee[0]==="$"||ee==="as"||ee==="theme"&&J.theme===Ze||(ee==="forwardedAs"?O.as=J.forwardedAs:Xe&&!Xe(ee,ve)||(O[ee]=J[ee]));var M=(function(I,te){var ge=Zr(),be=I.generateAndInjectStyles(te,ge.styleSheet,ge.stylis);return be})(zt,J),ke=we(Ye,qe);return M&&(ke+=" "+M),J.className&&(ke+=" "+J.className),O[Jt(ve)&&!xn.has(ve)?"class":"className"]=ke,pe&&(O.ref=pe),s.createElement(ve,O)})(_,b,R)}P.displayName=T;var _=s.forwardRef(P);return _.attrs=E,_.componentStyle=D,_.displayName=T,_.shouldForwardProp=A,_.foldedComponentIds=n?we(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=w,_.target=n?a.target:e,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=n?(function(R){for(var x=[],y=1;y<arguments.length;y++)x[y-1]=arguments[y];for(var pe=0,Re=x;pe<Re.length;pe++)dr(R,Re[pe],!0);return R})({},a.defaultProps,b):b}}),Er(_,function(){return".".concat(_.styledComponentId)}),i&&kn(_,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Jr(e,t){for(var r=[e[0]],n=0,a=t.length;n<a;n+=1)r.push(t[n],e[n+1]);return r}var en=function(e){return Object.assign(e,{isCss:!0})};function So(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(Ae(e)||lt(e))return en(Ce(Jr(Ft,It([e],t,!0))));var n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?Ce(n):en(Ce(Jr(n,t)))}function fr(e,t,r){if(r===void 0&&(r=He),!t)throw _e(1,t);var n=function(a){for(var i=[],l=1;l<arguments.length;l++)i[l-1]=arguments[l];return e(t,r,So.apply(void 0,It([a],i,!1)))};return n.attrs=function(a){return fr(e,t,H(H({},r),{attrs:Array.prototype.concat(r.attrs,a).filter(Boolean)}))},n.withConfig=function(a){return fr(e,t,H(H({},r),a))},n}var Ln=function(e){return fr(Eo,e)},v=Ln;xn.forEach(function(e){v[e]=Ln(e)});const Be={primary:"#422ad5",primaryContent:"#e0e7ff",secondary:"#f43098",secondaryContent:"#f9e4f0",accent:"#00d3bb",accentContent:"#084d49",neutral:"#09090b",neutralContent:"#e4e4e7",base100:"#ffffff",base200:"#f8f8f8",base300:"#eeeeee",baseContent:"#18181b",info:"#00bafe",infoContent:"#042e49",success:"#00d390",successContent:"#004c39",warning:"#fcb700",warningContent:"#793205",error:"#ff627d",errorContent:"#4d0218",radiusSelectors:"0.25rem",radiusField:"0.25rem",radiusBox:"0.25rem",borderWidth:"1px",fontSize:"1rem",sizeField:".3rem",sizeSelector:".3rem",allFieldsSize:"20rem",spacing:".3rem",depth:1},To={selectedVariant:"primary",getDefaultVariantOrSelected:()=>"primary",...Be},Fn=s.createContext({...Be,...To}),wo=v.div`
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const require$$0 = require("react-dom");
|
|
5
|
+
var client = {};
|
|
6
|
+
var hasRequiredClient;
|
|
7
|
+
function requireClient() {
|
|
8
|
+
if (hasRequiredClient) return client;
|
|
9
|
+
hasRequiredClient = 1;
|
|
10
|
+
var m2 = require$$0;
|
|
11
|
+
{
|
|
12
|
+
client.createRoot = m2.createRoot;
|
|
13
|
+
client.hydrateRoot = m2.hydrateRoot;
|
|
14
|
+
}
|
|
15
|
+
return client;
|
|
16
|
+
}
|
|
17
|
+
var clientExports = requireClient();
|
|
18
|
+
var __assign = function() {
|
|
19
|
+
__assign = Object.assign || function __assign2(t) {
|
|
20
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
+
s = arguments[i];
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
function __spreadArray(to, from2, pack) {
|
|
29
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from2.length, ar; i < l; i++) {
|
|
30
|
+
if (ar || !(i in from2)) {
|
|
31
|
+
if (!ar) ar = Array.prototype.slice.call(from2, 0, i);
|
|
32
|
+
ar[i] = from2[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return to.concat(ar || Array.prototype.slice.call(from2));
|
|
36
|
+
}
|
|
37
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
38
|
+
var e = new Error(message);
|
|
39
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
40
|
+
};
|
|
41
|
+
var MS = "-ms-";
|
|
42
|
+
var MOZ = "-moz-";
|
|
43
|
+
var WEBKIT = "-webkit-";
|
|
44
|
+
var COMMENT = "comm";
|
|
45
|
+
var RULESET = "rule";
|
|
46
|
+
var DECLARATION = "decl";
|
|
47
|
+
var IMPORT = "@import";
|
|
48
|
+
var KEYFRAMES = "@keyframes";
|
|
49
|
+
var LAYER = "@layer";
|
|
50
|
+
var abs = Math.abs;
|
|
51
|
+
var from = String.fromCharCode;
|
|
52
|
+
var assign = Object.assign;
|
|
53
|
+
function hash(value, length2) {
|
|
54
|
+
return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
55
|
+
}
|
|
56
|
+
function trim(value) {
|
|
57
|
+
return value.trim();
|
|
58
|
+
}
|
|
59
|
+
function match(value, pattern) {
|
|
60
|
+
return (value = pattern.exec(value)) ? value[0] : value;
|
|
61
|
+
}
|
|
62
|
+
function replace(value, pattern, replacement) {
|
|
63
|
+
return value.replace(pattern, replacement);
|
|
64
|
+
}
|
|
65
|
+
function indexof(value, search, position2) {
|
|
66
|
+
return value.indexOf(search, position2);
|
|
67
|
+
}
|
|
68
|
+
function charat(value, index) {
|
|
69
|
+
return value.charCodeAt(index) | 0;
|
|
70
|
+
}
|
|
71
|
+
function substr(value, begin, end) {
|
|
72
|
+
return value.slice(begin, end);
|
|
73
|
+
}
|
|
74
|
+
function strlen(value) {
|
|
75
|
+
return value.length;
|
|
76
|
+
}
|
|
77
|
+
function sizeof(value) {
|
|
78
|
+
return value.length;
|
|
79
|
+
}
|
|
80
|
+
function append(value, array) {
|
|
81
|
+
return array.push(value), value;
|
|
82
|
+
}
|
|
83
|
+
function combine(array, callback) {
|
|
84
|
+
return array.map(callback).join("");
|
|
85
|
+
}
|
|
86
|
+
function filter(array, pattern) {
|
|
87
|
+
return array.filter(function(value) {
|
|
88
|
+
return !match(value, pattern);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
var line = 1;
|
|
92
|
+
var column = 1;
|
|
93
|
+
var length = 0;
|
|
94
|
+
var position = 0;
|
|
95
|
+
var character = 0;
|
|
96
|
+
var characters = "";
|
|
97
|
+
function node(value, root, parent, type, props, children, length2, siblings) {
|
|
98
|
+
return { value, root, parent, type, props, children, line, column, length: length2, return: "", siblings };
|
|
99
|
+
}
|
|
100
|
+
function copy(root, props) {
|
|
101
|
+
return assign(node("", null, null, "", null, null, 0, root.siblings), root, { length: -root.length }, props);
|
|
102
|
+
}
|
|
103
|
+
function lift(root) {
|
|
104
|
+
while (root.root)
|
|
105
|
+
root = copy(root.root, { children: [root] });
|
|
106
|
+
append(root, root.siblings);
|
|
107
|
+
}
|
|
108
|
+
function char() {
|
|
109
|
+
return character;
|
|
110
|
+
}
|
|
111
|
+
function prev() {
|
|
112
|
+
character = position > 0 ? charat(characters, --position) : 0;
|
|
113
|
+
if (column--, character === 10)
|
|
114
|
+
column = 1, line--;
|
|
115
|
+
return character;
|
|
116
|
+
}
|
|
117
|
+
function next() {
|
|
118
|
+
character = position < length ? charat(characters, position++) : 0;
|
|
119
|
+
if (column++, character === 10)
|
|
120
|
+
column = 1, line++;
|
|
121
|
+
return character;
|
|
122
|
+
}
|
|
123
|
+
function peek() {
|
|
124
|
+
return charat(characters, position);
|
|
125
|
+
}
|
|
126
|
+
function caret() {
|
|
127
|
+
return position;
|
|
128
|
+
}
|
|
129
|
+
function slice(begin, end) {
|
|
130
|
+
return substr(characters, begin, end);
|
|
131
|
+
}
|
|
132
|
+
function token(type) {
|
|
133
|
+
switch (type) {
|
|
134
|
+
// \0 \t \n \r \s whitespace token
|
|
135
|
+
case 0:
|
|
136
|
+
case 9:
|
|
137
|
+
case 10:
|
|
138
|
+
case 13:
|
|
139
|
+
case 32:
|
|
140
|
+
return 5;
|
|
141
|
+
// ! + , / > @ ~ isolate token
|
|
142
|
+
case 33:
|
|
143
|
+
case 43:
|
|
144
|
+
case 44:
|
|
145
|
+
case 47:
|
|
146
|
+
case 62:
|
|
147
|
+
case 64:
|
|
148
|
+
case 126:
|
|
149
|
+
// ; { } breakpoint token
|
|
150
|
+
case 59:
|
|
151
|
+
case 123:
|
|
152
|
+
case 125:
|
|
153
|
+
return 4;
|
|
154
|
+
// : accompanied token
|
|
155
|
+
case 58:
|
|
156
|
+
return 3;
|
|
157
|
+
// " ' ( [ opening delimit token
|
|
158
|
+
case 34:
|
|
159
|
+
case 39:
|
|
160
|
+
case 40:
|
|
161
|
+
case 91:
|
|
162
|
+
return 2;
|
|
163
|
+
// ) ] closing delimit token
|
|
164
|
+
case 41:
|
|
165
|
+
case 93:
|
|
166
|
+
return 1;
|
|
167
|
+
}
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
function alloc(value) {
|
|
171
|
+
return line = column = 1, length = strlen(characters = value), position = 0, [];
|
|
172
|
+
}
|
|
173
|
+
function dealloc(value) {
|
|
174
|
+
return characters = "", value;
|
|
175
|
+
}
|
|
176
|
+
function delimit(type) {
|
|
177
|
+
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
178
|
+
}
|
|
179
|
+
function whitespace(type) {
|
|
180
|
+
while (character = peek())
|
|
181
|
+
if (character < 33)
|
|
182
|
+
next();
|
|
183
|
+
else
|
|
184
|
+
break;
|
|
185
|
+
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
186
|
+
}
|
|
187
|
+
function escaping(index, count) {
|
|
188
|
+
while (--count && next())
|
|
189
|
+
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
|
|
190
|
+
break;
|
|
191
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
192
|
+
}
|
|
193
|
+
function delimiter(type) {
|
|
194
|
+
while (next())
|
|
195
|
+
switch (character) {
|
|
196
|
+
// ] ) " '
|
|
197
|
+
case type:
|
|
198
|
+
return position;
|
|
199
|
+
// " '
|
|
200
|
+
case 34:
|
|
201
|
+
case 39:
|
|
202
|
+
if (type !== 34 && type !== 39)
|
|
203
|
+
delimiter(character);
|
|
204
|
+
break;
|
|
205
|
+
// (
|
|
206
|
+
case 40:
|
|
207
|
+
if (type === 41)
|
|
208
|
+
delimiter(type);
|
|
209
|
+
break;
|
|
210
|
+
// \
|
|
211
|
+
case 92:
|
|
212
|
+
next();
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
return position;
|
|
216
|
+
}
|
|
217
|
+
function commenter(type, index) {
|
|
218
|
+
while (next())
|
|
219
|
+
if (type + character === 47 + 10)
|
|
220
|
+
break;
|
|
221
|
+
else if (type + character === 42 + 42 && peek() === 47)
|
|
222
|
+
break;
|
|
223
|
+
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
|
|
224
|
+
}
|
|
225
|
+
function identifier(index) {
|
|
226
|
+
while (!token(peek()))
|
|
227
|
+
next();
|
|
228
|
+
return slice(index, position);
|
|
229
|
+
}
|
|
230
|
+
function compile(value) {
|
|
231
|
+
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
|
232
|
+
}
|
|
233
|
+
function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
234
|
+
var index = 0;
|
|
235
|
+
var offset = 0;
|
|
236
|
+
var length2 = pseudo;
|
|
237
|
+
var atrule = 0;
|
|
238
|
+
var property = 0;
|
|
239
|
+
var previous = 0;
|
|
240
|
+
var variable = 1;
|
|
241
|
+
var scanning = 1;
|
|
242
|
+
var ampersand = 1;
|
|
243
|
+
var character2 = 0;
|
|
244
|
+
var type = "";
|
|
245
|
+
var props = rules;
|
|
246
|
+
var children = rulesets;
|
|
247
|
+
var reference = rule;
|
|
248
|
+
var characters2 = type;
|
|
249
|
+
while (scanning)
|
|
250
|
+
switch (previous = character2, character2 = next()) {
|
|
251
|
+
// (
|
|
252
|
+
case 40:
|
|
253
|
+
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
254
|
+
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index ? points[index - 1] : 0)) != -1)
|
|
255
|
+
ampersand = -1;
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
// " ' [
|
|
259
|
+
case 34:
|
|
260
|
+
case 39:
|
|
261
|
+
case 91:
|
|
262
|
+
characters2 += delimit(character2);
|
|
263
|
+
break;
|
|
264
|
+
// \t \n \r \s
|
|
265
|
+
case 9:
|
|
266
|
+
case 10:
|
|
267
|
+
case 13:
|
|
268
|
+
case 32:
|
|
269
|
+
characters2 += whitespace(previous);
|
|
270
|
+
break;
|
|
271
|
+
// \
|
|
272
|
+
case 92:
|
|
273
|
+
characters2 += escaping(caret() - 1, 7);
|
|
274
|
+
continue;
|
|
275
|
+
// /
|
|
276
|
+
case 47:
|
|
277
|
+
switch (peek()) {
|
|
278
|
+
case 42:
|
|
279
|
+
case 47:
|
|
280
|
+
append(comment(commenter(next(), caret()), root, parent, declarations), declarations);
|
|
281
|
+
break;
|
|
282
|
+
default:
|
|
283
|
+
characters2 += "/";
|
|
284
|
+
}
|
|
285
|
+
break;
|
|
286
|
+
// {
|
|
287
|
+
case 123 * variable:
|
|
288
|
+
points[index++] = strlen(characters2) * ampersand;
|
|
289
|
+
// } ; \0
|
|
290
|
+
case 125 * variable:
|
|
291
|
+
case 59:
|
|
292
|
+
case 0:
|
|
293
|
+
switch (character2) {
|
|
294
|
+
// \0 }
|
|
295
|
+
case 0:
|
|
296
|
+
case 125:
|
|
297
|
+
scanning = 0;
|
|
298
|
+
// ;
|
|
299
|
+
case 59 + offset:
|
|
300
|
+
if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
|
|
301
|
+
if (property > 0 && strlen(characters2) - length2)
|
|
302
|
+
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations);
|
|
303
|
+
break;
|
|
304
|
+
// @ ;
|
|
305
|
+
case 59:
|
|
306
|
+
characters2 += ";";
|
|
307
|
+
// { rule/at-rule
|
|
308
|
+
default:
|
|
309
|
+
append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2, rulesets), rulesets);
|
|
310
|
+
if (character2 === 123)
|
|
311
|
+
if (offset === 0)
|
|
312
|
+
parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
|
|
313
|
+
else
|
|
314
|
+
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
315
|
+
// d l m s
|
|
316
|
+
case 100:
|
|
317
|
+
case 108:
|
|
318
|
+
case 109:
|
|
319
|
+
case 115:
|
|
320
|
+
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2, children), children), rules, children, length2, points, rule ? props : children);
|
|
321
|
+
break;
|
|
322
|
+
default:
|
|
323
|
+
parse(characters2, reference, reference, reference, [""], children, 0, points, children);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
327
|
+
break;
|
|
328
|
+
// :
|
|
329
|
+
case 58:
|
|
330
|
+
length2 = 1 + strlen(characters2), property = previous;
|
|
331
|
+
default:
|
|
332
|
+
if (variable < 1) {
|
|
333
|
+
if (character2 == 123)
|
|
334
|
+
--variable;
|
|
335
|
+
else if (character2 == 125 && variable++ == 0 && prev() == 125)
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
switch (characters2 += from(character2), character2 * variable) {
|
|
339
|
+
// &
|
|
340
|
+
case 38:
|
|
341
|
+
ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
|
342
|
+
break;
|
|
343
|
+
// ,
|
|
344
|
+
case 44:
|
|
345
|
+
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
346
|
+
break;
|
|
347
|
+
// @
|
|
348
|
+
case 64:
|
|
349
|
+
if (peek() === 45)
|
|
350
|
+
characters2 += delimit(next());
|
|
351
|
+
atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
352
|
+
break;
|
|
353
|
+
// -
|
|
354
|
+
case 45:
|
|
355
|
+
if (previous === 45 && strlen(characters2) == 2)
|
|
356
|
+
variable = 0;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return rulesets;
|
|
360
|
+
}
|
|
361
|
+
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2, siblings) {
|
|
362
|
+
var post = offset - 1;
|
|
363
|
+
var rule = offset === 0 ? rules : [""];
|
|
364
|
+
var size = sizeof(rule);
|
|
365
|
+
for (var i = 0, j2 = 0, k2 = 0; i < index; ++i)
|
|
366
|
+
for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i])), z2 = value; x2 < size; ++x2)
|
|
367
|
+
if (z2 = trim(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
|
|
368
|
+
props[k2++] = z2;
|
|
369
|
+
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2, siblings);
|
|
370
|
+
}
|
|
371
|
+
function comment(value, root, parent, siblings) {
|
|
372
|
+
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings);
|
|
373
|
+
}
|
|
374
|
+
function declaration(value, root, parent, length2, siblings) {
|
|
375
|
+
return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings);
|
|
376
|
+
}
|
|
377
|
+
function prefix(value, length2, children) {
|
|
378
|
+
switch (hash(value, length2)) {
|
|
379
|
+
// color-adjust
|
|
380
|
+
case 5103:
|
|
381
|
+
return WEBKIT + "print-" + value + value;
|
|
382
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
383
|
+
case 5737:
|
|
384
|
+
case 4201:
|
|
385
|
+
case 3177:
|
|
386
|
+
case 3433:
|
|
387
|
+
case 1641:
|
|
388
|
+
case 4457:
|
|
389
|
+
case 2921:
|
|
390
|
+
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
391
|
+
case 5572:
|
|
392
|
+
case 6356:
|
|
393
|
+
case 5844:
|
|
394
|
+
case 3191:
|
|
395
|
+
case 6645:
|
|
396
|
+
case 3005:
|
|
397
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
398
|
+
case 6391:
|
|
399
|
+
case 5879:
|
|
400
|
+
case 5623:
|
|
401
|
+
case 6135:
|
|
402
|
+
case 4599:
|
|
403
|
+
case 4855:
|
|
404
|
+
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
405
|
+
case 4215:
|
|
406
|
+
case 6389:
|
|
407
|
+
case 5109:
|
|
408
|
+
case 5365:
|
|
409
|
+
case 5621:
|
|
410
|
+
case 3829:
|
|
411
|
+
return WEBKIT + value + value;
|
|
412
|
+
// tab-size
|
|
413
|
+
case 4789:
|
|
414
|
+
return MOZ + value + value;
|
|
415
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
416
|
+
case 5349:
|
|
417
|
+
case 4246:
|
|
418
|
+
case 4810:
|
|
419
|
+
case 6968:
|
|
420
|
+
case 2756:
|
|
421
|
+
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
422
|
+
// writing-mode
|
|
423
|
+
case 5936:
|
|
424
|
+
switch (charat(value, length2 + 11)) {
|
|
425
|
+
// vertical-l(r)
|
|
426
|
+
case 114:
|
|
427
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
428
|
+
// vertical-r(l)
|
|
429
|
+
case 108:
|
|
430
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
431
|
+
// horizontal(-)tb
|
|
432
|
+
case 45:
|
|
433
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
434
|
+
}
|
|
435
|
+
// flex, flex-direction, scroll-snap-type, writing-mode
|
|
436
|
+
case 6828:
|
|
437
|
+
case 4268:
|
|
438
|
+
case 2903:
|
|
439
|
+
return WEBKIT + value + MS + value + value;
|
|
440
|
+
// order
|
|
441
|
+
case 6165:
|
|
442
|
+
return WEBKIT + value + MS + "flex-" + value + value;
|
|
443
|
+
// align-items
|
|
444
|
+
case 5187:
|
|
445
|
+
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
446
|
+
// align-self
|
|
447
|
+
case 5443:
|
|
448
|
+
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (!match(value, /flex-|baseline/) ? MS + "grid-row-" + replace(value, /flex-|-self/g, "") : "") + value;
|
|
449
|
+
// align-content
|
|
450
|
+
case 4675:
|
|
451
|
+
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value;
|
|
452
|
+
// flex-shrink
|
|
453
|
+
case 5548:
|
|
454
|
+
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
455
|
+
// flex-basis
|
|
456
|
+
case 5292:
|
|
457
|
+
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
458
|
+
// flex-grow
|
|
459
|
+
case 6060:
|
|
460
|
+
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
461
|
+
// transition
|
|
462
|
+
case 4554:
|
|
463
|
+
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
464
|
+
// cursor
|
|
465
|
+
case 6187:
|
|
466
|
+
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
467
|
+
// background, background-image
|
|
468
|
+
case 5495:
|
|
469
|
+
case 3959:
|
|
470
|
+
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
471
|
+
// justify-content
|
|
472
|
+
case 4968:
|
|
473
|
+
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
474
|
+
// justify-self
|
|
475
|
+
case 4200:
|
|
476
|
+
if (!match(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length2) + value;
|
|
477
|
+
break;
|
|
478
|
+
// grid-template-(columns|rows)
|
|
479
|
+
case 2592:
|
|
480
|
+
case 3360:
|
|
481
|
+
return MS + replace(value, "template-", "") + value;
|
|
482
|
+
// grid-(row|column)-start
|
|
483
|
+
case 4384:
|
|
484
|
+
case 3616:
|
|
485
|
+
if (children && children.some(function(element, index) {
|
|
486
|
+
return length2 = index, match(element.props, /grid-\w+-end/);
|
|
487
|
+
})) {
|
|
488
|
+
return ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ";";
|
|
489
|
+
}
|
|
490
|
+
return MS + replace(value, "-start", "") + value;
|
|
491
|
+
// grid-(row|column)-end
|
|
492
|
+
case 4896:
|
|
493
|
+
case 4128:
|
|
494
|
+
return children && children.some(function(element) {
|
|
495
|
+
return match(element.props, /grid-\w+-start/);
|
|
496
|
+
}) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value;
|
|
497
|
+
// (margin|padding)-inline-(start|end)
|
|
498
|
+
case 4095:
|
|
499
|
+
case 3583:
|
|
500
|
+
case 4068:
|
|
501
|
+
case 2532:
|
|
502
|
+
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
503
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
504
|
+
case 8116:
|
|
505
|
+
case 7059:
|
|
506
|
+
case 5753:
|
|
507
|
+
case 5535:
|
|
508
|
+
case 5445:
|
|
509
|
+
case 5701:
|
|
510
|
+
case 4933:
|
|
511
|
+
case 4677:
|
|
512
|
+
case 5533:
|
|
513
|
+
case 5789:
|
|
514
|
+
case 5021:
|
|
515
|
+
case 4765:
|
|
516
|
+
if (strlen(value) - 1 - length2 > 6)
|
|
517
|
+
switch (charat(value, length2 + 1)) {
|
|
518
|
+
// (m)ax-content, (m)in-content
|
|
519
|
+
case 109:
|
|
520
|
+
if (charat(value, length2 + 4) !== 45)
|
|
521
|
+
break;
|
|
522
|
+
// (f)ill-available, (f)it-content
|
|
523
|
+
case 102:
|
|
524
|
+
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
525
|
+
// (s)tretch
|
|
526
|
+
case 115:
|
|
527
|
+
return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length2, children) + value : value;
|
|
528
|
+
}
|
|
529
|
+
break;
|
|
530
|
+
// grid-(column|row)
|
|
531
|
+
case 5152:
|
|
532
|
+
case 5920:
|
|
533
|
+
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a, b, c, d, e, f2) {
|
|
534
|
+
return MS + a + ":" + b + f2 + (c ? MS + a + "-span:" + (d ? e : +e - +b) + f2 : "") + value;
|
|
535
|
+
});
|
|
536
|
+
// position: sticky
|
|
537
|
+
case 4949:
|
|
538
|
+
if (charat(value, length2 + 6) === 121)
|
|
539
|
+
return replace(value, ":", ":" + WEBKIT) + value;
|
|
540
|
+
break;
|
|
541
|
+
// display: (flex|inline-flex|grid|inline-grid)
|
|
542
|
+
case 6444:
|
|
543
|
+
switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {
|
|
544
|
+
// (inline-)?fle(x)
|
|
545
|
+
case 120:
|
|
546
|
+
return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
547
|
+
// (inline-)?gri(d)
|
|
548
|
+
case 100:
|
|
549
|
+
return replace(value, ":", ":" + MS) + value;
|
|
550
|
+
}
|
|
551
|
+
break;
|
|
552
|
+
// scroll-margin, scroll-margin-(top|right|bottom|left)
|
|
553
|
+
case 5719:
|
|
554
|
+
case 2647:
|
|
555
|
+
case 2135:
|
|
556
|
+
case 3927:
|
|
557
|
+
case 2391:
|
|
558
|
+
return replace(value, "scroll-", "scroll-snap-") + value;
|
|
559
|
+
}
|
|
560
|
+
return value;
|
|
561
|
+
}
|
|
562
|
+
function serialize(children, callback) {
|
|
563
|
+
var output = "";
|
|
564
|
+
for (var i = 0; i < children.length; i++)
|
|
565
|
+
output += callback(children[i], i, children, callback) || "";
|
|
566
|
+
return output;
|
|
567
|
+
}
|
|
568
|
+
function stringify(element, index, children, callback) {
|
|
569
|
+
switch (element.type) {
|
|
570
|
+
case LAYER:
|
|
571
|
+
if (element.children.length) break;
|
|
572
|
+
case IMPORT:
|
|
573
|
+
case DECLARATION:
|
|
574
|
+
return element.return = element.return || element.value;
|
|
575
|
+
case COMMENT:
|
|
576
|
+
return "";
|
|
577
|
+
case KEYFRAMES:
|
|
578
|
+
return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
579
|
+
case RULESET:
|
|
580
|
+
if (!strlen(element.value = element.props.join(","))) return "";
|
|
581
|
+
}
|
|
582
|
+
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
583
|
+
}
|
|
584
|
+
function middleware(collection) {
|
|
585
|
+
var length2 = sizeof(collection);
|
|
586
|
+
return function(element, index, children, callback) {
|
|
587
|
+
var output = "";
|
|
588
|
+
for (var i = 0; i < length2; i++)
|
|
589
|
+
output += collection[i](element, index, children, callback) || "";
|
|
590
|
+
return output;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
function rulesheet(callback) {
|
|
594
|
+
return function(element) {
|
|
595
|
+
if (!element.root) {
|
|
596
|
+
if (element = element.return)
|
|
597
|
+
callback(element);
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
function prefixer(element, index, children, callback) {
|
|
602
|
+
if (element.length > -1) {
|
|
603
|
+
if (!element.return)
|
|
604
|
+
switch (element.type) {
|
|
605
|
+
case DECLARATION:
|
|
606
|
+
element.return = prefix(element.value, element.length, children);
|
|
607
|
+
return;
|
|
608
|
+
case KEYFRAMES:
|
|
609
|
+
return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
|
|
610
|
+
case RULESET:
|
|
611
|
+
if (element.length)
|
|
612
|
+
return combine(children = element.props, function(value) {
|
|
613
|
+
switch (match(value, callback = /(::plac\w+|:read-\w+)/)) {
|
|
614
|
+
// :read-(only|write)
|
|
615
|
+
case ":read-only":
|
|
616
|
+
case ":read-write":
|
|
617
|
+
lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] }));
|
|
618
|
+
lift(copy(element, { props: [value] }));
|
|
619
|
+
assign(element, { props: filter(children, callback) });
|
|
620
|
+
break;
|
|
621
|
+
// :placeholder
|
|
622
|
+
case "::placeholder":
|
|
623
|
+
lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] }));
|
|
624
|
+
lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] }));
|
|
625
|
+
lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] }));
|
|
626
|
+
lift(copy(element, { props: [value] }));
|
|
627
|
+
assign(element, { props: filter(children, callback) });
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
return "";
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
var unitlessKeys = {
|
|
636
|
+
animationIterationCount: 1,
|
|
637
|
+
aspectRatio: 1,
|
|
638
|
+
borderImageOutset: 1,
|
|
639
|
+
borderImageSlice: 1,
|
|
640
|
+
borderImageWidth: 1,
|
|
641
|
+
boxFlex: 1,
|
|
642
|
+
boxFlexGroup: 1,
|
|
643
|
+
boxOrdinalGroup: 1,
|
|
644
|
+
columnCount: 1,
|
|
645
|
+
columns: 1,
|
|
646
|
+
flex: 1,
|
|
647
|
+
flexGrow: 1,
|
|
648
|
+
flexPositive: 1,
|
|
649
|
+
flexShrink: 1,
|
|
650
|
+
flexNegative: 1,
|
|
651
|
+
flexOrder: 1,
|
|
652
|
+
gridRow: 1,
|
|
653
|
+
gridRowEnd: 1,
|
|
654
|
+
gridRowSpan: 1,
|
|
655
|
+
gridRowStart: 1,
|
|
656
|
+
gridColumn: 1,
|
|
657
|
+
gridColumnEnd: 1,
|
|
658
|
+
gridColumnSpan: 1,
|
|
659
|
+
gridColumnStart: 1,
|
|
660
|
+
msGridRow: 1,
|
|
661
|
+
msGridRowSpan: 1,
|
|
662
|
+
msGridColumn: 1,
|
|
663
|
+
msGridColumnSpan: 1,
|
|
664
|
+
fontWeight: 1,
|
|
665
|
+
lineHeight: 1,
|
|
666
|
+
opacity: 1,
|
|
667
|
+
order: 1,
|
|
668
|
+
orphans: 1,
|
|
669
|
+
tabSize: 1,
|
|
670
|
+
widows: 1,
|
|
671
|
+
zIndex: 1,
|
|
672
|
+
zoom: 1,
|
|
673
|
+
WebkitLineClamp: 1,
|
|
674
|
+
// SVG-related properties
|
|
675
|
+
fillOpacity: 1,
|
|
676
|
+
floodOpacity: 1,
|
|
677
|
+
stopOpacity: 1,
|
|
678
|
+
strokeDasharray: 1,
|
|
679
|
+
strokeDashoffset: 1,
|
|
680
|
+
strokeMiterlimit: 1,
|
|
681
|
+
strokeOpacity: 1,
|
|
682
|
+
strokeWidth: 1
|
|
683
|
+
};
|
|
684
|
+
var f = "undefined" != typeof process && void 0 !== process.env && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", m = "active", y = "data-styled-version", v = "6.1.19", g = "/*!sc*/\n", S = "undefined" != typeof window && "undefined" != typeof document, w = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env && void 0 !== process.env.REACT_APP_SC_DISABLE_SPEEDY && "" !== process.env.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== process.env.REACT_APP_SC_DISABLE_SPEEDY && process.env.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env && void 0 !== process.env.SC_DISABLE_SPEEDY && "" !== process.env.SC_DISABLE_SPEEDY ? "false" !== process.env.SC_DISABLE_SPEEDY && process.env.SC_DISABLE_SPEEDY : false), _ = Object.freeze([]), C = Object.freeze({});
|
|
685
|
+
function I(e2, t2, n2) {
|
|
686
|
+
return void 0 === n2 && (n2 = C), e2.theme !== n2.theme && e2.theme || t2 || n2.theme;
|
|
687
|
+
}
|
|
688
|
+
var A = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), O = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, D = /(^-|-$)/g;
|
|
689
|
+
function R(e2) {
|
|
690
|
+
return e2.replace(O, "-").replace(D, "");
|
|
691
|
+
}
|
|
692
|
+
var T = /(a)(d)/gi, k = 52, j = function(e2) {
|
|
693
|
+
return String.fromCharCode(e2 + (e2 > 25 ? 39 : 97));
|
|
694
|
+
};
|
|
695
|
+
function x(e2) {
|
|
696
|
+
var t2, n2 = "";
|
|
697
|
+
for (t2 = Math.abs(e2); t2 > k; t2 = t2 / k | 0) n2 = j(t2 % k) + n2;
|
|
698
|
+
return (j(t2 % k) + n2).replace(T, "$1-$2");
|
|
699
|
+
}
|
|
700
|
+
var V, F = 5381, M = function(e2, t2) {
|
|
701
|
+
for (var n2 = t2.length; n2; ) e2 = 33 * e2 ^ t2.charCodeAt(--n2);
|
|
702
|
+
return e2;
|
|
703
|
+
}, z = function(e2) {
|
|
704
|
+
return M(F, e2);
|
|
705
|
+
};
|
|
706
|
+
function $(e2) {
|
|
707
|
+
return x(z(e2) >>> 0);
|
|
708
|
+
}
|
|
709
|
+
function B(e2) {
|
|
710
|
+
return e2.displayName || e2.name || "Component";
|
|
711
|
+
}
|
|
712
|
+
function L(e2) {
|
|
713
|
+
return "string" == typeof e2 && true;
|
|
714
|
+
}
|
|
715
|
+
var G = "function" == typeof Symbol && Symbol.for, Y = G ? Symbol.for("react.memo") : 60115, W = G ? Symbol.for("react.forward_ref") : 60112, q = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }, H = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }, U = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }, J = ((V = {})[W] = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }, V[Y] = U, V);
|
|
716
|
+
function X(e2) {
|
|
717
|
+
return ("type" in (t2 = e2) && t2.type.$$typeof) === Y ? U : "$$typeof" in e2 ? J[e2.$$typeof] : q;
|
|
718
|
+
var t2;
|
|
719
|
+
}
|
|
720
|
+
var Z = Object.defineProperty, K = Object.getOwnPropertyNames, Q = Object.getOwnPropertySymbols, ee = Object.getOwnPropertyDescriptor, te = Object.getPrototypeOf, ne = Object.prototype;
|
|
721
|
+
function oe(e2, t2, n2) {
|
|
722
|
+
if ("string" != typeof t2) {
|
|
723
|
+
if (ne) {
|
|
724
|
+
var o2 = te(t2);
|
|
725
|
+
o2 && o2 !== ne && oe(e2, o2, n2);
|
|
726
|
+
}
|
|
727
|
+
var r2 = K(t2);
|
|
728
|
+
Q && (r2 = r2.concat(Q(t2)));
|
|
729
|
+
for (var s2 = X(e2), i2 = X(t2), a2 = 0; a2 < r2.length; ++a2) {
|
|
730
|
+
var c2 = r2[a2];
|
|
731
|
+
if (!(c2 in H || n2 && n2[c2] || i2 && c2 in i2 || s2 && c2 in s2)) {
|
|
732
|
+
var l2 = ee(t2, c2);
|
|
733
|
+
try {
|
|
734
|
+
Z(e2, c2, l2);
|
|
735
|
+
} catch (e3) {
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return e2;
|
|
741
|
+
}
|
|
742
|
+
function re(e2) {
|
|
743
|
+
return "function" == typeof e2;
|
|
744
|
+
}
|
|
745
|
+
function se(e2) {
|
|
746
|
+
return "object" == typeof e2 && "styledComponentId" in e2;
|
|
747
|
+
}
|
|
748
|
+
function ie(e2, t2) {
|
|
749
|
+
return e2 && t2 ? "".concat(e2, " ").concat(t2) : e2 || t2 || "";
|
|
750
|
+
}
|
|
751
|
+
function ae(e2, t2) {
|
|
752
|
+
if (0 === e2.length) return "";
|
|
753
|
+
for (var n2 = e2[0], o2 = 1; o2 < e2.length; o2++) n2 += e2[o2];
|
|
754
|
+
return n2;
|
|
755
|
+
}
|
|
756
|
+
function ce(e2) {
|
|
757
|
+
return null !== e2 && "object" == typeof e2 && e2.constructor.name === Object.name && !("props" in e2 && e2.$$typeof);
|
|
758
|
+
}
|
|
759
|
+
function le(e2, t2, n2) {
|
|
760
|
+
if (void 0 === n2 && (n2 = false), !n2 && !ce(e2) && !Array.isArray(e2)) return t2;
|
|
761
|
+
if (Array.isArray(t2)) for (var o2 = 0; o2 < t2.length; o2++) e2[o2] = le(e2[o2], t2[o2]);
|
|
762
|
+
else if (ce(t2)) for (var o2 in t2) e2[o2] = le(e2[o2], t2[o2]);
|
|
763
|
+
return e2;
|
|
764
|
+
}
|
|
765
|
+
function ue(e2, t2) {
|
|
766
|
+
Object.defineProperty(e2, "toString", { value: t2 });
|
|
767
|
+
}
|
|
768
|
+
function he(t2) {
|
|
769
|
+
for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2];
|
|
770
|
+
return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t2, " for more information.").concat(n2.length > 0 ? " Args: ".concat(n2.join(", ")) : ""));
|
|
771
|
+
}
|
|
772
|
+
var fe = (function() {
|
|
773
|
+
function e2(e3) {
|
|
774
|
+
this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e3;
|
|
775
|
+
}
|
|
776
|
+
return e2.prototype.indexOfGroup = function(e3) {
|
|
777
|
+
for (var t2 = 0, n2 = 0; n2 < e3; n2++) t2 += this.groupSizes[n2];
|
|
778
|
+
return t2;
|
|
779
|
+
}, e2.prototype.insertRules = function(e3, t2) {
|
|
780
|
+
if (e3 >= this.groupSizes.length) {
|
|
781
|
+
for (var n2 = this.groupSizes, o2 = n2.length, r2 = o2; e3 >= r2; ) if ((r2 <<= 1) < 0) throw he(16, "".concat(e3));
|
|
782
|
+
this.groupSizes = new Uint32Array(r2), this.groupSizes.set(n2), this.length = r2;
|
|
783
|
+
for (var s2 = o2; s2 < r2; s2++) this.groupSizes[s2] = 0;
|
|
784
|
+
}
|
|
785
|
+
for (var i2 = this.indexOfGroup(e3 + 1), a2 = (s2 = 0, t2.length); s2 < a2; s2++) this.tag.insertRule(i2, t2[s2]) && (this.groupSizes[e3]++, i2++);
|
|
786
|
+
}, e2.prototype.clearGroup = function(e3) {
|
|
787
|
+
if (e3 < this.length) {
|
|
788
|
+
var t2 = this.groupSizes[e3], n2 = this.indexOfGroup(e3), o2 = n2 + t2;
|
|
789
|
+
this.groupSizes[e3] = 0;
|
|
790
|
+
for (var r2 = n2; r2 < o2; r2++) this.tag.deleteRule(n2);
|
|
791
|
+
}
|
|
792
|
+
}, e2.prototype.getGroup = function(e3) {
|
|
793
|
+
var t2 = "";
|
|
794
|
+
if (e3 >= this.length || 0 === this.groupSizes[e3]) return t2;
|
|
795
|
+
for (var n2 = this.groupSizes[e3], o2 = this.indexOfGroup(e3), r2 = o2 + n2, s2 = o2; s2 < r2; s2++) t2 += "".concat(this.tag.getRule(s2)).concat(g);
|
|
796
|
+
return t2;
|
|
797
|
+
}, e2;
|
|
798
|
+
})(), ye = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ge = 1, Se = function(e2) {
|
|
799
|
+
if (ye.has(e2)) return ye.get(e2);
|
|
800
|
+
for (; ve.has(ge); ) ge++;
|
|
801
|
+
var t2 = ge++;
|
|
802
|
+
return ye.set(e2, t2), ve.set(t2, e2), t2;
|
|
803
|
+
}, we = function(e2, t2) {
|
|
804
|
+
ge = t2 + 1, ye.set(e2, t2), ve.set(t2, e2);
|
|
805
|
+
}, be = "style[".concat(f, "][").concat(y, '="').concat(v, '"]'), Ee = new RegExp("^".concat(f, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Ne = function(e2, t2, n2) {
|
|
806
|
+
for (var o2, r2 = n2.split(","), s2 = 0, i2 = r2.length; s2 < i2; s2++) (o2 = r2[s2]) && e2.registerName(t2, o2);
|
|
807
|
+
}, Pe = function(e2, t2) {
|
|
808
|
+
for (var n2, o2 = (null !== (n2 = t2.textContent) && void 0 !== n2 ? n2 : "").split(g), r2 = [], s2 = 0, i2 = o2.length; s2 < i2; s2++) {
|
|
809
|
+
var a2 = o2[s2].trim();
|
|
810
|
+
if (a2) {
|
|
811
|
+
var c2 = a2.match(Ee);
|
|
812
|
+
if (c2) {
|
|
813
|
+
var l2 = 0 | parseInt(c2[1], 10), u2 = c2[2];
|
|
814
|
+
0 !== l2 && (we(u2, l2), Ne(e2, u2, c2[3]), e2.getTag().insertRules(l2, r2)), r2.length = 0;
|
|
815
|
+
} else r2.push(a2);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}, _e = function(e2) {
|
|
819
|
+
for (var t2 = document.querySelectorAll(be), n2 = 0, o2 = t2.length; n2 < o2; n2++) {
|
|
820
|
+
var r2 = t2[n2];
|
|
821
|
+
r2 && r2.getAttribute(f) !== m && (Pe(e2, r2), r2.parentNode && r2.parentNode.removeChild(r2));
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
function Ce() {
|
|
825
|
+
return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null;
|
|
826
|
+
}
|
|
827
|
+
var Ie = function(e2) {
|
|
828
|
+
var t2 = document.head, n2 = e2 || t2, o2 = document.createElement("style"), r2 = (function(e3) {
|
|
829
|
+
var t3 = Array.from(e3.querySelectorAll("style[".concat(f, "]")));
|
|
830
|
+
return t3[t3.length - 1];
|
|
831
|
+
})(n2), s2 = void 0 !== r2 ? r2.nextSibling : null;
|
|
832
|
+
o2.setAttribute(f, m), o2.setAttribute(y, v);
|
|
833
|
+
var i2 = Ce();
|
|
834
|
+
return i2 && o2.setAttribute("nonce", i2), n2.insertBefore(o2, s2), o2;
|
|
835
|
+
}, Ae = (function() {
|
|
836
|
+
function e2(e3) {
|
|
837
|
+
this.element = Ie(e3), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e4) {
|
|
838
|
+
if (e4.sheet) return e4.sheet;
|
|
839
|
+
for (var t2 = document.styleSheets, n2 = 0, o2 = t2.length; n2 < o2; n2++) {
|
|
840
|
+
var r2 = t2[n2];
|
|
841
|
+
if (r2.ownerNode === e4) return r2;
|
|
842
|
+
}
|
|
843
|
+
throw he(17);
|
|
844
|
+
})(this.element), this.length = 0;
|
|
845
|
+
}
|
|
846
|
+
return e2.prototype.insertRule = function(e3, t2) {
|
|
847
|
+
try {
|
|
848
|
+
return this.sheet.insertRule(t2, e3), this.length++, true;
|
|
849
|
+
} catch (e4) {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
852
|
+
}, e2.prototype.deleteRule = function(e3) {
|
|
853
|
+
this.sheet.deleteRule(e3), this.length--;
|
|
854
|
+
}, e2.prototype.getRule = function(e3) {
|
|
855
|
+
var t2 = this.sheet.cssRules[e3];
|
|
856
|
+
return t2 && t2.cssText ? t2.cssText : "";
|
|
857
|
+
}, e2;
|
|
858
|
+
})(), Oe = (function() {
|
|
859
|
+
function e2(e3) {
|
|
860
|
+
this.element = Ie(e3), this.nodes = this.element.childNodes, this.length = 0;
|
|
861
|
+
}
|
|
862
|
+
return e2.prototype.insertRule = function(e3, t2) {
|
|
863
|
+
if (e3 <= this.length && e3 >= 0) {
|
|
864
|
+
var n2 = document.createTextNode(t2);
|
|
865
|
+
return this.element.insertBefore(n2, this.nodes[e3] || null), this.length++, true;
|
|
866
|
+
}
|
|
867
|
+
return false;
|
|
868
|
+
}, e2.prototype.deleteRule = function(e3) {
|
|
869
|
+
this.element.removeChild(this.nodes[e3]), this.length--;
|
|
870
|
+
}, e2.prototype.getRule = function(e3) {
|
|
871
|
+
return e3 < this.length ? this.nodes[e3].textContent : "";
|
|
872
|
+
}, e2;
|
|
873
|
+
})(), De = (function() {
|
|
874
|
+
function e2(e3) {
|
|
875
|
+
this.rules = [], this.length = 0;
|
|
876
|
+
}
|
|
877
|
+
return e2.prototype.insertRule = function(e3, t2) {
|
|
878
|
+
return e3 <= this.length && (this.rules.splice(e3, 0, t2), this.length++, true);
|
|
879
|
+
}, e2.prototype.deleteRule = function(e3) {
|
|
880
|
+
this.rules.splice(e3, 1), this.length--;
|
|
881
|
+
}, e2.prototype.getRule = function(e3) {
|
|
882
|
+
return e3 < this.length ? this.rules[e3] : "";
|
|
883
|
+
}, e2;
|
|
884
|
+
})(), Re = S, Te = { isServer: !S, useCSSOMInjection: !w }, ke = (function() {
|
|
885
|
+
function e2(e3, n2, o2) {
|
|
886
|
+
void 0 === e3 && (e3 = C), void 0 === n2 && (n2 = {});
|
|
887
|
+
var r2 = this;
|
|
888
|
+
this.options = __assign(__assign({}, Te), e3), this.gs = n2, this.names = new Map(o2), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
|
|
889
|
+
return (function(e4) {
|
|
890
|
+
for (var t2 = e4.getTag(), n3 = t2.length, o3 = "", r3 = function(n4) {
|
|
891
|
+
var r4 = (function(e5) {
|
|
892
|
+
return ve.get(e5);
|
|
893
|
+
})(n4);
|
|
894
|
+
if (void 0 === r4) return "continue";
|
|
895
|
+
var s3 = e4.names.get(r4), i2 = t2.getGroup(n4);
|
|
896
|
+
if (void 0 === s3 || !s3.size || 0 === i2.length) return "continue";
|
|
897
|
+
var a2 = "".concat(f, ".g").concat(n4, '[id="').concat(r4, '"]'), c2 = "";
|
|
898
|
+
void 0 !== s3 && s3.forEach(function(e5) {
|
|
899
|
+
e5.length > 0 && (c2 += "".concat(e5, ","));
|
|
900
|
+
}), o3 += "".concat(i2).concat(a2, '{content:"').concat(c2, '"}').concat(g);
|
|
901
|
+
}, s2 = 0; s2 < n3; s2++) r3(s2);
|
|
902
|
+
return o3;
|
|
903
|
+
})(r2);
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
return e2.registerId = function(e3) {
|
|
907
|
+
return Se(e3);
|
|
908
|
+
}, e2.prototype.rehydrate = function() {
|
|
909
|
+
!this.server && S && _e(this);
|
|
910
|
+
}, e2.prototype.reconstructWithOptions = function(n2, o2) {
|
|
911
|
+
return void 0 === o2 && (o2 = true), new e2(__assign(__assign({}, this.options), n2), this.gs, o2 && this.names || void 0);
|
|
912
|
+
}, e2.prototype.allocateGSInstance = function(e3) {
|
|
913
|
+
return this.gs[e3] = (this.gs[e3] || 0) + 1;
|
|
914
|
+
}, e2.prototype.getTag = function() {
|
|
915
|
+
return this.tag || (this.tag = (e3 = (function(e4) {
|
|
916
|
+
var t2 = e4.useCSSOMInjection, n2 = e4.target;
|
|
917
|
+
return e4.isServer ? new De(n2) : t2 ? new Ae(n2) : new Oe(n2);
|
|
918
|
+
})(this.options), new fe(e3)));
|
|
919
|
+
var e3;
|
|
920
|
+
}, e2.prototype.hasNameForId = function(e3, t2) {
|
|
921
|
+
return this.names.has(e3) && this.names.get(e3).has(t2);
|
|
922
|
+
}, e2.prototype.registerName = function(e3, t2) {
|
|
923
|
+
if (Se(e3), this.names.has(e3)) this.names.get(e3).add(t2);
|
|
924
|
+
else {
|
|
925
|
+
var n2 = /* @__PURE__ */ new Set();
|
|
926
|
+
n2.add(t2), this.names.set(e3, n2);
|
|
927
|
+
}
|
|
928
|
+
}, e2.prototype.insertRules = function(e3, t2, n2) {
|
|
929
|
+
this.registerName(e3, t2), this.getTag().insertRules(Se(e3), n2);
|
|
930
|
+
}, e2.prototype.clearNames = function(e3) {
|
|
931
|
+
this.names.has(e3) && this.names.get(e3).clear();
|
|
932
|
+
}, e2.prototype.clearRules = function(e3) {
|
|
933
|
+
this.getTag().clearGroup(Se(e3)), this.clearNames(e3);
|
|
934
|
+
}, e2.prototype.clearTag = function() {
|
|
935
|
+
this.tag = void 0;
|
|
936
|
+
}, e2;
|
|
937
|
+
})(), je = /&/g, xe = /^\s*\/\/.*$/gm;
|
|
938
|
+
function Ve(e2, t2) {
|
|
939
|
+
return e2.map(function(e3) {
|
|
940
|
+
return "rule" === e3.type && (e3.value = "".concat(t2, " ").concat(e3.value), e3.value = e3.value.replaceAll(",", ",".concat(t2, " ")), e3.props = e3.props.map(function(e4) {
|
|
941
|
+
return "".concat(t2, " ").concat(e4);
|
|
942
|
+
})), Array.isArray(e3.children) && "@keyframes" !== e3.type && (e3.children = Ve(e3.children, t2)), e3;
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
function Fe(e2) {
|
|
946
|
+
var t2, n2, o2, r2 = C, s2 = r2.options, i2 = void 0 === s2 ? C : s2, a2 = r2.plugins, c2 = void 0 === a2 ? _ : a2, l2 = function(e3, o3, r3) {
|
|
947
|
+
return r3.startsWith(n2) && r3.endsWith(n2) && r3.replaceAll(n2, "").length > 0 ? ".".concat(t2) : e3;
|
|
948
|
+
}, u2 = c2.slice();
|
|
949
|
+
u2.push(function(e3) {
|
|
950
|
+
e3.type === RULESET && e3.value.includes("&") && (e3.props[0] = e3.props[0].replace(je, n2).replace(o2, l2));
|
|
951
|
+
}), i2.prefix && u2.push(prefixer), u2.push(stringify);
|
|
952
|
+
var p2 = function(e3, r3, s3, a3) {
|
|
953
|
+
void 0 === r3 && (r3 = ""), void 0 === s3 && (s3 = ""), void 0 === a3 && (a3 = "&"), t2 = a3, n2 = r3, o2 = new RegExp("\\".concat(n2, "\\b"), "g");
|
|
954
|
+
var c3 = e3.replace(xe, ""), l3 = compile(s3 || r3 ? "".concat(s3, " ").concat(r3, " { ").concat(c3, " }") : c3);
|
|
955
|
+
i2.namespace && (l3 = Ve(l3, i2.namespace));
|
|
956
|
+
var p3 = [];
|
|
957
|
+
return serialize(l3, middleware(u2.concat(rulesheet(function(e4) {
|
|
958
|
+
return p3.push(e4);
|
|
959
|
+
})))), p3;
|
|
960
|
+
};
|
|
961
|
+
return p2.hash = c2.length ? c2.reduce(function(e3, t3) {
|
|
962
|
+
return t3.name || he(15), M(e3, t3.name);
|
|
963
|
+
}, F).toString() : "", p2;
|
|
964
|
+
}
|
|
965
|
+
var Me = new ke(), ze = Fe(), $e = React.createContext({ shouldForwardProp: void 0, styleSheet: Me, stylis: ze });
|
|
966
|
+
$e.Consumer;
|
|
967
|
+
React.createContext(void 0);
|
|
968
|
+
function Ge() {
|
|
969
|
+
return React.useContext($e);
|
|
970
|
+
}
|
|
971
|
+
var We = (function() {
|
|
972
|
+
function e2(e3, t2) {
|
|
973
|
+
var n2 = this;
|
|
974
|
+
this.inject = function(e4, t3) {
|
|
975
|
+
void 0 === t3 && (t3 = ze);
|
|
976
|
+
var o2 = n2.name + t3.hash;
|
|
977
|
+
e4.hasNameForId(n2.id, o2) || e4.insertRules(n2.id, o2, t3(n2.rules, o2, "@keyframes"));
|
|
978
|
+
}, this.name = e3, this.id = "sc-keyframes-".concat(e3), this.rules = t2, ue(this, function() {
|
|
979
|
+
throw he(12, String(n2.name));
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
return e2.prototype.getName = function(e3) {
|
|
983
|
+
return void 0 === e3 && (e3 = ze), this.name + e3.hash;
|
|
984
|
+
}, e2;
|
|
985
|
+
})(), qe = function(e2) {
|
|
986
|
+
return e2 >= "A" && e2 <= "Z";
|
|
987
|
+
};
|
|
988
|
+
function He(e2) {
|
|
989
|
+
for (var t2 = "", n2 = 0; n2 < e2.length; n2++) {
|
|
990
|
+
var o2 = e2[n2];
|
|
991
|
+
if (1 === n2 && "-" === o2 && "-" === e2[0]) return e2;
|
|
992
|
+
qe(o2) ? t2 += "-" + o2.toLowerCase() : t2 += o2;
|
|
993
|
+
}
|
|
994
|
+
return t2.startsWith("ms-") ? "-" + t2 : t2;
|
|
995
|
+
}
|
|
996
|
+
var Ue = function(e2) {
|
|
997
|
+
return null == e2 || false === e2 || "" === e2;
|
|
998
|
+
}, Je = function(t2) {
|
|
999
|
+
var n2, o2, r2 = [];
|
|
1000
|
+
for (var s2 in t2) {
|
|
1001
|
+
var i2 = t2[s2];
|
|
1002
|
+
t2.hasOwnProperty(s2) && !Ue(i2) && (Array.isArray(i2) && i2.isCss || re(i2) ? r2.push("".concat(He(s2), ":"), i2, ";") : ce(i2) ? r2.push.apply(r2, __spreadArray(__spreadArray(["".concat(s2, " {")], Je(i2), false), ["}"], false)) : r2.push("".concat(He(s2), ": ").concat((n2 = s2, null == (o2 = i2) || "boolean" == typeof o2 || "" === o2 ? "" : "number" != typeof o2 || 0 === o2 || n2 in unitlessKeys || n2.startsWith("--") ? String(o2).trim() : "".concat(o2, "px")), ";")));
|
|
1003
|
+
}
|
|
1004
|
+
return r2;
|
|
1005
|
+
};
|
|
1006
|
+
function Xe(e2, t2, n2, o2) {
|
|
1007
|
+
if (Ue(e2)) return [];
|
|
1008
|
+
if (se(e2)) return [".".concat(e2.styledComponentId)];
|
|
1009
|
+
if (re(e2)) {
|
|
1010
|
+
if (!re(s2 = e2) || s2.prototype && s2.prototype.isReactComponent || !t2) return [e2];
|
|
1011
|
+
var r2 = e2(t2);
|
|
1012
|
+
return Xe(r2, t2, n2, o2);
|
|
1013
|
+
}
|
|
1014
|
+
var s2;
|
|
1015
|
+
return e2 instanceof We ? n2 ? (e2.inject(n2, o2), [e2.getName(o2)]) : [e2] : ce(e2) ? Je(e2) : Array.isArray(e2) ? Array.prototype.concat.apply(_, e2.map(function(e3) {
|
|
1016
|
+
return Xe(e3, t2, n2, o2);
|
|
1017
|
+
})) : [e2.toString()];
|
|
1018
|
+
}
|
|
1019
|
+
function Ze(e2) {
|
|
1020
|
+
for (var t2 = 0; t2 < e2.length; t2 += 1) {
|
|
1021
|
+
var n2 = e2[t2];
|
|
1022
|
+
if (re(n2) && !se(n2)) return false;
|
|
1023
|
+
}
|
|
1024
|
+
return true;
|
|
1025
|
+
}
|
|
1026
|
+
var Ke = z(v), Qe = (function() {
|
|
1027
|
+
function e2(e3, t2, n2) {
|
|
1028
|
+
this.rules = e3, this.staticRulesId = "", this.isStatic = (void 0 === n2 || n2.isStatic) && Ze(e3), this.componentId = t2, this.baseHash = M(Ke, t2), this.baseStyle = n2, ke.registerId(t2);
|
|
1029
|
+
}
|
|
1030
|
+
return e2.prototype.generateAndInjectStyles = function(e3, t2, n2) {
|
|
1031
|
+
var o2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e3, t2, n2) : "";
|
|
1032
|
+
if (this.isStatic && !n2.hash) if (this.staticRulesId && t2.hasNameForId(this.componentId, this.staticRulesId)) o2 = ie(o2, this.staticRulesId);
|
|
1033
|
+
else {
|
|
1034
|
+
var r2 = ae(Xe(this.rules, e3, t2, n2)), s2 = x(M(this.baseHash, r2) >>> 0);
|
|
1035
|
+
if (!t2.hasNameForId(this.componentId, s2)) {
|
|
1036
|
+
var i2 = n2(r2, ".".concat(s2), void 0, this.componentId);
|
|
1037
|
+
t2.insertRules(this.componentId, s2, i2);
|
|
1038
|
+
}
|
|
1039
|
+
o2 = ie(o2, s2), this.staticRulesId = s2;
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
for (var a2 = M(this.baseHash, n2.hash), c2 = "", l2 = 0; l2 < this.rules.length; l2++) {
|
|
1043
|
+
var u2 = this.rules[l2];
|
|
1044
|
+
if ("string" == typeof u2) c2 += u2;
|
|
1045
|
+
else if (u2) {
|
|
1046
|
+
var p2 = ae(Xe(u2, e3, t2, n2));
|
|
1047
|
+
a2 = M(a2, p2 + l2), c2 += p2;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
if (c2) {
|
|
1051
|
+
var d2 = x(a2 >>> 0);
|
|
1052
|
+
t2.hasNameForId(this.componentId, d2) || t2.insertRules(this.componentId, d2, n2(c2, ".".concat(d2), void 0, this.componentId)), o2 = ie(o2, d2);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return o2;
|
|
1056
|
+
}, e2;
|
|
1057
|
+
})(), et = React.createContext(void 0);
|
|
1058
|
+
et.Consumer;
|
|
1059
|
+
function ot(e2) {
|
|
1060
|
+
var n2 = React.useContext(et), r2 = React.useMemo(function() {
|
|
1061
|
+
return (function(e3, n3) {
|
|
1062
|
+
if (!e3) throw he(14);
|
|
1063
|
+
if (re(e3)) {
|
|
1064
|
+
var o2 = e3(n3);
|
|
1065
|
+
return o2;
|
|
1066
|
+
}
|
|
1067
|
+
if (Array.isArray(e3) || "object" != typeof e3) throw he(8);
|
|
1068
|
+
return n3 ? __assign(__assign({}, n3), e3) : e3;
|
|
1069
|
+
})(e2.theme, n2);
|
|
1070
|
+
}, [e2.theme, n2]);
|
|
1071
|
+
return e2.children ? React.createElement(et.Provider, { value: r2 }, e2.children) : null;
|
|
1072
|
+
}
|
|
1073
|
+
var rt = {};
|
|
1074
|
+
function it(e2, r2, s2) {
|
|
1075
|
+
var i2 = se(e2), a2 = e2, c2 = !L(e2), p2 = r2.attrs, d2 = void 0 === p2 ? _ : p2, h2 = r2.componentId, f2 = void 0 === h2 ? (function(e3, t2) {
|
|
1076
|
+
var n2 = "string" != typeof e3 ? "sc" : R(e3);
|
|
1077
|
+
rt[n2] = (rt[n2] || 0) + 1;
|
|
1078
|
+
var o2 = "".concat(n2, "-").concat($(v + n2 + rt[n2]));
|
|
1079
|
+
return t2 ? "".concat(t2, "-").concat(o2) : o2;
|
|
1080
|
+
})(r2.displayName, r2.parentComponentId) : h2, m2 = r2.displayName, y2 = void 0 === m2 ? (function(e3) {
|
|
1081
|
+
return L(e3) ? "styled.".concat(e3) : "Styled(".concat(B(e3), ")");
|
|
1082
|
+
})(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d2).filter(Boolean) : d2, w2 = r2.shouldForwardProp;
|
|
1083
|
+
if (i2 && a2.shouldForwardProp) {
|
|
1084
|
+
var b2 = a2.shouldForwardProp;
|
|
1085
|
+
if (r2.shouldForwardProp) {
|
|
1086
|
+
var E2 = r2.shouldForwardProp;
|
|
1087
|
+
w2 = function(e3, t2) {
|
|
1088
|
+
return b2(e3, t2) && E2(e3, t2);
|
|
1089
|
+
};
|
|
1090
|
+
} else w2 = b2;
|
|
1091
|
+
}
|
|
1092
|
+
var N2 = new Qe(s2, g2, i2 ? a2.componentStyle : void 0);
|
|
1093
|
+
function O2(e3, r3) {
|
|
1094
|
+
return (function(e4, r4, s3) {
|
|
1095
|
+
var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d3 = e4.styledComponentId, h3 = e4.target, f3 = React.useContext(et), m3 = Ge(), y3 = e4.shouldForwardProp || m3.shouldForwardProp;
|
|
1096
|
+
var v2 = I(r4, f3, c3) || C, g3 = (function(e5, n2, o2) {
|
|
1097
|
+
for (var r5, s4 = __assign(__assign({}, n2), { className: void 0, theme: o2 }), i4 = 0; i4 < e5.length; i4 += 1) {
|
|
1098
|
+
var a4 = re(r5 = e5[i4]) ? r5(s4) : r5;
|
|
1099
|
+
for (var c4 in a4) s4[c4] = "className" === c4 ? ie(s4[c4], a4[c4]) : "style" === c4 ? __assign(__assign({}, s4[c4]), a4[c4]) : a4[c4];
|
|
1100
|
+
}
|
|
1101
|
+
return n2.className && (s4.className = ie(s4.className, n2.className)), s4;
|
|
1102
|
+
})(i3, r4, v2), S3 = g3.as || h3, w3 = {};
|
|
1103
|
+
for (var b3 in g3) void 0 === g3[b3] || "$" === b3[0] || "as" === b3 || "theme" === b3 && g3.theme === v2 || ("forwardedAs" === b3 ? w3.as = g3.forwardedAs : y3 && !y3(b3, S3) || (w3[b3] = g3[b3], y3 || true));
|
|
1104
|
+
var E3 = (function(e5, t2) {
|
|
1105
|
+
var n2 = Ge(), o2 = e5.generateAndInjectStyles(t2, n2.styleSheet, n2.stylis);
|
|
1106
|
+
return o2;
|
|
1107
|
+
})(a3, g3);
|
|
1108
|
+
var N3 = ie(p3, d3);
|
|
1109
|
+
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), React.createElement(S3, w3);
|
|
1110
|
+
})(D2, e3, r3);
|
|
1111
|
+
}
|
|
1112
|
+
O2.displayName = y2;
|
|
1113
|
+
var D2 = React.forwardRef(O2);
|
|
1114
|
+
return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e2, Object.defineProperty(D2, "defaultProps", { get: function() {
|
|
1115
|
+
return this._foldedDefaultProps;
|
|
1116
|
+
}, set: function(e3) {
|
|
1117
|
+
this._foldedDefaultProps = i2 ? (function(e4) {
|
|
1118
|
+
for (var t2 = [], n2 = 1; n2 < arguments.length; n2++) t2[n2 - 1] = arguments[n2];
|
|
1119
|
+
for (var o2 = 0, r3 = t2; o2 < r3.length; o2++) le(e4, r3[o2], true);
|
|
1120
|
+
return e4;
|
|
1121
|
+
})({}, a2.defaultProps, e3) : e3;
|
|
1122
|
+
} }), ue(D2, function() {
|
|
1123
|
+
return ".".concat(D2.styledComponentId);
|
|
1124
|
+
}), c2 && oe(D2, e2, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), D2;
|
|
1125
|
+
}
|
|
1126
|
+
function at(e2, t2) {
|
|
1127
|
+
for (var n2 = [e2[0]], o2 = 0, r2 = t2.length; o2 < r2; o2 += 1) n2.push(t2[o2], e2[o2 + 1]);
|
|
1128
|
+
return n2;
|
|
1129
|
+
}
|
|
1130
|
+
var ct = function(e2) {
|
|
1131
|
+
return Object.assign(e2, { isCss: true });
|
|
1132
|
+
};
|
|
1133
|
+
function lt(t2) {
|
|
1134
|
+
for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2];
|
|
1135
|
+
if (re(t2) || ce(t2)) return ct(Xe(at(_, __spreadArray([t2], n2, true))));
|
|
1136
|
+
var r2 = t2;
|
|
1137
|
+
return 0 === n2.length && 1 === r2.length && "string" == typeof r2[0] ? Xe(r2) : ct(Xe(at(r2, n2)));
|
|
1138
|
+
}
|
|
1139
|
+
function ut(n2, o2, r2) {
|
|
1140
|
+
if (void 0 === r2 && (r2 = C), !o2) throw he(1, o2);
|
|
1141
|
+
var s2 = function(t2) {
|
|
1142
|
+
for (var s3 = [], i2 = 1; i2 < arguments.length; i2++) s3[i2 - 1] = arguments[i2];
|
|
1143
|
+
return n2(o2, r2, lt.apply(void 0, __spreadArray([t2], s3, false)));
|
|
1144
|
+
};
|
|
1145
|
+
return s2.attrs = function(e2) {
|
|
1146
|
+
return ut(n2, o2, __assign(__assign({}, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) }));
|
|
1147
|
+
}, s2.withConfig = function(e2) {
|
|
1148
|
+
return ut(n2, o2, __assign(__assign({}, r2), e2));
|
|
1149
|
+
}, s2;
|
|
1150
|
+
}
|
|
1151
|
+
var pt = function(e2) {
|
|
1152
|
+
return ut(it, e2);
|
|
1153
|
+
}, dt = pt;
|
|
1154
|
+
A.forEach(function(e2) {
|
|
1155
|
+
dt[e2] = pt(e2);
|
|
1156
|
+
});
|
|
1157
|
+
const theme = {
|
|
1158
|
+
// Main colors usually to be modified by the user
|
|
1159
|
+
primary: "#422ad5",
|
|
1160
|
+
// Primary brand color, The main color of your brand
|
|
1161
|
+
primaryContent: "#e0e7ff",
|
|
1162
|
+
// --color-primary-content Foreground content color to use on primary color
|
|
1163
|
+
secondary: "#f43098",
|
|
1164
|
+
// --color-secondary Secondary brand color, The optional, secondary color of your brand
|
|
1165
|
+
secondaryContent: "#f9e4f0",
|
|
1166
|
+
// --color-secondary-content Foreground content color to use on secondary color
|
|
1167
|
+
accent: "#00d3bb",
|
|
1168
|
+
// --color-accent Accent brand color, The optional, accent color of your brand
|
|
1169
|
+
accentContent: "#084d49",
|
|
1170
|
+
// --color-accent-content Foreground content color to use on accent color
|
|
1171
|
+
neutral: "#09090b",
|
|
1172
|
+
// --color-neutral Neutral dark color, For not-saturated parts of UI
|
|
1173
|
+
neutralContent: "#e4e4e7",
|
|
1174
|
+
// --color-neutral-content Foreground content color to use on neutral color
|
|
1175
|
+
base100: "#ffffff",
|
|
1176
|
+
// --color-base-100 Base surface color of page, used for blank backgrounds
|
|
1177
|
+
base200: "#f8f8f8",
|
|
1178
|
+
// --color-base-200 Base color, darker shade, to create elevations
|
|
1179
|
+
base300: "#eeeeee",
|
|
1180
|
+
// --color-base-300 Base color, even more darker shade, to create elevations
|
|
1181
|
+
baseContent: "#18181b",
|
|
1182
|
+
// --color-base-content Foreground content color to use on base color
|
|
1183
|
+
info: "#00bafe",
|
|
1184
|
+
// --color-info Info color, For informative/helpful messages
|
|
1185
|
+
infoContent: "#042e49",
|
|
1186
|
+
// --color-info-content Foreground content color to use on info color
|
|
1187
|
+
success: "#00d390",
|
|
1188
|
+
// --color-success Success color, For success/safe messages
|
|
1189
|
+
successContent: "#004c39",
|
|
1190
|
+
// --color-success-content Foreground content color to use on success color
|
|
1191
|
+
warning: "#fcb700",
|
|
1192
|
+
// --color-warning Warning color, For warning/caution messages
|
|
1193
|
+
warningContent: "#793205",
|
|
1194
|
+
// --color-warning-content Foreground content color to use on warning color
|
|
1195
|
+
error: "#ff627d",
|
|
1196
|
+
// --color-error Error color, For error/danger/destructive messages
|
|
1197
|
+
errorContent: "#4d0218",
|
|
1198
|
+
// --color-error-content Foreground content color to use on error color
|
|
1199
|
+
radiusSelectors: "0.25rem",
|
|
1200
|
+
// checkbox, toggle, badge
|
|
1201
|
+
radiusField: "0.25rem",
|
|
1202
|
+
// button, input, select, tab
|
|
1203
|
+
radiusBox: "0.25rem",
|
|
1204
|
+
// card, modal, alert
|
|
1205
|
+
borderWidth: "1px",
|
|
1206
|
+
fontSize: "1rem",
|
|
1207
|
+
sizeField: `.3rem`,
|
|
1208
|
+
sizeSelector: `.3rem`,
|
|
1209
|
+
allFieldsSize: `20rem`,
|
|
1210
|
+
// radio/checkbox item element width
|
|
1211
|
+
spacing: ".3rem",
|
|
1212
|
+
depth: 1
|
|
1213
|
+
};
|
|
1214
|
+
const themeContextInitialValues = {
|
|
1215
|
+
selectedVariant: "primary",
|
|
1216
|
+
getDefaultVariantOrSelected: () => "primary",
|
|
1217
|
+
...theme
|
|
1218
|
+
};
|
|
1219
|
+
const ThemeContext = React.createContext({
|
|
1220
|
+
...theme,
|
|
1221
|
+
...themeContextInitialValues
|
|
1222
|
+
});
|
|
1223
|
+
const CssVariables = dt.div`
|
|
3
1224
|
font-family:
|
|
4
1225
|
ui-sans-serif,
|
|
5
1226
|
system-ui,
|
|
@@ -17,48 +1238,393 @@
|
|
|
17
1238
|
Segoe UI Symbol,
|
|
18
1239
|
Noto Color Emoji;
|
|
19
1240
|
color-scheme: light;
|
|
20
|
-
--color-base-100: ${
|
|
21
|
-
--color-base-200: ${
|
|
22
|
-
--color-base-300: ${
|
|
23
|
-
--color-base-content: ${
|
|
24
|
-
--color-primary: ${
|
|
25
|
-
--color-primary-content: ${
|
|
26
|
-
--color-secondary: ${
|
|
27
|
-
--color-secondary-content: ${
|
|
28
|
-
--color-accent: ${
|
|
29
|
-
--color-accent-content: ${
|
|
30
|
-
--color-neutral: ${
|
|
31
|
-
--color-neutral-content: ${
|
|
32
|
-
--color-info: ${
|
|
33
|
-
--color-info-content: ${
|
|
34
|
-
--color-success: ${
|
|
35
|
-
--color-success-content: ${
|
|
36
|
-
--color-warning: ${
|
|
37
|
-
--color-warning-content: ${
|
|
38
|
-
--color-error: ${
|
|
39
|
-
--color-error-content: ${
|
|
1241
|
+
--color-base-100: ${(props) => props.$theme["base100"]};
|
|
1242
|
+
--color-base-200: ${(props) => props.$theme["base200"]};
|
|
1243
|
+
--color-base-300: ${(props) => props.$theme["base300"]};
|
|
1244
|
+
--color-base-content: ${(props) => props.$theme["baseContent"]};
|
|
1245
|
+
--color-primary: ${(props) => props.$theme["primary"]};
|
|
1246
|
+
--color-primary-content: ${(props) => props.$theme["primaryContent"]};
|
|
1247
|
+
--color-secondary: ${(props) => props.$theme["secondary"]};
|
|
1248
|
+
--color-secondary-content: ${(props) => props.$theme["secondaryContent"]};
|
|
1249
|
+
--color-accent: ${(props) => props.$theme["accent"]};
|
|
1250
|
+
--color-accent-content: ${(props) => props.$theme["accentContent"]};
|
|
1251
|
+
--color-neutral: ${(props) => props.$theme["neutral"]};
|
|
1252
|
+
--color-neutral-content: ${(props) => props.$theme["neutralContent"]};
|
|
1253
|
+
--color-info: ${(props) => props.$theme["info"]};
|
|
1254
|
+
--color-info-content: ${(props) => props.$theme["infoContent"]};
|
|
1255
|
+
--color-success: ${(props) => props.$theme["success"]};
|
|
1256
|
+
--color-success-content: ${(props) => props.$theme["successContent"]};
|
|
1257
|
+
--color-warning: ${(props) => props.$theme["warning"]};
|
|
1258
|
+
--color-warning-content: ${(props) => props.$theme["warningContent"]};
|
|
1259
|
+
--color-error: ${(props) => props.$theme["error"]};
|
|
1260
|
+
--color-error-content: ${(props) => props.$theme["errorContent"]};
|
|
40
1261
|
|
|
41
|
-
--radius-selector: ${
|
|
42
|
-
--radius-field: ${
|
|
43
|
-
--radius-box: ${
|
|
1262
|
+
--radius-selector: ${(props) => props.$theme["radiusSelectors"]};
|
|
1263
|
+
--radius-field: ${(props) => props.$theme["radiusField"]};
|
|
1264
|
+
--radius-box: ${(props) => props.$theme["radiusBox"]};
|
|
44
1265
|
|
|
45
|
-
--border-width: ${
|
|
1266
|
+
--border-width: ${(props) => props.$theme["borderWidth"]};
|
|
46
1267
|
|
|
47
|
-
--font-size: ${
|
|
48
|
-
--size-field: ${
|
|
49
|
-
--size-selector: ${
|
|
50
|
-
--depth: ${
|
|
51
|
-
--spacing: ${
|
|
52
|
-
--all-fields-size: ${
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1268
|
+
--font-size: ${(props) => props.$theme["fontSize"]};
|
|
1269
|
+
--size-field: ${(props) => props.$theme["sizeField"]};
|
|
1270
|
+
--size-selector: ${(props) => props.$theme["sizeSelector"]};
|
|
1271
|
+
--depth: ${(props) => props.$theme["depth"]};
|
|
1272
|
+
--spacing: ${(props) => props.$theme["spacing"]};
|
|
1273
|
+
--all-fields-size: ${(props) => props.$theme["allFieldsSize"]};
|
|
1274
|
+
`;
|
|
1275
|
+
const ThemeProvider = (props) => {
|
|
1276
|
+
const selectedVariant = props.selectedVariant ?? "primary";
|
|
1277
|
+
console.log("ThemeProvider_theme", props.theme ?? theme);
|
|
1278
|
+
return React.createElement(ot, {
|
|
1279
|
+
theme: props.theme ?? theme,
|
|
1280
|
+
children: React.createElement(CssVariables, {
|
|
1281
|
+
$theme: props.theme ?? theme,
|
|
1282
|
+
children: React.createElement(ThemeContext.Provider, {
|
|
1283
|
+
value: {
|
|
1284
|
+
selectedVariant,
|
|
1285
|
+
getDefaultVariantOrSelected: () => {
|
|
1286
|
+
return selectedVariant;
|
|
1287
|
+
},
|
|
1288
|
+
...props.theme ?? theme
|
|
1289
|
+
},
|
|
1290
|
+
children: props.children
|
|
1291
|
+
})
|
|
1292
|
+
})
|
|
1293
|
+
});
|
|
1294
|
+
};
|
|
1295
|
+
const useThemeContext = () => React.useContext(ThemeContext);
|
|
1296
|
+
const useDefaultVariantColor = (override) => {
|
|
1297
|
+
const { getDefaultVariantOrSelected, ...theme2 } = useThemeContext();
|
|
1298
|
+
const defaultVariant = getDefaultVariantOrSelected();
|
|
1299
|
+
return theme2[override ?? defaultVariant];
|
|
1300
|
+
};
|
|
1301
|
+
const useDefaultVariantContentColor = (override) => {
|
|
1302
|
+
const { getDefaultVariantOrSelected, ...theme2 } = useThemeContext();
|
|
1303
|
+
const defaultVariant = getDefaultVariantOrSelected();
|
|
1304
|
+
const colorVariantKey = override ? `${override}Content` : `${defaultVariant}Content`;
|
|
1305
|
+
return theme2[colorVariantKey];
|
|
1306
|
+
};
|
|
1307
|
+
const createBaseApi = () => {
|
|
1308
|
+
const apiUrl = "http://localhost:4000/external";
|
|
1309
|
+
const unwrap = async (req) => {
|
|
1310
|
+
const unwrapped = await req;
|
|
1311
|
+
if (!unwrapped.ok) {
|
|
1312
|
+
switch (unwrapped.status) {
|
|
1313
|
+
case 404:
|
|
1314
|
+
throw new Error("Not found");
|
|
1315
|
+
case 400:
|
|
1316
|
+
throw new Error("Bad request");
|
|
1317
|
+
default:
|
|
1318
|
+
throw new Error("Unknown error");
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
return (await req).json();
|
|
1322
|
+
};
|
|
1323
|
+
return {
|
|
1324
|
+
post: async (path, body, options) => {
|
|
1325
|
+
var _a;
|
|
1326
|
+
try {
|
|
1327
|
+
return unwrap(
|
|
1328
|
+
fetch(`${apiUrl}${path}`, {
|
|
1329
|
+
method: "POST",
|
|
1330
|
+
body: JSON.stringify(body),
|
|
1331
|
+
signal: ((_a = options == null ? void 0 : options.abortController) == null ? void 0 : _a.signal) ?? null,
|
|
1332
|
+
headers: {
|
|
1333
|
+
"Content-Type": "application/json",
|
|
1334
|
+
...(options == null ? void 0 : options.headers) ?? {}
|
|
1335
|
+
}
|
|
1336
|
+
})
|
|
1337
|
+
);
|
|
1338
|
+
} catch (e) {
|
|
1339
|
+
console.log(e);
|
|
1340
|
+
throw e;
|
|
1341
|
+
}
|
|
1342
|
+
},
|
|
1343
|
+
get: async (path, options) => {
|
|
1344
|
+
var _a;
|
|
1345
|
+
try {
|
|
1346
|
+
return unwrap(
|
|
1347
|
+
fetch(`${apiUrl}${path}`, {
|
|
1348
|
+
method: "GET",
|
|
1349
|
+
signal: ((_a = options == null ? void 0 : options.abortController) == null ? void 0 : _a.signal) ?? null,
|
|
1350
|
+
headers: {
|
|
1351
|
+
"Content-Type": "application/json",
|
|
1352
|
+
...(options == null ? void 0 : options.headers) ?? {}
|
|
1353
|
+
}
|
|
1354
|
+
})
|
|
1355
|
+
);
|
|
1356
|
+
} catch (e) {
|
|
1357
|
+
console.log(e);
|
|
1358
|
+
throw e;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
};
|
|
1363
|
+
const formMock = {
|
|
1364
|
+
meta: { name: "asd" },
|
|
1365
|
+
steps: [
|
|
1366
|
+
{
|
|
1367
|
+
title: "Overall altitude",
|
|
1368
|
+
meta: { name: "overall" },
|
|
1369
|
+
fields: [
|
|
1370
|
+
{
|
|
1371
|
+
type: "matrix",
|
|
1372
|
+
meta: { name: "asd", fieldKey: "recommendationChance" },
|
|
1373
|
+
validations: {
|
|
1374
|
+
required: true
|
|
1375
|
+
},
|
|
1376
|
+
label: {
|
|
1377
|
+
default: "How likely are you to recommend this company to a friend or colleague?"
|
|
1378
|
+
},
|
|
1379
|
+
max: 10
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
type: "radio-group",
|
|
1383
|
+
meta: { name: "asd", fieldKey: "satisfactionLevel" },
|
|
1384
|
+
label: {
|
|
1385
|
+
default: "Overall, how satisfied or dissatisfied are you with our company?"
|
|
1386
|
+
},
|
|
1387
|
+
validations: { required: true },
|
|
1388
|
+
options: [
|
|
1389
|
+
{ label: "Very satisfied", id: "1" },
|
|
1390
|
+
{ label: "Somewhat satisfied", id: "2" },
|
|
1391
|
+
{ label: "Neither satisfied nor dissatisfied", id: "3" },
|
|
1392
|
+
{ label: "Somewhat dissatisfied", id: "4" },
|
|
1393
|
+
{ label: "Very dissatisfied", id: "5" }
|
|
1394
|
+
]
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
type: "rating",
|
|
1398
|
+
icon: "star2",
|
|
1399
|
+
max: 5,
|
|
1400
|
+
meta: { name: "asd", fieldKey: "satisfactionRating" },
|
|
1401
|
+
label: { default: "What is your general satisfaction?" },
|
|
1402
|
+
validations: { required: true }
|
|
1403
|
+
}
|
|
1404
|
+
]
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
meta: { name: "products" },
|
|
1408
|
+
title: "Product questions",
|
|
1409
|
+
fields: [
|
|
1410
|
+
{
|
|
1411
|
+
type: "checkbox-group",
|
|
1412
|
+
meta: { name: "asd", fieldKey: "productDescribeWords" },
|
|
1413
|
+
label: {
|
|
1414
|
+
default: "Which of the following words best describes your experience with our products?"
|
|
1415
|
+
},
|
|
1416
|
+
validations: { required: true },
|
|
1417
|
+
options: [
|
|
1418
|
+
{ label: "Reliable", id: "1" },
|
|
1419
|
+
{ label: "High quality", id: "2" },
|
|
1420
|
+
{ label: "Useful", id: "3" },
|
|
1421
|
+
{ label: "Unique", id: "4" },
|
|
1422
|
+
{ label: "Value for money", id: "5" },
|
|
1423
|
+
{ label: "Overpriced", id: "6" },
|
|
1424
|
+
{ label: "Ineffective", id: "7" },
|
|
1425
|
+
{ label: "Poor quality", id: "8" },
|
|
1426
|
+
{ label: "Unreliable", id: "9" }
|
|
1427
|
+
]
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
type: "radio-group",
|
|
1431
|
+
meta: { name: "asd", fieldKey: "productExpectations" },
|
|
1432
|
+
label: {
|
|
1433
|
+
default: "How well products meet your expectations?"
|
|
1434
|
+
},
|
|
1435
|
+
validations: { required: true },
|
|
1436
|
+
options: [
|
|
1437
|
+
{ label: "Extremely well", id: "1" },
|
|
1438
|
+
{ label: "Well", id: "2" },
|
|
1439
|
+
{ label: "Somewhat well", id: "3" },
|
|
1440
|
+
{ label: "Not well", id: "4" },
|
|
1441
|
+
{ label: "Not at all well", id: "5" }
|
|
1442
|
+
]
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
type: "matrix",
|
|
1446
|
+
meta: { name: "asd", fieldKey: "productQuality" },
|
|
1447
|
+
label: {
|
|
1448
|
+
default: "How would you rate the quality of our products?"
|
|
1449
|
+
},
|
|
1450
|
+
validations: { required: true },
|
|
1451
|
+
max: 10,
|
|
1452
|
+
minText: "Poor quality",
|
|
1453
|
+
maxText: "Good quality"
|
|
1454
|
+
}
|
|
1455
|
+
]
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
meta: { name: "final-questions" },
|
|
1459
|
+
title: "Final questions",
|
|
1460
|
+
fields: [
|
|
1461
|
+
{
|
|
1462
|
+
type: "range-slide",
|
|
1463
|
+
defaultValue: 77,
|
|
1464
|
+
meta: { name: "asd", fieldKey: "productsImpressionLevel" },
|
|
1465
|
+
label: {
|
|
1466
|
+
default: "What is your overall impression level of our products?"
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
type: "rating",
|
|
1471
|
+
icon: "heart",
|
|
1472
|
+
max: 5,
|
|
1473
|
+
meta: { name: "asd", fieldKey: "productExpectations" },
|
|
1474
|
+
label: {
|
|
1475
|
+
default: "Do you like our service and products?"
|
|
1476
|
+
},
|
|
1477
|
+
validations: { required: true }
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
type: "select",
|
|
1481
|
+
meta: { name: "asd", fieldKey: "fromWhereDidYouHearAboutUs" },
|
|
1482
|
+
label: {
|
|
1483
|
+
default: "From where did you hear about us?"
|
|
1484
|
+
},
|
|
1485
|
+
validations: { required: true },
|
|
1486
|
+
options: [
|
|
1487
|
+
{ label: "Facebook", id: "1" },
|
|
1488
|
+
{ label: "Instagram", id: "2" },
|
|
1489
|
+
{ label: "Google search", id: "3" },
|
|
1490
|
+
{ label: "AD", id: "4" },
|
|
1491
|
+
{ label: "Other", id: "5" }
|
|
1492
|
+
]
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
type: "textarea",
|
|
1496
|
+
meta: { name: "asd", fieldKey: "lastComments" },
|
|
1497
|
+
validations: { required: false },
|
|
1498
|
+
label: {
|
|
1499
|
+
values: [
|
|
1500
|
+
{
|
|
1501
|
+
conditions: [
|
|
1502
|
+
{
|
|
1503
|
+
fieldName: "satisfactionRating",
|
|
1504
|
+
lessThan: 4
|
|
1505
|
+
}
|
|
1506
|
+
],
|
|
1507
|
+
value: "How can we improve our service? (optional)"
|
|
1508
|
+
}
|
|
1509
|
+
],
|
|
1510
|
+
default: "What you would like to tell us about your experience with this company? (optional)?"
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
]
|
|
1514
|
+
}
|
|
1515
|
+
]
|
|
1516
|
+
};
|
|
1517
|
+
const getFormConfigMock = (_payload, _options) => {
|
|
1518
|
+
return new Promise((resolve) => {
|
|
1519
|
+
resolve({
|
|
1520
|
+
id: "",
|
|
1521
|
+
domainId: "",
|
|
1522
|
+
attributes: {
|
|
1523
|
+
theme: {},
|
|
1524
|
+
useSystemTheme: true,
|
|
1525
|
+
variant: "primary"
|
|
1526
|
+
},
|
|
1527
|
+
popupForm: {
|
|
1528
|
+
meta: {
|
|
1529
|
+
name: "popupForm"
|
|
1530
|
+
},
|
|
1531
|
+
config: {
|
|
1532
|
+
canReturnToPreviousStep: true,
|
|
1533
|
+
nextButtonText: "Next",
|
|
1534
|
+
previousButtonText: "Previous",
|
|
1535
|
+
submitButtonText: "Submit",
|
|
1536
|
+
formTitle: "We are looking forward to hear from you!",
|
|
1537
|
+
buttonText: "Feedback"
|
|
1538
|
+
},
|
|
1539
|
+
styles: {
|
|
1540
|
+
left: null,
|
|
1541
|
+
top: 0,
|
|
1542
|
+
bottom: -20,
|
|
1543
|
+
right: 0
|
|
1544
|
+
},
|
|
1545
|
+
form: formMock
|
|
1546
|
+
},
|
|
1547
|
+
inlineForm: {
|
|
1548
|
+
meta: {
|
|
1549
|
+
name: "asd"
|
|
1550
|
+
},
|
|
1551
|
+
config: {
|
|
1552
|
+
canReturnToPreviousStep: true,
|
|
1553
|
+
nextButtonText: "Next",
|
|
1554
|
+
previousButtonText: "Previous",
|
|
1555
|
+
submitButtonText: "Submit",
|
|
1556
|
+
formTitle: "We are looking forward to hear from you!"
|
|
1557
|
+
},
|
|
1558
|
+
form: formMock
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
});
|
|
1562
|
+
};
|
|
1563
|
+
const useRequest = (request) => {
|
|
1564
|
+
const [data, setData] = React.useState();
|
|
1565
|
+
const [loading, setLoading] = React.useState(true);
|
|
1566
|
+
const [error, setError] = React.useState(null);
|
|
1567
|
+
React.useEffect(() => {
|
|
1568
|
+
const abortController = new AbortController();
|
|
1569
|
+
setLoading(true);
|
|
1570
|
+
request(abortController).then(setData).catch(setError).finally(() => setLoading(false));
|
|
1571
|
+
return () => {
|
|
1572
|
+
abortController.abort();
|
|
1573
|
+
};
|
|
1574
|
+
}, []);
|
|
1575
|
+
return { data, loading, error };
|
|
1576
|
+
};
|
|
1577
|
+
const Button = dt.button((props) => {
|
|
1578
|
+
const variantColor = useDefaultVariantColor();
|
|
1579
|
+
const variantContentColor = useDefaultVariantContentColor();
|
|
1580
|
+
const withBackground = !props.$outlined;
|
|
1581
|
+
const background = withBackground ? variantColor : "#fff";
|
|
1582
|
+
const color = props.$outlined ? variantColor : variantContentColor;
|
|
1583
|
+
const borderColor = props.$outlined ? color : background;
|
|
1584
|
+
const height = `calc(${props.theme.sizeField} * 10)`;
|
|
1585
|
+
return {
|
|
1586
|
+
borderRadius: props.theme.radiusField,
|
|
1587
|
+
borderColor: props.disabled ? "#cfcfcf" : borderColor,
|
|
1588
|
+
borderStyle: props.$dashed ? "dashed" : "solid",
|
|
1589
|
+
cursor: "pointer",
|
|
1590
|
+
boxShadow: `inset 0 0 20px 20px transparent`,
|
|
1591
|
+
height,
|
|
1592
|
+
fontWeight: "600",
|
|
1593
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
1594
|
+
paddingInline: "1.2rem",
|
|
1595
|
+
transition: "all 0.2s ease-in-out",
|
|
1596
|
+
background: props.disabled ? "#cfcfcf" : background,
|
|
1597
|
+
borderWidth: props.theme.borderWidth,
|
|
1598
|
+
userSelect: props.disabled ? "none" : void 0,
|
|
1599
|
+
color: props.disabled ? "#888888" : color,
|
|
1600
|
+
"&:active": {
|
|
1601
|
+
transform: props.disabled ? void 0 : "scale(0.97)"
|
|
1602
|
+
},
|
|
1603
|
+
"&:hover": {
|
|
1604
|
+
opacity: !props.disabled ? 0.8 : void 0,
|
|
1605
|
+
cursor: props.disabled ? "auto" : "pointer",
|
|
1606
|
+
boxShadow: !props.disabled ? `inset 0 0 20px 20px #00000017` : void 0
|
|
1607
|
+
},
|
|
1608
|
+
"@media (max-width: 900px)": {
|
|
1609
|
+
paddingInline: "0.5rem"
|
|
1610
|
+
},
|
|
1611
|
+
"@media (max-width: 700px)": {
|
|
1612
|
+
paddingInline: "0.7rem"
|
|
1613
|
+
},
|
|
1614
|
+
"@media (max-width: 400px)": {
|
|
1615
|
+
paddingInline: "0.7rem"
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
});
|
|
1619
|
+
const Div$3 = dt.div`
|
|
1620
|
+
visibility: ${(props) => props.$isVisible && props.$height ? "visible" : "hidden"};
|
|
1621
|
+
opacity: ${(props) => props.$isVisible ? 1 : 0};
|
|
56
1622
|
display: flex;
|
|
57
|
-
min-height: ${
|
|
1623
|
+
min-height: ${(props) => props.$height ? `${props.$height}px` : "auto"};
|
|
58
1624
|
gap: calc(var(--spacing) * 7);
|
|
59
1625
|
top: 0;
|
|
60
1626
|
left: 0;
|
|
61
|
-
position: ${
|
|
1627
|
+
position: ${(props) => props.$isVisible ? "relative" : "absolute"};
|
|
62
1628
|
flex-direction: column;
|
|
63
1629
|
justify-content: flex-start;
|
|
64
1630
|
flex-wrap: wrap;
|
|
@@ -66,10 +1632,25 @@
|
|
|
66
1632
|
max-width: 100%;
|
|
67
1633
|
@media (max-width: 900px) {
|
|
68
1634
|
min-height: auto;
|
|
69
|
-
height: ${
|
|
70
|
-
width: ${
|
|
1635
|
+
height: ${(props) => props.$isVisible ? "auto" : "0"};
|
|
1636
|
+
width: ${(props) => props.$isVisible ? "auto" : "0"};
|
|
71
1637
|
}
|
|
72
|
-
|
|
1638
|
+
`;
|
|
1639
|
+
const Step = (props) => {
|
|
1640
|
+
const ref = React.useRef(null);
|
|
1641
|
+
React.useEffect(() => {
|
|
1642
|
+
if (ref.current) {
|
|
1643
|
+
props.onSetMaxHeight(ref.current.clientHeight);
|
|
1644
|
+
}
|
|
1645
|
+
}, [ref, props.onSetMaxHeight]);
|
|
1646
|
+
return React.createElement(Div$3, {
|
|
1647
|
+
ref,
|
|
1648
|
+
$height: props.height,
|
|
1649
|
+
$isVisible: props.isVisible,
|
|
1650
|
+
children: props.children
|
|
1651
|
+
});
|
|
1652
|
+
};
|
|
1653
|
+
const StepsContainer = dt.ul`
|
|
73
1654
|
counter-reset: step;
|
|
74
1655
|
grid-auto-columns: 1fr;
|
|
75
1656
|
grid-auto-flow: column;
|
|
@@ -78,8 +1659,1371 @@
|
|
|
78
1659
|
@media (max-width: 900px) {
|
|
79
1660
|
display: none;
|
|
80
1661
|
}
|
|
81
|
-
`,Ro=v.li(e=>{const t=ce(e.colorVariant),r=Bn(e.colorVariant),n=e.shouldBeFilled?t:"var(--color-base-300)",a=e.shouldBeFilled?r:"var(--color-base-content)";return{textAlign:"center","--step-bg":n,"--step-fg":a,gridTemplateRows:"40px 1fr",gridTemplateColumns:"auto",gap:".5rem",placeItems:"center",minWidth:"4rem",display:"grid","&:not(:first-of-type):before":{width:"100%",height:"0.5rem",color:"var(--step-bg)",backgroundColor:"var(--step-bg)","--tw-content":"''",content:"var(--tw-content)",border:"1px solid",gridRowStart:"1",gridColumnStart:"1",marginInlineStart:"-100%"},"&:after":{content:"counter(step)",counterIncrement:"step",zIndex:"1",color:"var(--step-fg)",backgroundColor:"var(--step-bg)",border:"1px solid var(--step-bg)",borderRadius:"3.40282e38px",gridRowStart:"1",gridColumnStart:"1",placeSelf:"center",placeItems:"center",width:"2rem",height:"2rem",display:"grid",position:"relative"}}}),Vn=e=>(console.log("props.currentStepIndex",e.currentStepIndex),s.createElement(Io,{children:[e.steps.map((t,r)=>s.createElement(Ro,{key:t.title,colorVariant:e.colorVariant,shouldBeFilled:e.currentStepIndex>=r,children:t.title}))]})),ko={title:{marginTop:"0",marginBottom:".888889em",fontWeight:"700",fontSize:"2.25em",lineHeight:"1.11111"},subtitle:{marginTop:"2em",fontWeight:"700",marginBottom:"1em",fontSize:"1.5em",lineHeight:"1.33333"},section:{marginBottom:"1em",fontWeight:"600",fontSize:"1.25em",lineHeight:"1.6"},subsection:{marginTop:"1.5em",marginBottom:".5em",fontWeight:"600",fontSize:"1rem"},paragraph:{marginTop:"0",marginBottom:"1.25em",fontSize:"1rem"}},Po=v.div(e=>({...ko[e.$variant??"paragraph"],color:e.theme.baseContent,...e.$linear?{margin:"0"}:{}})),oe=e=>s.createElement(Po,{$variant:e.variant,$linear:e.linear,children:e.children}),Oo=e=>{switch(e){case"textarea":return"";case"select":return"";case"checkbox-group":return[];case"radio-group":return"";case"matrix":return null;case"range-slide":return null;case"rating":return null;default:return null}},Wn=e=>{const t=s.useMemo(()=>e.form.steps.reduce((l,d,u)=>(l.validationsPerStep[u]={},l.steps=[...l.steps,{...d,fields:d.fields.map(f=>{const p=f.meta.fieldKey;return p?(l.validationsPerStep[u][p]={fieldType:f.type,validations:f.validations},l.state={...l.state,[p]:Oo(f.type)},{dataField:p,...f}):{...f,dataField:null}})}],l),{validationsPerStep:{},state:{},steps:[]}),[e.form]),[r,n]=s.useState(t.state),a=s.useCallback((l,d)=>{l!==null&&n(u=>({...u,[l]:d}))},[n]),i=s.useCallback(l=>l?r[l]:null,[r]);return{steps:t.steps,validationsPerStep:t.validationsPerStep,state:r,setStateByKey:a,getStateByKey:i}},No=xo(),$o=(e,t)=>No.post("/feedback-receiver",e,t);/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:Hn,setPrototypeOf:rn,isFrozen:Do,getPrototypeOf:Mo,getOwnPropertyDescriptor:Lo}=Object;let{freeze:q,seal:Q,create:Gn}=Object,{apply:hr,construct:pr}=typeof Reflect<"u"&&Reflect;q||(q=function(t){return t});Q||(Q=function(t){return t});hr||(hr=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return t.apply(r,a)});pr||(pr=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return new t(...n)});const vt=K(Array.prototype.forEach),Fo=K(Array.prototype.lastIndexOf),nn=K(Array.prototype.pop),et=K(Array.prototype.push),zo=K(Array.prototype.splice),_t=K(String.prototype.toLowerCase),tr=K(String.prototype.toString),rr=K(String.prototype.match),tt=K(String.prototype.replace),Bo=K(String.prototype.indexOf),Uo=K(String.prototype.trim),ne=K(Object.prototype.hasOwnProperty),Y=K(RegExp.prototype.test),rt=Vo(TypeError);function K(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return hr(e,t,n)}}function Vo(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return pr(e,r)}}function S(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_t;rn&&rn(e,null);let n=t.length;for(;n--;){let a=t[n];if(typeof a=="string"){const i=r(a);i!==a&&(Do(t)||(t[n]=i),a=i)}e[a]=!0}return e}function Wo(e){for(let t=0;t<e.length;t++)ne(e,t)||(e[t]=null);return e}function fe(e){const t=Gn(null);for(const[r,n]of Hn(e))ne(e,r)&&(Array.isArray(n)?t[r]=Wo(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=fe(n):t[r]=n);return t}function nt(e,t){for(;e!==null;){const n=Lo(e,t);if(n){if(n.get)return K(n.get);if(typeof n.value=="function")return K(n.value)}e=Mo(e)}function r(){return null}return r}const an=q(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),nr=q(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ar=q(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ho=q(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),or=q(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Go=q(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),on=q(["#text"]),sn=q(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ir=q(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ln=q(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Et=q(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jo=Q(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yo=Q(/<%[\w\W]*|[\w\W]*%>/gm),qo=Q(/\$\{[\w\W]*/gm),Ko=Q(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xo=Q(/^aria-[\-\w]+$/),jn=Q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zo=Q(/^(?:\w+script|data):/i),Qo=Q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yn=Q(/^html$/i),Jo=Q(/^[a-z][.\w]*(-[.\w]+)+$/i);var cn=Object.freeze({__proto__:null,ARIA_ATTR:Xo,ATTR_WHITESPACE:Qo,CUSTOM_ELEMENT:Jo,DATA_ATTR:Ko,DOCTYPE_NAME:Yn,ERB_EXPR:Yo,IS_ALLOWED_URI:jn,IS_SCRIPT_OR_DATA:Zo,MUSTACHE_EXPR:jo,TMPLIT_EXPR:qo});const at={element:1,text:3,progressingInstruction:7,comment:8,document:9},ei=function(){return typeof window>"u"?null:window},ti=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(n=r.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},un=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function qn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ei();const t=h=>qn(h);if(t.version="3.2.7",t.removed=[],!e||!e.document||e.document.nodeType!==at.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:l,Node:d,Element:u,NodeFilter:f,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:T,DOMParser:w,trustedTypes:E}=e,A=u.prototype,$=nt(A,"cloneNode"),G=nt(A,"remove"),D=nt(A,"nextSibling"),P=nt(A,"childNodes"),_=nt(A,"parentNode");if(typeof l=="function"){const h=r.createElement("template");h.content&&h.content.ownerDocument&&(r=h.content.ownerDocument)}let b,R="";const{implementation:x,createNodeIterator:y,createDocumentFragment:pe,getElementsByTagName:Re}=r,{importNode:zt}=n;let U=un();t.isSupported=typeof Hn=="function"&&typeof _=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ye,ERB_EXPR:qe,TMPLIT_EXPR:Ke,DATA_ATTR:Bt,ARIA_ATTR:Ut,IS_SCRIPT_OR_DATA:Xe,ATTR_WHITESPACE:Ze,CUSTOM_ELEMENT:J}=cn;let{IS_ALLOWED_URI:ve}=cn,O=null;const ee=S({},[...an,...nr,...ar,...or,...on]);let M=null;const ke=S({},[...sn,...ir,...ln,...Et]);let I=Object.seal(Gn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),te=null,ge=null,be=!0,re=!0,Pe=!1,Ee=!0,j=!1,ct=!0,Se=!1,Vt=!1,Wt=!1,Oe=!1,ut=!1,dt=!1,Sr=!0,Tr=!1;const sa="user-content-";let Ht=!0,Qe=!1,Ne={},$e=null;const wr=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let xr=null;const Cr=S({},["audio","video","img","source","image","track"]);let Gt=null;const Ar=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mt="http://www.w3.org/1998/Math/MathML",ft="http://www.w3.org/2000/svg",ue="http://www.w3.org/1999/xhtml";let De=ue,jt=!1,Yt=null;const la=S({},[mt,ft,ue],tr);let ht=S({},["mi","mo","mn","ms","mtext"]),pt=S({},["annotation-xml"]);const ca=S({},["title","style","font","a","script"]);let Je=null;const ua=["application/xhtml+xml","text/html"],da="text/html";let z=null,Me=null;const ma=r.createElement("form"),_r=function(o){return o instanceof RegExp||o instanceof Function},qt=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Me&&Me===o)){if((!o||typeof o!="object")&&(o={}),o=fe(o),Je=ua.indexOf(o.PARSER_MEDIA_TYPE)===-1?da:o.PARSER_MEDIA_TYPE,z=Je==="application/xhtml+xml"?tr:_t,O=ne(o,"ALLOWED_TAGS")?S({},o.ALLOWED_TAGS,z):ee,M=ne(o,"ALLOWED_ATTR")?S({},o.ALLOWED_ATTR,z):ke,Yt=ne(o,"ALLOWED_NAMESPACES")?S({},o.ALLOWED_NAMESPACES,tr):la,Gt=ne(o,"ADD_URI_SAFE_ATTR")?S(fe(Ar),o.ADD_URI_SAFE_ATTR,z):Ar,xr=ne(o,"ADD_DATA_URI_TAGS")?S(fe(Cr),o.ADD_DATA_URI_TAGS,z):Cr,$e=ne(o,"FORBID_CONTENTS")?S({},o.FORBID_CONTENTS,z):wr,te=ne(o,"FORBID_TAGS")?S({},o.FORBID_TAGS,z):fe({}),ge=ne(o,"FORBID_ATTR")?S({},o.FORBID_ATTR,z):fe({}),Ne=ne(o,"USE_PROFILES")?o.USE_PROFILES:!1,be=o.ALLOW_ARIA_ATTR!==!1,re=o.ALLOW_DATA_ATTR!==!1,Pe=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,j=o.SAFE_FOR_TEMPLATES||!1,ct=o.SAFE_FOR_XML!==!1,Se=o.WHOLE_DOCUMENT||!1,Oe=o.RETURN_DOM||!1,ut=o.RETURN_DOM_FRAGMENT||!1,dt=o.RETURN_TRUSTED_TYPE||!1,Wt=o.FORCE_BODY||!1,Sr=o.SANITIZE_DOM!==!1,Tr=o.SANITIZE_NAMED_PROPS||!1,Ht=o.KEEP_CONTENT!==!1,Qe=o.IN_PLACE||!1,ve=o.ALLOWED_URI_REGEXP||jn,De=o.NAMESPACE||ue,ht=o.MATHML_TEXT_INTEGRATION_POINTS||ht,pt=o.HTML_INTEGRATION_POINTS||pt,I=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&_r(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&_r(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),j&&(re=!1),ut&&(Oe=!0),Ne&&(O=S({},on),M=[],Ne.html===!0&&(S(O,an),S(M,sn)),Ne.svg===!0&&(S(O,nr),S(M,ir),S(M,Et)),Ne.svgFilters===!0&&(S(O,ar),S(M,ir),S(M,Et)),Ne.mathMl===!0&&(S(O,or),S(M,ln),S(M,Et))),o.ADD_TAGS&&(O===ee&&(O=fe(O)),S(O,o.ADD_TAGS,z)),o.ADD_ATTR&&(M===ke&&(M=fe(M)),S(M,o.ADD_ATTR,z)),o.ADD_URI_SAFE_ATTR&&S(Gt,o.ADD_URI_SAFE_ATTR,z),o.FORBID_CONTENTS&&($e===wr&&($e=fe($e)),S($e,o.FORBID_CONTENTS,z)),Ht&&(O["#text"]=!0),Se&&S(O,["html","head","body"]),O.table&&(S(O,["tbody"]),delete te.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=o.TRUSTED_TYPES_POLICY,R=b.createHTML("")}else b===void 0&&(b=ti(E,a)),b!==null&&typeof R=="string"&&(R=b.createHTML(""));q&&q(o),Me=o}},Ir=S({},[...nr,...ar,...Ho]),Rr=S({},[...or,...Go]),fa=function(o){let c=_(o);(!c||!c.tagName)&&(c={namespaceURI:De,tagName:"template"});const m=_t(o.tagName),N=_t(c.tagName);return Yt[o.namespaceURI]?o.namespaceURI===ft?c.namespaceURI===ue?m==="svg":c.namespaceURI===mt?m==="svg"&&(N==="annotation-xml"||ht[N]):!!Ir[m]:o.namespaceURI===mt?c.namespaceURI===ue?m==="math":c.namespaceURI===ft?m==="math"&&pt[N]:!!Rr[m]:o.namespaceURI===ue?c.namespaceURI===ft&&!pt[N]||c.namespaceURI===mt&&!ht[N]?!1:!Rr[m]&&(ca[m]||!Ir[m]):!!(Je==="application/xhtml+xml"&&Yt[o.namespaceURI]):!1},ie=function(o){et(t.removed,{element:o});try{_(o).removeChild(o)}catch{G(o)}},Te=function(o,c){try{et(t.removed,{attribute:c.getAttributeNode(o),from:c})}catch{et(t.removed,{attribute:null,from:c})}if(c.removeAttribute(o),o==="is")if(Oe||ut)try{ie(c)}catch{}else try{c.setAttribute(o,"")}catch{}},kr=function(o){let c=null,m=null;if(Wt)o="<remove></remove>"+o;else{const L=rr(o,/^[\r\n\t ]+/);m=L&&L[0]}Je==="application/xhtml+xml"&&De===ue&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const N=b?b.createHTML(o):o;if(De===ue)try{c=new w().parseFromString(N,Je)}catch{}if(!c||!c.documentElement){c=x.createDocument(De,"template",null);try{c.documentElement.innerHTML=jt?R:N}catch{}}const W=c.body||c.documentElement;return o&&m&&W.insertBefore(r.createTextNode(m),W.childNodes[0]||null),De===ue?Re.call(c,Se?"html":"body")[0]:Se?c.documentElement:W},Pr=function(o){return y.call(o.ownerDocument||o,o,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},Kt=function(o){return o instanceof T&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof p)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},Or=function(o){return typeof d=="function"&&o instanceof d};function de(h,o,c){vt(h,m=>{m.call(t,o,c,Me)})}const Nr=function(o){let c=null;if(de(U.beforeSanitizeElements,o,null),Kt(o))return ie(o),!0;const m=z(o.nodeName);if(de(U.uponSanitizeElement,o,{tagName:m,allowedTags:O}),ct&&o.hasChildNodes()&&!Or(o.firstElementChild)&&Y(/<[/\w!]/g,o.innerHTML)&&Y(/<[/\w!]/g,o.textContent)||o.nodeType===at.progressingInstruction||ct&&o.nodeType===at.comment&&Y(/<[/\w]/g,o.data))return ie(o),!0;if(!O[m]||te[m]){if(!te[m]&&Dr(m)&&(I.tagNameCheck instanceof RegExp&&Y(I.tagNameCheck,m)||I.tagNameCheck instanceof Function&&I.tagNameCheck(m)))return!1;if(Ht&&!$e[m]){const N=_(o)||o.parentNode,W=P(o)||o.childNodes;if(W&&N){const L=W.length;for(let X=L-1;X>=0;--X){const me=$(W[X],!0);me.__removalCount=(o.__removalCount||0)+1,N.insertBefore(me,D(o))}}}return ie(o),!0}return o instanceof u&&!fa(o)||(m==="noscript"||m==="noembed"||m==="noframes")&&Y(/<\/no(script|embed|frames)/i,o.innerHTML)?(ie(o),!0):(j&&o.nodeType===at.text&&(c=o.textContent,vt([Ye,qe,Ke],N=>{c=tt(c,N," ")}),o.textContent!==c&&(et(t.removed,{element:o.cloneNode()}),o.textContent=c)),de(U.afterSanitizeElements,o,null),!1)},$r=function(o,c,m){if(Sr&&(c==="id"||c==="name")&&(m in r||m in ma))return!1;if(!(re&&!ge[c]&&Y(Bt,c))){if(!(be&&Y(Ut,c))){if(!M[c]||ge[c]){if(!(Dr(o)&&(I.tagNameCheck instanceof RegExp&&Y(I.tagNameCheck,o)||I.tagNameCheck instanceof Function&&I.tagNameCheck(o))&&(I.attributeNameCheck instanceof RegExp&&Y(I.attributeNameCheck,c)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(c,o))||c==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&Y(I.tagNameCheck,m)||I.tagNameCheck instanceof Function&&I.tagNameCheck(m))))return!1}else if(!Gt[c]){if(!Y(ve,tt(m,Ze,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&o!=="script"&&Bo(m,"data:")===0&&xr[o])){if(!(Pe&&!Y(Xe,tt(m,Ze,"")))){if(m)return!1}}}}}}return!0},Dr=function(o){return o!=="annotation-xml"&&rr(o,J)},Mr=function(o){de(U.beforeSanitizeAttributes,o,null);const{attributes:c}=o;if(!c||Kt(o))return;const m={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let N=c.length;for(;N--;){const W=c[N],{name:L,namespaceURI:X,value:me}=W,Le=z(L),Xt=me;let V=L==="value"?Xt:Uo(Xt);if(m.attrName=Le,m.attrValue=V,m.keepAttr=!0,m.forceKeepAttr=void 0,de(U.uponSanitizeAttribute,o,m),V=m.attrValue,Tr&&(Le==="id"||Le==="name")&&(Te(L,o),V=sa+V),ct&&Y(/((--!?|])>)|<\/(style|title|textarea)/i,V)){Te(L,o);continue}if(Le==="attributename"&&rr(V,"href")){Te(L,o);continue}if(m.forceKeepAttr)continue;if(!m.keepAttr){Te(L,o);continue}if(!Ee&&Y(/\/>/i,V)){Te(L,o);continue}j&&vt([Ye,qe,Ke],Fr=>{V=tt(V,Fr," ")});const Lr=z(o.nodeName);if(!$r(Lr,Le,V)){Te(L,o);continue}if(b&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!X)switch(E.getAttributeType(Lr,Le)){case"TrustedHTML":{V=b.createHTML(V);break}case"TrustedScriptURL":{V=b.createScriptURL(V);break}}if(V!==Xt)try{X?o.setAttributeNS(X,L,V):o.setAttribute(L,V),Kt(o)?ie(o):nn(t.removed)}catch{Te(L,o)}}de(U.afterSanitizeAttributes,o,null)},ha=function h(o){let c=null;const m=Pr(o);for(de(U.beforeSanitizeShadowDOM,o,null);c=m.nextNode();)de(U.uponSanitizeShadowNode,c,null),Nr(c),Mr(c),c.content instanceof i&&h(c.content);de(U.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(h){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,m=null,N=null,W=null;if(jt=!h,jt&&(h="<!-->"),typeof h!="string"&&!Or(h))if(typeof h.toString=="function"){if(h=h.toString(),typeof h!="string")throw rt("dirty is not a string, aborting")}else throw rt("toString is not a function");if(!t.isSupported)return h;if(Vt||qt(o),t.removed=[],typeof h=="string"&&(Qe=!1),Qe){if(h.nodeName){const me=z(h.nodeName);if(!O[me]||te[me])throw rt("root node is forbidden and cannot be sanitized in-place")}}else if(h instanceof d)c=kr("<!---->"),m=c.ownerDocument.importNode(h,!0),m.nodeType===at.element&&m.nodeName==="BODY"||m.nodeName==="HTML"?c=m:c.appendChild(m);else{if(!Oe&&!j&&!Se&&h.indexOf("<")===-1)return b&&dt?b.createHTML(h):h;if(c=kr(h),!c)return Oe?null:dt?R:""}c&&Wt&&ie(c.firstChild);const L=Pr(Qe?h:c);for(;N=L.nextNode();)Nr(N),Mr(N),N.content instanceof i&&ha(N.content);if(Qe)return h;if(Oe){if(ut)for(W=pe.call(c.ownerDocument);c.firstChild;)W.appendChild(c.firstChild);else W=c;return(M.shadowroot||M.shadowrootmode)&&(W=zt.call(n,W,!0)),W}let X=Se?c.outerHTML:c.innerHTML;return Se&&O["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&Y(Yn,c.ownerDocument.doctype.name)&&(X="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
|
|
82
|
-
|
|
1662
|
+
`;
|
|
1663
|
+
const StepEl = dt.li((props) => {
|
|
1664
|
+
const defaultColor = useDefaultVariantColor(props.colorVariant);
|
|
1665
|
+
const defaultColorContent = useDefaultVariantContentColor(props.colorVariant);
|
|
1666
|
+
const backgroundColor = props.shouldBeFilled ? defaultColor : "var(--color-base-300)";
|
|
1667
|
+
const contentColor = props.shouldBeFilled ? defaultColorContent : "var(--color-base-content)";
|
|
1668
|
+
return {
|
|
1669
|
+
textAlign: "center",
|
|
1670
|
+
"--step-bg": backgroundColor,
|
|
1671
|
+
"--step-fg": contentColor,
|
|
1672
|
+
gridTemplateRows: "40px 1fr",
|
|
1673
|
+
gridTemplateColumns: "auto",
|
|
1674
|
+
gap: ".5rem",
|
|
1675
|
+
placeItems: "center",
|
|
1676
|
+
minWidth: "4rem",
|
|
1677
|
+
display: "grid",
|
|
1678
|
+
"&:not(:first-of-type):before": {
|
|
1679
|
+
width: "100%",
|
|
1680
|
+
height: "0.5rem",
|
|
1681
|
+
color: "var(--step-bg)",
|
|
1682
|
+
backgroundColor: "var(--step-bg)",
|
|
1683
|
+
"--tw-content": "''",
|
|
1684
|
+
content: "var(--tw-content)",
|
|
1685
|
+
border: "1px solid",
|
|
1686
|
+
gridRowStart: "1",
|
|
1687
|
+
gridColumnStart: "1",
|
|
1688
|
+
marginInlineStart: "-100%"
|
|
1689
|
+
},
|
|
1690
|
+
"&:after": {
|
|
1691
|
+
content: "counter(step)",
|
|
1692
|
+
counterIncrement: "step",
|
|
1693
|
+
zIndex: "1",
|
|
1694
|
+
color: "var(--step-fg)",
|
|
1695
|
+
backgroundColor: "var(--step-bg)",
|
|
1696
|
+
border: "1px solid var(--step-bg)",
|
|
1697
|
+
borderRadius: "3.40282e38px",
|
|
1698
|
+
gridRowStart: "1",
|
|
1699
|
+
gridColumnStart: "1",
|
|
1700
|
+
placeSelf: "center",
|
|
1701
|
+
placeItems: "center",
|
|
1702
|
+
width: "2rem",
|
|
1703
|
+
height: "2rem",
|
|
1704
|
+
display: "grid",
|
|
1705
|
+
position: "relative"
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
});
|
|
1709
|
+
const StepsProgress = (props) => {
|
|
1710
|
+
console.log("props.currentStepIndex", props.currentStepIndex);
|
|
1711
|
+
return React.createElement(StepsContainer, {
|
|
1712
|
+
children: [
|
|
1713
|
+
props.steps.map(
|
|
1714
|
+
(step, index) => React.createElement(StepEl, {
|
|
1715
|
+
key: step.title,
|
|
1716
|
+
colorVariant: props.colorVariant,
|
|
1717
|
+
shouldBeFilled: props.currentStepIndex >= index,
|
|
1718
|
+
children: step.title
|
|
1719
|
+
})
|
|
1720
|
+
)
|
|
1721
|
+
]
|
|
1722
|
+
});
|
|
1723
|
+
};
|
|
1724
|
+
const styles = {
|
|
1725
|
+
title: {
|
|
1726
|
+
marginTop: "0",
|
|
1727
|
+
marginBottom: ".888889em",
|
|
1728
|
+
fontWeight: "700",
|
|
1729
|
+
fontSize: "2.25em",
|
|
1730
|
+
lineHeight: "1.11111"
|
|
1731
|
+
},
|
|
1732
|
+
subtitle: {
|
|
1733
|
+
marginTop: "2em",
|
|
1734
|
+
fontWeight: "700",
|
|
1735
|
+
marginBottom: "1em",
|
|
1736
|
+
fontSize: "1.5em",
|
|
1737
|
+
lineHeight: "1.33333"
|
|
1738
|
+
},
|
|
1739
|
+
section: {
|
|
1740
|
+
marginBottom: "1em",
|
|
1741
|
+
fontWeight: "600",
|
|
1742
|
+
fontSize: "1.25em",
|
|
1743
|
+
lineHeight: "1.6"
|
|
1744
|
+
},
|
|
1745
|
+
subsection: {
|
|
1746
|
+
marginTop: "1.5em",
|
|
1747
|
+
marginBottom: ".5em",
|
|
1748
|
+
fontWeight: "600",
|
|
1749
|
+
fontSize: "1rem"
|
|
1750
|
+
},
|
|
1751
|
+
paragraph: {
|
|
1752
|
+
marginTop: "0",
|
|
1753
|
+
marginBottom: "1.25em",
|
|
1754
|
+
fontSize: "1rem"
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
const TypographyMain = dt.div((props) => ({
|
|
1758
|
+
...styles[props.$variant ?? "paragraph"],
|
|
1759
|
+
color: props.theme.baseContent,
|
|
1760
|
+
...props.$linear ? { margin: "0" } : {}
|
|
1761
|
+
}));
|
|
1762
|
+
const Typography = (props) => {
|
|
1763
|
+
return React.createElement(TypographyMain, {
|
|
1764
|
+
$variant: props.variant,
|
|
1765
|
+
$linear: props.linear,
|
|
1766
|
+
children: props.children
|
|
1767
|
+
});
|
|
1768
|
+
};
|
|
1769
|
+
const initialStateByType = (type) => {
|
|
1770
|
+
switch (type) {
|
|
1771
|
+
case "textarea":
|
|
1772
|
+
return "";
|
|
1773
|
+
case "select":
|
|
1774
|
+
return "";
|
|
1775
|
+
case "checkbox-group":
|
|
1776
|
+
return [];
|
|
1777
|
+
case "radio-group":
|
|
1778
|
+
return "";
|
|
1779
|
+
case "matrix":
|
|
1780
|
+
return null;
|
|
1781
|
+
case "range-slide":
|
|
1782
|
+
return null;
|
|
1783
|
+
case "rating":
|
|
1784
|
+
return null;
|
|
1785
|
+
default:
|
|
1786
|
+
return null;
|
|
1787
|
+
}
|
|
1788
|
+
};
|
|
1789
|
+
const useForm = (props) => {
|
|
1790
|
+
const formData = React.useMemo(
|
|
1791
|
+
() => props.form.steps.reduce(
|
|
1792
|
+
(acc, step, index) => {
|
|
1793
|
+
acc.validationsPerStep[index] = {};
|
|
1794
|
+
acc.steps = [
|
|
1795
|
+
...acc.steps,
|
|
1796
|
+
{
|
|
1797
|
+
...step,
|
|
1798
|
+
fields: step.fields.map((field) => {
|
|
1799
|
+
const dataField = field.meta.fieldKey;
|
|
1800
|
+
if (dataField) {
|
|
1801
|
+
acc.validationsPerStep[index][dataField] = {
|
|
1802
|
+
fieldType: field.type,
|
|
1803
|
+
validations: field.validations
|
|
1804
|
+
};
|
|
1805
|
+
acc.state = {
|
|
1806
|
+
...acc.state,
|
|
1807
|
+
[dataField]: initialStateByType(field.type)
|
|
1808
|
+
};
|
|
1809
|
+
return {
|
|
1810
|
+
dataField,
|
|
1811
|
+
...field
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
return {
|
|
1815
|
+
...field,
|
|
1816
|
+
dataField: null
|
|
1817
|
+
};
|
|
1818
|
+
})
|
|
1819
|
+
}
|
|
1820
|
+
];
|
|
1821
|
+
return acc;
|
|
1822
|
+
},
|
|
1823
|
+
{
|
|
1824
|
+
validationsPerStep: {},
|
|
1825
|
+
state: {},
|
|
1826
|
+
steps: []
|
|
1827
|
+
}
|
|
1828
|
+
),
|
|
1829
|
+
[props.form]
|
|
1830
|
+
);
|
|
1831
|
+
const [state, setState] = React.useState(formData.state);
|
|
1832
|
+
const setStateByKey = React.useCallback(
|
|
1833
|
+
(key, value) => {
|
|
1834
|
+
if (key === null) return;
|
|
1835
|
+
setState((prevState) => ({
|
|
1836
|
+
...prevState,
|
|
1837
|
+
[key]: value
|
|
1838
|
+
}));
|
|
1839
|
+
},
|
|
1840
|
+
[setState]
|
|
1841
|
+
);
|
|
1842
|
+
const getStateByKey = React.useCallback(
|
|
1843
|
+
(key) => {
|
|
1844
|
+
return key ? state[key] : null;
|
|
1845
|
+
},
|
|
1846
|
+
[state]
|
|
1847
|
+
);
|
|
1848
|
+
return {
|
|
1849
|
+
steps: formData.steps,
|
|
1850
|
+
validationsPerStep: formData.validationsPerStep,
|
|
1851
|
+
state,
|
|
1852
|
+
setStateByKey,
|
|
1853
|
+
getStateByKey
|
|
1854
|
+
};
|
|
1855
|
+
};
|
|
1856
|
+
const baseApi = createBaseApi();
|
|
1857
|
+
const saveForm = (body, options) => baseApi.post(`/feedback-receiver`, body, options);
|
|
1858
|
+
/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */
|
|
1859
|
+
const {
|
|
1860
|
+
entries,
|
|
1861
|
+
setPrototypeOf,
|
|
1862
|
+
isFrozen,
|
|
1863
|
+
getPrototypeOf,
|
|
1864
|
+
getOwnPropertyDescriptor
|
|
1865
|
+
} = Object;
|
|
1866
|
+
let {
|
|
1867
|
+
freeze,
|
|
1868
|
+
seal,
|
|
1869
|
+
create
|
|
1870
|
+
} = Object;
|
|
1871
|
+
let {
|
|
1872
|
+
apply,
|
|
1873
|
+
construct
|
|
1874
|
+
} = typeof Reflect !== "undefined" && Reflect;
|
|
1875
|
+
if (!freeze) {
|
|
1876
|
+
freeze = function freeze2(x2) {
|
|
1877
|
+
return x2;
|
|
1878
|
+
};
|
|
1879
|
+
}
|
|
1880
|
+
if (!seal) {
|
|
1881
|
+
seal = function seal2(x2) {
|
|
1882
|
+
return x2;
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
if (!apply) {
|
|
1886
|
+
apply = function apply2(func, thisArg) {
|
|
1887
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1888
|
+
args[_key - 2] = arguments[_key];
|
|
1889
|
+
}
|
|
1890
|
+
return func.apply(thisArg, args);
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
if (!construct) {
|
|
1894
|
+
construct = function construct2(Func) {
|
|
1895
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1896
|
+
args[_key2 - 1] = arguments[_key2];
|
|
1897
|
+
}
|
|
1898
|
+
return new Func(...args);
|
|
1899
|
+
};
|
|
1900
|
+
}
|
|
1901
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
|
1902
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
1903
|
+
const arrayPop = unapply(Array.prototype.pop);
|
|
1904
|
+
const arrayPush = unapply(Array.prototype.push);
|
|
1905
|
+
const arraySplice = unapply(Array.prototype.splice);
|
|
1906
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
1907
|
+
const stringToString = unapply(String.prototype.toString);
|
|
1908
|
+
const stringMatch = unapply(String.prototype.match);
|
|
1909
|
+
const stringReplace = unapply(String.prototype.replace);
|
|
1910
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
1911
|
+
const stringTrim = unapply(String.prototype.trim);
|
|
1912
|
+
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
1913
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
|
1914
|
+
const typeErrorCreate = unconstruct(TypeError);
|
|
1915
|
+
function unapply(func) {
|
|
1916
|
+
return function(thisArg) {
|
|
1917
|
+
if (thisArg instanceof RegExp) {
|
|
1918
|
+
thisArg.lastIndex = 0;
|
|
1919
|
+
}
|
|
1920
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
1921
|
+
args[_key3 - 1] = arguments[_key3];
|
|
1922
|
+
}
|
|
1923
|
+
return apply(func, thisArg, args);
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
function unconstruct(Func) {
|
|
1927
|
+
return function() {
|
|
1928
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
1929
|
+
args[_key4] = arguments[_key4];
|
|
1930
|
+
}
|
|
1931
|
+
return construct(Func, args);
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
function addToSet(set, array) {
|
|
1935
|
+
let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
|
|
1936
|
+
if (setPrototypeOf) {
|
|
1937
|
+
setPrototypeOf(set, null);
|
|
1938
|
+
}
|
|
1939
|
+
let l = array.length;
|
|
1940
|
+
while (l--) {
|
|
1941
|
+
let element = array[l];
|
|
1942
|
+
if (typeof element === "string") {
|
|
1943
|
+
const lcElement = transformCaseFunc(element);
|
|
1944
|
+
if (lcElement !== element) {
|
|
1945
|
+
if (!isFrozen(array)) {
|
|
1946
|
+
array[l] = lcElement;
|
|
1947
|
+
}
|
|
1948
|
+
element = lcElement;
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
set[element] = true;
|
|
1952
|
+
}
|
|
1953
|
+
return set;
|
|
1954
|
+
}
|
|
1955
|
+
function cleanArray(array) {
|
|
1956
|
+
for (let index = 0; index < array.length; index++) {
|
|
1957
|
+
const isPropertyExist = objectHasOwnProperty(array, index);
|
|
1958
|
+
if (!isPropertyExist) {
|
|
1959
|
+
array[index] = null;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
return array;
|
|
1963
|
+
}
|
|
1964
|
+
function clone(object) {
|
|
1965
|
+
const newObject = create(null);
|
|
1966
|
+
for (const [property, value] of entries(object)) {
|
|
1967
|
+
const isPropertyExist = objectHasOwnProperty(object, property);
|
|
1968
|
+
if (isPropertyExist) {
|
|
1969
|
+
if (Array.isArray(value)) {
|
|
1970
|
+
newObject[property] = cleanArray(value);
|
|
1971
|
+
} else if (value && typeof value === "object" && value.constructor === Object) {
|
|
1972
|
+
newObject[property] = clone(value);
|
|
1973
|
+
} else {
|
|
1974
|
+
newObject[property] = value;
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
return newObject;
|
|
1979
|
+
}
|
|
1980
|
+
function lookupGetter(object, prop) {
|
|
1981
|
+
while (object !== null) {
|
|
1982
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
1983
|
+
if (desc) {
|
|
1984
|
+
if (desc.get) {
|
|
1985
|
+
return unapply(desc.get);
|
|
1986
|
+
}
|
|
1987
|
+
if (typeof desc.value === "function") {
|
|
1988
|
+
return unapply(desc.value);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
object = getPrototypeOf(object);
|
|
1992
|
+
}
|
|
1993
|
+
function fallbackValue() {
|
|
1994
|
+
return null;
|
|
1995
|
+
}
|
|
1996
|
+
return fallbackValue;
|
|
1997
|
+
}
|
|
1998
|
+
const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
|
|
1999
|
+
const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "slot", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
|
|
2000
|
+
const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
|
|
2001
|
+
const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
|
|
2002
|
+
const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
|
|
2003
|
+
const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
|
|
2004
|
+
const text = freeze(["#text"]);
|
|
2005
|
+
const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
|
|
2006
|
+
const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
|
|
2007
|
+
const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
|
|
2008
|
+
const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
|
|
2009
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
|
|
2010
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
2011
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
|
|
2012
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
|
|
2013
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
|
|
2014
|
+
const IS_ALLOWED_URI = seal(
|
|
2015
|
+
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
2016
|
+
// eslint-disable-line no-useless-escape
|
|
2017
|
+
);
|
|
2018
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
2019
|
+
const ATTR_WHITESPACE = seal(
|
|
2020
|
+
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
2021
|
+
// eslint-disable-line no-control-regex
|
|
2022
|
+
);
|
|
2023
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
|
2024
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
2025
|
+
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
|
|
2026
|
+
__proto__: null,
|
|
2027
|
+
ARIA_ATTR,
|
|
2028
|
+
ATTR_WHITESPACE,
|
|
2029
|
+
CUSTOM_ELEMENT,
|
|
2030
|
+
DATA_ATTR,
|
|
2031
|
+
DOCTYPE_NAME,
|
|
2032
|
+
ERB_EXPR,
|
|
2033
|
+
IS_ALLOWED_URI,
|
|
2034
|
+
IS_SCRIPT_OR_DATA,
|
|
2035
|
+
MUSTACHE_EXPR,
|
|
2036
|
+
TMPLIT_EXPR
|
|
2037
|
+
});
|
|
2038
|
+
const NODE_TYPE = {
|
|
2039
|
+
element: 1,
|
|
2040
|
+
text: 3,
|
|
2041
|
+
// Deprecated
|
|
2042
|
+
progressingInstruction: 7,
|
|
2043
|
+
comment: 8,
|
|
2044
|
+
document: 9
|
|
2045
|
+
};
|
|
2046
|
+
const getGlobal = function getGlobal2() {
|
|
2047
|
+
return typeof window === "undefined" ? null : window;
|
|
2048
|
+
};
|
|
2049
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
|
|
2050
|
+
if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
|
|
2051
|
+
return null;
|
|
2052
|
+
}
|
|
2053
|
+
let suffix = null;
|
|
2054
|
+
const ATTR_NAME = "data-tt-policy-suffix";
|
|
2055
|
+
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
|
2056
|
+
suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
|
2057
|
+
}
|
|
2058
|
+
const policyName = "dompurify" + (suffix ? "#" + suffix : "");
|
|
2059
|
+
try {
|
|
2060
|
+
return trustedTypes.createPolicy(policyName, {
|
|
2061
|
+
createHTML(html2) {
|
|
2062
|
+
return html2;
|
|
2063
|
+
},
|
|
2064
|
+
createScriptURL(scriptUrl) {
|
|
2065
|
+
return scriptUrl;
|
|
2066
|
+
}
|
|
2067
|
+
});
|
|
2068
|
+
} catch (_2) {
|
|
2069
|
+
console.warn("TrustedTypes policy " + policyName + " could not be created.");
|
|
2070
|
+
return null;
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
2073
|
+
const _createHooksMap = function _createHooksMap2() {
|
|
2074
|
+
return {
|
|
2075
|
+
afterSanitizeAttributes: [],
|
|
2076
|
+
afterSanitizeElements: [],
|
|
2077
|
+
afterSanitizeShadowDOM: [],
|
|
2078
|
+
beforeSanitizeAttributes: [],
|
|
2079
|
+
beforeSanitizeElements: [],
|
|
2080
|
+
beforeSanitizeShadowDOM: [],
|
|
2081
|
+
uponSanitizeAttribute: [],
|
|
2082
|
+
uponSanitizeElement: [],
|
|
2083
|
+
uponSanitizeShadowNode: []
|
|
2084
|
+
};
|
|
2085
|
+
};
|
|
2086
|
+
function createDOMPurify() {
|
|
2087
|
+
let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
|
2088
|
+
const DOMPurify = (root) => createDOMPurify(root);
|
|
2089
|
+
DOMPurify.version = "3.2.7";
|
|
2090
|
+
DOMPurify.removed = [];
|
|
2091
|
+
if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
|
|
2092
|
+
DOMPurify.isSupported = false;
|
|
2093
|
+
return DOMPurify;
|
|
2094
|
+
}
|
|
2095
|
+
let {
|
|
2096
|
+
document: document2
|
|
2097
|
+
} = window2;
|
|
2098
|
+
const originalDocument = document2;
|
|
2099
|
+
const currentScript = originalDocument.currentScript;
|
|
2100
|
+
const {
|
|
2101
|
+
DocumentFragment,
|
|
2102
|
+
HTMLTemplateElement,
|
|
2103
|
+
Node,
|
|
2104
|
+
Element,
|
|
2105
|
+
NodeFilter,
|
|
2106
|
+
NamedNodeMap = window2.NamedNodeMap || window2.MozNamedAttrMap,
|
|
2107
|
+
HTMLFormElement,
|
|
2108
|
+
DOMParser,
|
|
2109
|
+
trustedTypes
|
|
2110
|
+
} = window2;
|
|
2111
|
+
const ElementPrototype = Element.prototype;
|
|
2112
|
+
const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
|
|
2113
|
+
const remove = lookupGetter(ElementPrototype, "remove");
|
|
2114
|
+
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
|
|
2115
|
+
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
|
2116
|
+
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
|
|
2117
|
+
if (typeof HTMLTemplateElement === "function") {
|
|
2118
|
+
const template = document2.createElement("template");
|
|
2119
|
+
if (template.content && template.content.ownerDocument) {
|
|
2120
|
+
document2 = template.content.ownerDocument;
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
let trustedTypesPolicy;
|
|
2124
|
+
let emptyHTML = "";
|
|
2125
|
+
const {
|
|
2126
|
+
implementation,
|
|
2127
|
+
createNodeIterator,
|
|
2128
|
+
createDocumentFragment,
|
|
2129
|
+
getElementsByTagName
|
|
2130
|
+
} = document2;
|
|
2131
|
+
const {
|
|
2132
|
+
importNode
|
|
2133
|
+
} = originalDocument;
|
|
2134
|
+
let hooks = _createHooksMap();
|
|
2135
|
+
DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
|
|
2136
|
+
const {
|
|
2137
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR2,
|
|
2138
|
+
ERB_EXPR: ERB_EXPR2,
|
|
2139
|
+
TMPLIT_EXPR: TMPLIT_EXPR2,
|
|
2140
|
+
DATA_ATTR: DATA_ATTR2,
|
|
2141
|
+
ARIA_ATTR: ARIA_ATTR2,
|
|
2142
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2,
|
|
2143
|
+
ATTR_WHITESPACE: ATTR_WHITESPACE2,
|
|
2144
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT2
|
|
2145
|
+
} = EXPRESSIONS;
|
|
2146
|
+
let {
|
|
2147
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
2148
|
+
} = EXPRESSIONS;
|
|
2149
|
+
let ALLOWED_TAGS = null;
|
|
2150
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
|
2151
|
+
let ALLOWED_ATTR = null;
|
|
2152
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
|
2153
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
2154
|
+
tagNameCheck: {
|
|
2155
|
+
writable: true,
|
|
2156
|
+
configurable: false,
|
|
2157
|
+
enumerable: true,
|
|
2158
|
+
value: null
|
|
2159
|
+
},
|
|
2160
|
+
attributeNameCheck: {
|
|
2161
|
+
writable: true,
|
|
2162
|
+
configurable: false,
|
|
2163
|
+
enumerable: true,
|
|
2164
|
+
value: null
|
|
2165
|
+
},
|
|
2166
|
+
allowCustomizedBuiltInElements: {
|
|
2167
|
+
writable: true,
|
|
2168
|
+
configurable: false,
|
|
2169
|
+
enumerable: true,
|
|
2170
|
+
value: false
|
|
2171
|
+
}
|
|
2172
|
+
}));
|
|
2173
|
+
let FORBID_TAGS = null;
|
|
2174
|
+
let FORBID_ATTR = null;
|
|
2175
|
+
let ALLOW_ARIA_ATTR = true;
|
|
2176
|
+
let ALLOW_DATA_ATTR = true;
|
|
2177
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
2178
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
2179
|
+
let SAFE_FOR_TEMPLATES = false;
|
|
2180
|
+
let SAFE_FOR_XML = true;
|
|
2181
|
+
let WHOLE_DOCUMENT = false;
|
|
2182
|
+
let SET_CONFIG = false;
|
|
2183
|
+
let FORCE_BODY = false;
|
|
2184
|
+
let RETURN_DOM = false;
|
|
2185
|
+
let RETURN_DOM_FRAGMENT = false;
|
|
2186
|
+
let RETURN_TRUSTED_TYPE = false;
|
|
2187
|
+
let SANITIZE_DOM = true;
|
|
2188
|
+
let SANITIZE_NAMED_PROPS = false;
|
|
2189
|
+
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
|
|
2190
|
+
let KEEP_CONTENT = true;
|
|
2191
|
+
let IN_PLACE = false;
|
|
2192
|
+
let USE_PROFILES = {};
|
|
2193
|
+
let FORBID_CONTENTS = null;
|
|
2194
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
2195
|
+
let DATA_URI_TAGS = null;
|
|
2196
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
2197
|
+
let URI_SAFE_ATTRIBUTES = null;
|
|
2198
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
|
|
2199
|
+
const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
|
2200
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
2201
|
+
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
2202
|
+
let NAMESPACE = HTML_NAMESPACE;
|
|
2203
|
+
let IS_EMPTY_INPUT = false;
|
|
2204
|
+
let ALLOWED_NAMESPACES = null;
|
|
2205
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
2206
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
|
|
2207
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
|
|
2208
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
|
|
2209
|
+
let PARSER_MEDIA_TYPE = null;
|
|
2210
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
|
|
2211
|
+
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
|
2212
|
+
let transformCaseFunc = null;
|
|
2213
|
+
let CONFIG = null;
|
|
2214
|
+
const formElement = document2.createElement("form");
|
|
2215
|
+
const isRegexOrFunction = function isRegexOrFunction2(testValue) {
|
|
2216
|
+
return testValue instanceof RegExp || testValue instanceof Function;
|
|
2217
|
+
};
|
|
2218
|
+
const _parseConfig = function _parseConfig2() {
|
|
2219
|
+
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2220
|
+
if (CONFIG && CONFIG === cfg) {
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
if (!cfg || typeof cfg !== "object") {
|
|
2224
|
+
cfg = {};
|
|
2225
|
+
}
|
|
2226
|
+
cfg = clone(cfg);
|
|
2227
|
+
PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
|
|
2228
|
+
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
2229
|
+
transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
|
|
2230
|
+
ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
2231
|
+
ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
2232
|
+
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
2233
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
2234
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
2235
|
+
FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
2236
|
+
FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
|
2237
|
+
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
|
2238
|
+
USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
|
|
2239
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
|
|
2240
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
|
|
2241
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
|
|
2242
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
|
|
2243
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
|
|
2244
|
+
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
|
|
2245
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
|
|
2246
|
+
RETURN_DOM = cfg.RETURN_DOM || false;
|
|
2247
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
|
|
2248
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
|
|
2249
|
+
FORCE_BODY = cfg.FORCE_BODY || false;
|
|
2250
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
|
|
2251
|
+
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
|
|
2252
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
|
|
2253
|
+
IN_PLACE = cfg.IN_PLACE || false;
|
|
2254
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
2255
|
+
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
2256
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
2257
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
2258
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
2259
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
2260
|
+
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
2261
|
+
}
|
|
2262
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
|
2263
|
+
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
|
2264
|
+
}
|
|
2265
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
|
|
2266
|
+
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
|
2267
|
+
}
|
|
2268
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2269
|
+
ALLOW_DATA_ATTR = false;
|
|
2270
|
+
}
|
|
2271
|
+
if (RETURN_DOM_FRAGMENT) {
|
|
2272
|
+
RETURN_DOM = true;
|
|
2273
|
+
}
|
|
2274
|
+
if (USE_PROFILES) {
|
|
2275
|
+
ALLOWED_TAGS = addToSet({}, text);
|
|
2276
|
+
ALLOWED_ATTR = [];
|
|
2277
|
+
if (USE_PROFILES.html === true) {
|
|
2278
|
+
addToSet(ALLOWED_TAGS, html$1);
|
|
2279
|
+
addToSet(ALLOWED_ATTR, html);
|
|
2280
|
+
}
|
|
2281
|
+
if (USE_PROFILES.svg === true) {
|
|
2282
|
+
addToSet(ALLOWED_TAGS, svg$1);
|
|
2283
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
2284
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
2285
|
+
}
|
|
2286
|
+
if (USE_PROFILES.svgFilters === true) {
|
|
2287
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
|
2288
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
2289
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
2290
|
+
}
|
|
2291
|
+
if (USE_PROFILES.mathMl === true) {
|
|
2292
|
+
addToSet(ALLOWED_TAGS, mathMl$1);
|
|
2293
|
+
addToSet(ALLOWED_ATTR, mathMl);
|
|
2294
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
if (cfg.ADD_TAGS) {
|
|
2298
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
2299
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
2300
|
+
}
|
|
2301
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
2302
|
+
}
|
|
2303
|
+
if (cfg.ADD_ATTR) {
|
|
2304
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
2305
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
2306
|
+
}
|
|
2307
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
2308
|
+
}
|
|
2309
|
+
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
2310
|
+
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
2311
|
+
}
|
|
2312
|
+
if (cfg.FORBID_CONTENTS) {
|
|
2313
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
2314
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
2315
|
+
}
|
|
2316
|
+
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
2317
|
+
}
|
|
2318
|
+
if (KEEP_CONTENT) {
|
|
2319
|
+
ALLOWED_TAGS["#text"] = true;
|
|
2320
|
+
}
|
|
2321
|
+
if (WHOLE_DOCUMENT) {
|
|
2322
|
+
addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
|
|
2323
|
+
}
|
|
2324
|
+
if (ALLOWED_TAGS.table) {
|
|
2325
|
+
addToSet(ALLOWED_TAGS, ["tbody"]);
|
|
2326
|
+
delete FORBID_TAGS.tbody;
|
|
2327
|
+
}
|
|
2328
|
+
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
2329
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
|
|
2330
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2331
|
+
}
|
|
2332
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
|
|
2333
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2334
|
+
}
|
|
2335
|
+
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
2336
|
+
emptyHTML = trustedTypesPolicy.createHTML("");
|
|
2337
|
+
} else {
|
|
2338
|
+
if (trustedTypesPolicy === void 0) {
|
|
2339
|
+
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
2340
|
+
}
|
|
2341
|
+
if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
|
|
2342
|
+
emptyHTML = trustedTypesPolicy.createHTML("");
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
if (freeze) {
|
|
2346
|
+
freeze(cfg);
|
|
2347
|
+
}
|
|
2348
|
+
CONFIG = cfg;
|
|
2349
|
+
};
|
|
2350
|
+
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
2351
|
+
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
2352
|
+
const _checkValidNamespace = function _checkValidNamespace2(element) {
|
|
2353
|
+
let parent = getParentNode(element);
|
|
2354
|
+
if (!parent || !parent.tagName) {
|
|
2355
|
+
parent = {
|
|
2356
|
+
namespaceURI: NAMESPACE,
|
|
2357
|
+
tagName: "template"
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2360
|
+
const tagName = stringToLowerCase(element.tagName);
|
|
2361
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
|
2362
|
+
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
2363
|
+
return false;
|
|
2364
|
+
}
|
|
2365
|
+
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
2366
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
2367
|
+
return tagName === "svg";
|
|
2368
|
+
}
|
|
2369
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
2370
|
+
return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
2371
|
+
}
|
|
2372
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
2373
|
+
}
|
|
2374
|
+
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
2375
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
2376
|
+
return tagName === "math";
|
|
2377
|
+
}
|
|
2378
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
2379
|
+
return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
|
|
2380
|
+
}
|
|
2381
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
2382
|
+
}
|
|
2383
|
+
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
2384
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
2385
|
+
return false;
|
|
2386
|
+
}
|
|
2387
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
2388
|
+
return false;
|
|
2389
|
+
}
|
|
2390
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
2391
|
+
}
|
|
2392
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
2393
|
+
return true;
|
|
2394
|
+
}
|
|
2395
|
+
return false;
|
|
2396
|
+
};
|
|
2397
|
+
const _forceRemove = function _forceRemove2(node2) {
|
|
2398
|
+
arrayPush(DOMPurify.removed, {
|
|
2399
|
+
element: node2
|
|
2400
|
+
});
|
|
2401
|
+
try {
|
|
2402
|
+
getParentNode(node2).removeChild(node2);
|
|
2403
|
+
} catch (_2) {
|
|
2404
|
+
remove(node2);
|
|
2405
|
+
}
|
|
2406
|
+
};
|
|
2407
|
+
const _removeAttribute = function _removeAttribute2(name, element) {
|
|
2408
|
+
try {
|
|
2409
|
+
arrayPush(DOMPurify.removed, {
|
|
2410
|
+
attribute: element.getAttributeNode(name),
|
|
2411
|
+
from: element
|
|
2412
|
+
});
|
|
2413
|
+
} catch (_2) {
|
|
2414
|
+
arrayPush(DOMPurify.removed, {
|
|
2415
|
+
attribute: null,
|
|
2416
|
+
from: element
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
element.removeAttribute(name);
|
|
2420
|
+
if (name === "is") {
|
|
2421
|
+
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
2422
|
+
try {
|
|
2423
|
+
_forceRemove(element);
|
|
2424
|
+
} catch (_2) {
|
|
2425
|
+
}
|
|
2426
|
+
} else {
|
|
2427
|
+
try {
|
|
2428
|
+
element.setAttribute(name, "");
|
|
2429
|
+
} catch (_2) {
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
};
|
|
2434
|
+
const _initDocument = function _initDocument2(dirty) {
|
|
2435
|
+
let doc = null;
|
|
2436
|
+
let leadingWhitespace = null;
|
|
2437
|
+
if (FORCE_BODY) {
|
|
2438
|
+
dirty = "<remove></remove>" + dirty;
|
|
2439
|
+
} else {
|
|
2440
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
2441
|
+
leadingWhitespace = matches && matches[0];
|
|
2442
|
+
}
|
|
2443
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
|
|
2444
|
+
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
|
|
2445
|
+
}
|
|
2446
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
2447
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
|
2448
|
+
try {
|
|
2449
|
+
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
2450
|
+
} catch (_2) {
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
if (!doc || !doc.documentElement) {
|
|
2454
|
+
doc = implementation.createDocument(NAMESPACE, "template", null);
|
|
2455
|
+
try {
|
|
2456
|
+
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
|
2457
|
+
} catch (_2) {
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
const body = doc.body || doc.documentElement;
|
|
2461
|
+
if (dirty && leadingWhitespace) {
|
|
2462
|
+
body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
2463
|
+
}
|
|
2464
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
|
2465
|
+
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
|
|
2466
|
+
}
|
|
2467
|
+
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
2468
|
+
};
|
|
2469
|
+
const _createNodeIterator = function _createNodeIterator2(root) {
|
|
2470
|
+
return createNodeIterator.call(
|
|
2471
|
+
root.ownerDocument || root,
|
|
2472
|
+
root,
|
|
2473
|
+
// eslint-disable-next-line no-bitwise
|
|
2474
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
|
|
2475
|
+
null
|
|
2476
|
+
);
|
|
2477
|
+
};
|
|
2478
|
+
const _isClobbered = function _isClobbered2(element) {
|
|
2479
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
|
|
2480
|
+
};
|
|
2481
|
+
const _isNode = function _isNode2(value) {
|
|
2482
|
+
return typeof Node === "function" && value instanceof Node;
|
|
2483
|
+
};
|
|
2484
|
+
function _executeHooks(hooks2, currentNode, data) {
|
|
2485
|
+
arrayForEach(hooks2, (hook) => {
|
|
2486
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
const _sanitizeElements = function _sanitizeElements2(currentNode) {
|
|
2490
|
+
let content = null;
|
|
2491
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
2492
|
+
if (_isClobbered(currentNode)) {
|
|
2493
|
+
_forceRemove(currentNode);
|
|
2494
|
+
return true;
|
|
2495
|
+
}
|
|
2496
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
2497
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
2498
|
+
tagName,
|
|
2499
|
+
allowedTags: ALLOWED_TAGS
|
|
2500
|
+
});
|
|
2501
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
2502
|
+
_forceRemove(currentNode);
|
|
2503
|
+
return true;
|
|
2504
|
+
}
|
|
2505
|
+
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
2506
|
+
_forceRemove(currentNode);
|
|
2507
|
+
return true;
|
|
2508
|
+
}
|
|
2509
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
2510
|
+
_forceRemove(currentNode);
|
|
2511
|
+
return true;
|
|
2512
|
+
}
|
|
2513
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
2514
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
2515
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
2516
|
+
return false;
|
|
2517
|
+
}
|
|
2518
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
2519
|
+
return false;
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
2523
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
2524
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
2525
|
+
if (childNodes && parentNode) {
|
|
2526
|
+
const childCount = childNodes.length;
|
|
2527
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
2528
|
+
const childClone = cloneNode(childNodes[i], true);
|
|
2529
|
+
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
|
2530
|
+
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
_forceRemove(currentNode);
|
|
2535
|
+
return true;
|
|
2536
|
+
}
|
|
2537
|
+
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
2538
|
+
_forceRemove(currentNode);
|
|
2539
|
+
return true;
|
|
2540
|
+
}
|
|
2541
|
+
if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
2542
|
+
_forceRemove(currentNode);
|
|
2543
|
+
return true;
|
|
2544
|
+
}
|
|
2545
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
2546
|
+
content = currentNode.textContent;
|
|
2547
|
+
arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
|
|
2548
|
+
content = stringReplace(content, expr, " ");
|
|
2549
|
+
});
|
|
2550
|
+
if (currentNode.textContent !== content) {
|
|
2551
|
+
arrayPush(DOMPurify.removed, {
|
|
2552
|
+
element: currentNode.cloneNode()
|
|
2553
|
+
});
|
|
2554
|
+
currentNode.textContent = content;
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
2558
|
+
return false;
|
|
2559
|
+
};
|
|
2560
|
+
const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
|
|
2561
|
+
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
|
|
2562
|
+
return false;
|
|
2563
|
+
}
|
|
2564
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) ;
|
|
2565
|
+
else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName)) ;
|
|
2566
|
+
else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
2567
|
+
if (
|
|
2568
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
2569
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2570
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
2571
|
+
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
2572
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2573
|
+
lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))
|
|
2574
|
+
) ;
|
|
2575
|
+
else {
|
|
2576
|
+
return false;
|
|
2577
|
+
}
|
|
2578
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ;
|
|
2579
|
+
else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE2, ""))) ;
|
|
2580
|
+
else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) ;
|
|
2581
|
+
else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value, ATTR_WHITESPACE2, ""))) ;
|
|
2582
|
+
else if (value) {
|
|
2583
|
+
return false;
|
|
2584
|
+
} else ;
|
|
2585
|
+
return true;
|
|
2586
|
+
};
|
|
2587
|
+
const _isBasicCustomElement = function _isBasicCustomElement2(tagName) {
|
|
2588
|
+
return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2);
|
|
2589
|
+
};
|
|
2590
|
+
const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
|
|
2591
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
2592
|
+
const {
|
|
2593
|
+
attributes
|
|
2594
|
+
} = currentNode;
|
|
2595
|
+
if (!attributes || _isClobbered(currentNode)) {
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
const hookEvent = {
|
|
2599
|
+
attrName: "",
|
|
2600
|
+
attrValue: "",
|
|
2601
|
+
keepAttr: true,
|
|
2602
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
2603
|
+
forceKeepAttr: void 0
|
|
2604
|
+
};
|
|
2605
|
+
let l = attributes.length;
|
|
2606
|
+
while (l--) {
|
|
2607
|
+
const attr = attributes[l];
|
|
2608
|
+
const {
|
|
2609
|
+
name,
|
|
2610
|
+
namespaceURI,
|
|
2611
|
+
value: attrValue
|
|
2612
|
+
} = attr;
|
|
2613
|
+
const lcName = transformCaseFunc(name);
|
|
2614
|
+
const initValue = attrValue;
|
|
2615
|
+
let value = name === "value" ? initValue : stringTrim(initValue);
|
|
2616
|
+
hookEvent.attrName = lcName;
|
|
2617
|
+
hookEvent.attrValue = value;
|
|
2618
|
+
hookEvent.keepAttr = true;
|
|
2619
|
+
hookEvent.forceKeepAttr = void 0;
|
|
2620
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
2621
|
+
value = hookEvent.attrValue;
|
|
2622
|
+
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
|
2623
|
+
_removeAttribute(name, currentNode);
|
|
2624
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
2625
|
+
}
|
|
2626
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
|
|
2627
|
+
_removeAttribute(name, currentNode);
|
|
2628
|
+
continue;
|
|
2629
|
+
}
|
|
2630
|
+
if (lcName === "attributename" && stringMatch(value, "href")) {
|
|
2631
|
+
_removeAttribute(name, currentNode);
|
|
2632
|
+
continue;
|
|
2633
|
+
}
|
|
2634
|
+
if (hookEvent.forceKeepAttr) {
|
|
2635
|
+
continue;
|
|
2636
|
+
}
|
|
2637
|
+
if (!hookEvent.keepAttr) {
|
|
2638
|
+
_removeAttribute(name, currentNode);
|
|
2639
|
+
continue;
|
|
2640
|
+
}
|
|
2641
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
2642
|
+
_removeAttribute(name, currentNode);
|
|
2643
|
+
continue;
|
|
2644
|
+
}
|
|
2645
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2646
|
+
arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
|
|
2647
|
+
value = stringReplace(value, expr, " ");
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
2651
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
2652
|
+
_removeAttribute(name, currentNode);
|
|
2653
|
+
continue;
|
|
2654
|
+
}
|
|
2655
|
+
if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
|
|
2656
|
+
if (namespaceURI) ;
|
|
2657
|
+
else {
|
|
2658
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
2659
|
+
case "TrustedHTML": {
|
|
2660
|
+
value = trustedTypesPolicy.createHTML(value);
|
|
2661
|
+
break;
|
|
2662
|
+
}
|
|
2663
|
+
case "TrustedScriptURL": {
|
|
2664
|
+
value = trustedTypesPolicy.createScriptURL(value);
|
|
2665
|
+
break;
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
if (value !== initValue) {
|
|
2671
|
+
try {
|
|
2672
|
+
if (namespaceURI) {
|
|
2673
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
2674
|
+
} else {
|
|
2675
|
+
currentNode.setAttribute(name, value);
|
|
2676
|
+
}
|
|
2677
|
+
if (_isClobbered(currentNode)) {
|
|
2678
|
+
_forceRemove(currentNode);
|
|
2679
|
+
} else {
|
|
2680
|
+
arrayPop(DOMPurify.removed);
|
|
2681
|
+
}
|
|
2682
|
+
} catch (_2) {
|
|
2683
|
+
_removeAttribute(name, currentNode);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
2688
|
+
};
|
|
2689
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
|
|
2690
|
+
let shadowNode = null;
|
|
2691
|
+
const shadowIterator = _createNodeIterator(fragment);
|
|
2692
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
2693
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
|
2694
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
2695
|
+
_sanitizeElements(shadowNode);
|
|
2696
|
+
_sanitizeAttributes(shadowNode);
|
|
2697
|
+
if (shadowNode.content instanceof DocumentFragment) {
|
|
2698
|
+
_sanitizeShadowDOM2(shadowNode.content);
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
2702
|
+
};
|
|
2703
|
+
DOMPurify.sanitize = function(dirty) {
|
|
2704
|
+
let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2705
|
+
let body = null;
|
|
2706
|
+
let importedNode = null;
|
|
2707
|
+
let currentNode = null;
|
|
2708
|
+
let returnNode = null;
|
|
2709
|
+
IS_EMPTY_INPUT = !dirty;
|
|
2710
|
+
if (IS_EMPTY_INPUT) {
|
|
2711
|
+
dirty = "<!-->";
|
|
2712
|
+
}
|
|
2713
|
+
if (typeof dirty !== "string" && !_isNode(dirty)) {
|
|
2714
|
+
if (typeof dirty.toString === "function") {
|
|
2715
|
+
dirty = dirty.toString();
|
|
2716
|
+
if (typeof dirty !== "string") {
|
|
2717
|
+
throw typeErrorCreate("dirty is not a string, aborting");
|
|
2718
|
+
}
|
|
2719
|
+
} else {
|
|
2720
|
+
throw typeErrorCreate("toString is not a function");
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
if (!DOMPurify.isSupported) {
|
|
2724
|
+
return dirty;
|
|
2725
|
+
}
|
|
2726
|
+
if (!SET_CONFIG) {
|
|
2727
|
+
_parseConfig(cfg);
|
|
2728
|
+
}
|
|
2729
|
+
DOMPurify.removed = [];
|
|
2730
|
+
if (typeof dirty === "string") {
|
|
2731
|
+
IN_PLACE = false;
|
|
2732
|
+
}
|
|
2733
|
+
if (IN_PLACE) {
|
|
2734
|
+
if (dirty.nodeName) {
|
|
2735
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
|
2736
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
2737
|
+
throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
} else if (dirty instanceof Node) {
|
|
2741
|
+
body = _initDocument("<!---->");
|
|
2742
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
2743
|
+
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
|
|
2744
|
+
body = importedNode;
|
|
2745
|
+
} else if (importedNode.nodeName === "HTML") {
|
|
2746
|
+
body = importedNode;
|
|
2747
|
+
} else {
|
|
2748
|
+
body.appendChild(importedNode);
|
|
2749
|
+
}
|
|
2750
|
+
} else {
|
|
2751
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
|
|
2752
|
+
dirty.indexOf("<") === -1) {
|
|
2753
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
2754
|
+
}
|
|
2755
|
+
body = _initDocument(dirty);
|
|
2756
|
+
if (!body) {
|
|
2757
|
+
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
if (body && FORCE_BODY) {
|
|
2761
|
+
_forceRemove(body.firstChild);
|
|
2762
|
+
}
|
|
2763
|
+
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
2764
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
2765
|
+
_sanitizeElements(currentNode);
|
|
2766
|
+
_sanitizeAttributes(currentNode);
|
|
2767
|
+
if (currentNode.content instanceof DocumentFragment) {
|
|
2768
|
+
_sanitizeShadowDOM(currentNode.content);
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
if (IN_PLACE) {
|
|
2772
|
+
return dirty;
|
|
2773
|
+
}
|
|
2774
|
+
if (RETURN_DOM) {
|
|
2775
|
+
if (RETURN_DOM_FRAGMENT) {
|
|
2776
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
2777
|
+
while (body.firstChild) {
|
|
2778
|
+
returnNode.appendChild(body.firstChild);
|
|
2779
|
+
}
|
|
2780
|
+
} else {
|
|
2781
|
+
returnNode = body;
|
|
2782
|
+
}
|
|
2783
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
|
|
2784
|
+
returnNode = importNode.call(originalDocument, returnNode, true);
|
|
2785
|
+
}
|
|
2786
|
+
return returnNode;
|
|
2787
|
+
}
|
|
2788
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
2789
|
+
if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
2790
|
+
serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
|
|
2791
|
+
}
|
|
2792
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2793
|
+
arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
|
|
2794
|
+
serializedHTML = stringReplace(serializedHTML, expr, " ");
|
|
2795
|
+
});
|
|
2796
|
+
}
|
|
2797
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
2798
|
+
};
|
|
2799
|
+
DOMPurify.setConfig = function() {
|
|
2800
|
+
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2801
|
+
_parseConfig(cfg);
|
|
2802
|
+
SET_CONFIG = true;
|
|
2803
|
+
};
|
|
2804
|
+
DOMPurify.clearConfig = function() {
|
|
2805
|
+
CONFIG = null;
|
|
2806
|
+
SET_CONFIG = false;
|
|
2807
|
+
};
|
|
2808
|
+
DOMPurify.isValidAttribute = function(tag, attr, value) {
|
|
2809
|
+
if (!CONFIG) {
|
|
2810
|
+
_parseConfig({});
|
|
2811
|
+
}
|
|
2812
|
+
const lcTag = transformCaseFunc(tag);
|
|
2813
|
+
const lcName = transformCaseFunc(attr);
|
|
2814
|
+
return _isValidAttribute(lcTag, lcName, value);
|
|
2815
|
+
};
|
|
2816
|
+
DOMPurify.addHook = function(entryPoint, hookFunction) {
|
|
2817
|
+
if (typeof hookFunction !== "function") {
|
|
2818
|
+
return;
|
|
2819
|
+
}
|
|
2820
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
|
2821
|
+
};
|
|
2822
|
+
DOMPurify.removeHook = function(entryPoint, hookFunction) {
|
|
2823
|
+
if (hookFunction !== void 0) {
|
|
2824
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
2825
|
+
return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
2826
|
+
}
|
|
2827
|
+
return arrayPop(hooks[entryPoint]);
|
|
2828
|
+
};
|
|
2829
|
+
DOMPurify.removeHooks = function(entryPoint) {
|
|
2830
|
+
hooks[entryPoint] = [];
|
|
2831
|
+
};
|
|
2832
|
+
DOMPurify.removeAllHooks = function() {
|
|
2833
|
+
hooks = _createHooksMap();
|
|
2834
|
+
};
|
|
2835
|
+
return DOMPurify;
|
|
2836
|
+
}
|
|
2837
|
+
var purify = createDOMPurify();
|
|
2838
|
+
const isNil = (value) => value === void 0 || value === null;
|
|
2839
|
+
const isNotNil = (value) => !isNil(value);
|
|
2840
|
+
const validate = (value, validations) => {
|
|
2841
|
+
if (!validations) return null;
|
|
2842
|
+
if (validations.required) {
|
|
2843
|
+
if (value === null || value === void 0 || value === "") {
|
|
2844
|
+
return "Field is required";
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
if (validations.basicEmailValidation) {
|
|
2848
|
+
if (value === null || value === void 0 || value === "") {
|
|
2849
|
+
return "Field should be email";
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
return null;
|
|
2853
|
+
};
|
|
2854
|
+
const validateAll = (state, validations) => {
|
|
2855
|
+
if (validations) {
|
|
2856
|
+
const fieldsToBeValid = Object.keys(validations);
|
|
2857
|
+
const foundErrors = fieldsToBeValid.map(
|
|
2858
|
+
(f2) => {
|
|
2859
|
+
const error = validate(state[f2], validations[f2].validations);
|
|
2860
|
+
return error ? {
|
|
2861
|
+
field: f2,
|
|
2862
|
+
error
|
|
2863
|
+
} : null;
|
|
2864
|
+
},
|
|
2865
|
+
{}
|
|
2866
|
+
).filter(isNotNil);
|
|
2867
|
+
return foundErrors;
|
|
2868
|
+
}
|
|
2869
|
+
return [];
|
|
2870
|
+
};
|
|
2871
|
+
const useStepper = (props) => {
|
|
2872
|
+
const [step, setStep] = React.useState(0);
|
|
2873
|
+
const [errors, setErrors] = React.useState([]);
|
|
2874
|
+
const saveData = React.useCallback(async () => {
|
|
2875
|
+
try {
|
|
2876
|
+
await saveForm({
|
|
2877
|
+
feedbackFormId: props.formId,
|
|
2878
|
+
link: window.location.pathname,
|
|
2879
|
+
rawHtml: purify.sanitize(document.getElementsByTagName("html")[0] ?? ""),
|
|
2880
|
+
domainId: props.domainId,
|
|
2881
|
+
data: props.state,
|
|
2882
|
+
formType: props.formType,
|
|
2883
|
+
viewport: {
|
|
2884
|
+
first: document.body.clientWidth,
|
|
2885
|
+
second: document.body.clientHeight
|
|
2886
|
+
},
|
|
2887
|
+
browser: {
|
|
2888
|
+
productSub: navigator.productSub,
|
|
2889
|
+
vendor: navigator.vendor,
|
|
2890
|
+
pdfViewerEnabled: navigator.pdfViewerEnabled,
|
|
2891
|
+
maxTouchPoints: navigator.maxTouchPoints,
|
|
2892
|
+
hardwareConcurrency: navigator.hardwareConcurrency,
|
|
2893
|
+
cookieEnabled: navigator.cookieEnabled,
|
|
2894
|
+
appVersion: navigator.appVersion,
|
|
2895
|
+
platform: navigator.platform,
|
|
2896
|
+
userAgent: navigator.userAgent,
|
|
2897
|
+
language: navigator.language,
|
|
2898
|
+
onLine: navigator.onLine,
|
|
2899
|
+
webdriver: navigator.webdriver,
|
|
2900
|
+
// @ts-ignore
|
|
2901
|
+
deviceMemory: navigator.deviceMemory
|
|
2902
|
+
}
|
|
2903
|
+
});
|
|
2904
|
+
} catch (e) {
|
|
2905
|
+
console.log(e);
|
|
2906
|
+
}
|
|
2907
|
+
}, [props.state, props.formType]);
|
|
2908
|
+
const onContinue = React.useCallback(() => {
|
|
2909
|
+
const foundErrors = validateAll(props.state, props.validationsPerStep[step]);
|
|
2910
|
+
setErrors(foundErrors);
|
|
2911
|
+
if (!foundErrors.length) {
|
|
2912
|
+
if (step < props.stepsCount - 1) {
|
|
2913
|
+
setStep((prevStep) => prevStep + 1);
|
|
2914
|
+
} else {
|
|
2915
|
+
saveData();
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
}, [props.state, props.validationsPerStep, step, saveData]);
|
|
2919
|
+
const onBack = React.useCallback(() => {
|
|
2920
|
+
if (step !== 0) {
|
|
2921
|
+
setErrors([]);
|
|
2922
|
+
setStep((prevStep) => prevStep - 1);
|
|
2923
|
+
}
|
|
2924
|
+
}, [step]);
|
|
2925
|
+
React.useEffect(() => {
|
|
2926
|
+
setErrors((errorsState) => {
|
|
2927
|
+
if (errorsState.length) {
|
|
2928
|
+
const validated = validateAll(props.state, props.validationsPerStep[step]);
|
|
2929
|
+
if (validated.length !== errorsState.length) return validated;
|
|
2930
|
+
}
|
|
2931
|
+
return errorsState;
|
|
2932
|
+
});
|
|
2933
|
+
}, [errors, props.state, step]);
|
|
2934
|
+
return {
|
|
2935
|
+
step,
|
|
2936
|
+
errors,
|
|
2937
|
+
onContinue,
|
|
2938
|
+
onBack
|
|
2939
|
+
};
|
|
2940
|
+
};
|
|
2941
|
+
const Div$2 = dt.div({
|
|
2942
|
+
marginTop: "1rem",
|
|
2943
|
+
color: "var(--color-error)",
|
|
2944
|
+
height: "20px"
|
|
2945
|
+
});
|
|
2946
|
+
const ErrorMessage = ({ errors }) => {
|
|
2947
|
+
var _a;
|
|
2948
|
+
return React.createElement(Div$2, { children: ((_a = (errors || [])[0]) == null ? void 0 : _a.error) ?? null });
|
|
2949
|
+
};
|
|
2950
|
+
const CheckboxCmp = dt.input(
|
|
2951
|
+
({ theme: theme2, colorVariant, selected }) => {
|
|
2952
|
+
const size = `calc(${theme2.sizeSelector} * 6);`;
|
|
2953
|
+
const defaultVariantColor = useDefaultVariantColor(colorVariant);
|
|
2954
|
+
return {
|
|
2955
|
+
cursor: "pointer",
|
|
2956
|
+
appearance: "none",
|
|
2957
|
+
borderRadius: "var(--radius-selector)",
|
|
2958
|
+
verticalAlign: "middle",
|
|
2959
|
+
color: "var(--color-base-content)",
|
|
2960
|
+
width: size,
|
|
2961
|
+
border: `1px solid ${defaultVariantColor}`,
|
|
2962
|
+
height: size,
|
|
2963
|
+
flexShrink: "0",
|
|
2964
|
+
padding: ".25rem",
|
|
2965
|
+
transition: "background-color .2s,box-shadow .2s",
|
|
2966
|
+
display: "inline-block",
|
|
2967
|
+
position: "relative",
|
|
2968
|
+
"&::before": {
|
|
2969
|
+
content: '""',
|
|
2970
|
+
opacity: "0",
|
|
2971
|
+
clipPath: "polygon(20% 100%,20% 80%,50% 80%,50% 80%,70% 80%,70% 100%)",
|
|
2972
|
+
width: "100%",
|
|
2973
|
+
height: "100%",
|
|
2974
|
+
boxShadow: "0 3px oklch(100% 0 0/calc(var(--depth)*.1)) inset",
|
|
2975
|
+
backgroundColor: `${defaultVariantColor}`,
|
|
2976
|
+
fontSize: "1rem",
|
|
2977
|
+
lineHeight: ".75",
|
|
2978
|
+
transition: "clip-path .3s .1s,opacity .1s .1s,rotate .3s .1s,translate .3s .1s",
|
|
2979
|
+
display: "block",
|
|
2980
|
+
rotate: "45deg",
|
|
2981
|
+
...selected ? {
|
|
2982
|
+
clipPath: "polygon(20% 100%,20% 80%,50% 80%,50% 0%,70% 0%,70% 100%)",
|
|
2983
|
+
opacity: "1"
|
|
2984
|
+
} : {}
|
|
2985
|
+
}
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
);
|
|
2989
|
+
const CheckboxRow = dt.label((props) => ({
|
|
2990
|
+
display: "flex",
|
|
2991
|
+
fontWeight: props.selected ? "500" : "normal",
|
|
2992
|
+
transition: ".2s ease-in-out",
|
|
2993
|
+
alignItems: "center",
|
|
2994
|
+
cursor: "pointer",
|
|
2995
|
+
gap: "calc(var(--spacing) * 2)"
|
|
2996
|
+
}));
|
|
2997
|
+
const Checkbox = (props) => {
|
|
2998
|
+
const id = React.useMemo(
|
|
2999
|
+
() => `${props.id}-${props.label.replace(/\s/g, "-").toLowerCase()}`,
|
|
3000
|
+
[]
|
|
3001
|
+
);
|
|
3002
|
+
const onSelect = (value) => {
|
|
3003
|
+
props.onSelect(
|
|
3004
|
+
props.value.includes(value) ? props.value.filter((v2) => v2 !== value) : [...props.value, value]
|
|
3005
|
+
);
|
|
3006
|
+
};
|
|
3007
|
+
const isSelected = props.value.includes(id);
|
|
3008
|
+
return React.createElement(CheckboxRow, {
|
|
3009
|
+
selected: isSelected,
|
|
3010
|
+
children: [
|
|
3011
|
+
React.createElement(CheckboxCmp, {
|
|
3012
|
+
id,
|
|
3013
|
+
type: "checkbox",
|
|
3014
|
+
selected: isSelected,
|
|
3015
|
+
colorVariant: props.colorVariant,
|
|
3016
|
+
onChange: () => onSelect(id),
|
|
3017
|
+
name: props.name
|
|
3018
|
+
}),
|
|
3019
|
+
React.createElement(Typography, {
|
|
3020
|
+
children: props.label,
|
|
3021
|
+
linear: true
|
|
3022
|
+
})
|
|
3023
|
+
]
|
|
3024
|
+
});
|
|
3025
|
+
};
|
|
3026
|
+
const checkboxList = dt.div`
|
|
83
3027
|
display: flex;
|
|
84
3028
|
flex-direction: column;
|
|
85
3029
|
width: var(--all-fields-size);
|
|
@@ -87,14 +3031,213 @@
|
|
|
87
3031
|
@media (max-width: 900px) {
|
|
88
3032
|
width: 100%;
|
|
89
3033
|
}
|
|
90
|
-
|
|
3034
|
+
`;
|
|
3035
|
+
const columnGroup$1 = dt.div`
|
|
91
3036
|
display: flex;
|
|
92
3037
|
gap: calc(var(--spacing) * 10);
|
|
93
3038
|
@media (max-width: 900px) {
|
|
94
3039
|
gap: var(--spacing);
|
|
95
3040
|
flex-direction: column;
|
|
96
3041
|
}
|
|
97
|
-
|
|
3042
|
+
`;
|
|
3043
|
+
const CheckboxGroup = (props) => {
|
|
3044
|
+
const name = props.label.replace(/\s/g, "-").toLowerCase();
|
|
3045
|
+
const elementsPerCol = props.elementsPerCol || 4;
|
|
3046
|
+
const columns = React.useMemo(() => {
|
|
3047
|
+
return props.options.reduce(
|
|
3048
|
+
(acc, o, i) => {
|
|
3049
|
+
var _a;
|
|
3050
|
+
const shouldCreateNewCol = i % elementsPerCol === 0 || i === 0;
|
|
3051
|
+
if (shouldCreateNewCol) {
|
|
3052
|
+
acc.push([]);
|
|
3053
|
+
}
|
|
3054
|
+
(_a = acc[acc.length - 1]) == null ? void 0 : _a.push(o);
|
|
3055
|
+
return acc;
|
|
3056
|
+
},
|
|
3057
|
+
[]
|
|
3058
|
+
);
|
|
3059
|
+
}, [elementsPerCol, props.options]);
|
|
3060
|
+
return React.createElement("div", {
|
|
3061
|
+
children: [
|
|
3062
|
+
React.createElement(Typography, {
|
|
3063
|
+
children: props.label,
|
|
3064
|
+
variant: "section"
|
|
3065
|
+
}),
|
|
3066
|
+
React.createElement(columnGroup$1, {
|
|
3067
|
+
children: columns.map(
|
|
3068
|
+
(col, i) => React.createElement(checkboxList, {
|
|
3069
|
+
key: i,
|
|
3070
|
+
children: col.map(
|
|
3071
|
+
(o) => React.createElement(Checkbox, {
|
|
3072
|
+
onSelect: props.onChange,
|
|
3073
|
+
colorVariant: props.colorVariant,
|
|
3074
|
+
value: props.value,
|
|
3075
|
+
id: props.formClientId,
|
|
3076
|
+
name,
|
|
3077
|
+
label: o.label
|
|
3078
|
+
})
|
|
3079
|
+
)
|
|
3080
|
+
})
|
|
3081
|
+
)
|
|
3082
|
+
}),
|
|
3083
|
+
React.createElement(ErrorMessage, {
|
|
3084
|
+
errors: props.errors
|
|
3085
|
+
})
|
|
3086
|
+
]
|
|
3087
|
+
});
|
|
3088
|
+
};
|
|
3089
|
+
const MatrixEl = dt(Button)(() => {
|
|
3090
|
+
return {
|
|
3091
|
+
"&:not(:last-of-type):not(:first-of-type)": {
|
|
3092
|
+
borderRadius: "0",
|
|
3093
|
+
marginRight: "-1px",
|
|
3094
|
+
marginLeft: "-1px"
|
|
3095
|
+
},
|
|
3096
|
+
"&:first-of-type": {
|
|
3097
|
+
borderTopRightRadius: "0",
|
|
3098
|
+
borderBottomRightRadius: "0"
|
|
3099
|
+
},
|
|
3100
|
+
"&:last-of-type": {
|
|
3101
|
+
borderTopLeftRadius: "0",
|
|
3102
|
+
borderBottomLeftRadius: "0"
|
|
3103
|
+
},
|
|
3104
|
+
"@media (max-width: 900px)": {
|
|
3105
|
+
// display: 'none',
|
|
3106
|
+
}
|
|
3107
|
+
};
|
|
3108
|
+
});
|
|
3109
|
+
const QuestionMatrixItem = (props) => {
|
|
3110
|
+
return React.createElement(MatrixEl, {
|
|
3111
|
+
onClick: props.onChange,
|
|
3112
|
+
$outlined: !props.selected,
|
|
3113
|
+
children: props.label
|
|
3114
|
+
});
|
|
3115
|
+
};
|
|
3116
|
+
const TextIndicator = dt("span")(({
|
|
3117
|
+
min,
|
|
3118
|
+
variant
|
|
3119
|
+
}) => {
|
|
3120
|
+
const color = variant || useDefaultVariantColor();
|
|
3121
|
+
return {
|
|
3122
|
+
position: "absolute",
|
|
3123
|
+
left: min ? "0" : void 0,
|
|
3124
|
+
right: min ? void 0 : "0",
|
|
3125
|
+
bottom: "-2px",
|
|
3126
|
+
opacity: "0.5",
|
|
3127
|
+
fontWeight: "300",
|
|
3128
|
+
transform: "translateY(100%)",
|
|
3129
|
+
textTransform: "uppercase",
|
|
3130
|
+
color
|
|
3131
|
+
};
|
|
3132
|
+
});
|
|
3133
|
+
const QuestionMatrixContainer = dt.div((props) => {
|
|
3134
|
+
return {
|
|
3135
|
+
verticalAlign: "middle",
|
|
3136
|
+
display: "inline-flex",
|
|
3137
|
+
position: "relative",
|
|
3138
|
+
marginBottom: props.withText ? "calc(var(--spacing) * 6)" : "0"
|
|
3139
|
+
};
|
|
3140
|
+
});
|
|
3141
|
+
const QuestionMatrix = (props) => {
|
|
3142
|
+
return React.createElement("div", {
|
|
3143
|
+
children: [
|
|
3144
|
+
React.createElement(Typography, {
|
|
3145
|
+
children: props.label,
|
|
3146
|
+
variant: "section"
|
|
3147
|
+
}),
|
|
3148
|
+
React.createElement(QuestionMatrixContainer, {
|
|
3149
|
+
withText: props.maxText || props.minText,
|
|
3150
|
+
children: [
|
|
3151
|
+
props.maxText ? React.createElement(TextIndicator, {
|
|
3152
|
+
min: false,
|
|
3153
|
+
children: props.maxText
|
|
3154
|
+
}) : null,
|
|
3155
|
+
props.minText ? React.createElement(TextIndicator, {
|
|
3156
|
+
min: true,
|
|
3157
|
+
children: props.minText
|
|
3158
|
+
}) : null,
|
|
3159
|
+
Array(props.max).fill(1).map((_2, i) => {
|
|
3160
|
+
return React.createElement(QuestionMatrixItem, {
|
|
3161
|
+
onChange: () => props.onChange(i + 1),
|
|
3162
|
+
selected: i + 1 === props.value,
|
|
3163
|
+
key: `${i}`,
|
|
3164
|
+
label: `${i + 1}`
|
|
3165
|
+
});
|
|
3166
|
+
})
|
|
3167
|
+
]
|
|
3168
|
+
}),
|
|
3169
|
+
React.createElement(ErrorMessage, {
|
|
3170
|
+
errors: props.errors
|
|
3171
|
+
})
|
|
3172
|
+
]
|
|
3173
|
+
});
|
|
3174
|
+
};
|
|
3175
|
+
const RadioCmp = dt.input(({ theme: theme2, selected, colorVariant }) => {
|
|
3176
|
+
const size = `calc(${theme2.sizeSelector} * 6);`;
|
|
3177
|
+
const defaultVariantColor = useDefaultVariantColor(colorVariant);
|
|
3178
|
+
return {
|
|
3179
|
+
width: size,
|
|
3180
|
+
height: size,
|
|
3181
|
+
color: theme2.neutral,
|
|
3182
|
+
margin: "0",
|
|
3183
|
+
cursor: "pointer",
|
|
3184
|
+
appearance: "none",
|
|
3185
|
+
verticalAlign: "middle",
|
|
3186
|
+
borderRadius: "3.40282e38px",
|
|
3187
|
+
border: `1px solid ${defaultVariantColor}`,
|
|
3188
|
+
flexShrink: "0",
|
|
3189
|
+
padding: selected ? ".25rem" : "0.4rem",
|
|
3190
|
+
transition: ".2s ease-in-out",
|
|
3191
|
+
display: "inline-block",
|
|
3192
|
+
position: "relative",
|
|
3193
|
+
boxSizing: "border-box",
|
|
3194
|
+
"&::before": {
|
|
3195
|
+
content: '""',
|
|
3196
|
+
borderRadius: "3.40282e38px",
|
|
3197
|
+
background: selected ? defaultVariantColor : "transparent",
|
|
3198
|
+
width: "100%",
|
|
3199
|
+
height: "100%",
|
|
3200
|
+
display: "block"
|
|
3201
|
+
}
|
|
3202
|
+
};
|
|
3203
|
+
});
|
|
3204
|
+
const RadioRow = dt.label((props) => ({
|
|
3205
|
+
display: "flex",
|
|
3206
|
+
fontWeight: props.selected ? "500" : "normal",
|
|
3207
|
+
transition: ".2s ease-in-out",
|
|
3208
|
+
alignItems: "center",
|
|
3209
|
+
cursor: "pointer",
|
|
3210
|
+
gap: "calc(var(--spacing) * 2)"
|
|
3211
|
+
}));
|
|
3212
|
+
const Radio = (props) => {
|
|
3213
|
+
const id = React.useMemo(
|
|
3214
|
+
() => `${props.id}-${props.label.replace(/\s/g, "-").toLowerCase()}`,
|
|
3215
|
+
[props.id]
|
|
3216
|
+
);
|
|
3217
|
+
const onSelect = (value) => {
|
|
3218
|
+
props.onSelect(value);
|
|
3219
|
+
};
|
|
3220
|
+
const isSelected = props.value === id;
|
|
3221
|
+
return React.createElement(RadioRow, {
|
|
3222
|
+
selected: isSelected,
|
|
3223
|
+
htmlFor: id,
|
|
3224
|
+
children: [
|
|
3225
|
+
React.createElement(RadioCmp, {
|
|
3226
|
+
id,
|
|
3227
|
+
type: "radio",
|
|
3228
|
+
variant: props.colorVariant,
|
|
3229
|
+
selected: isSelected,
|
|
3230
|
+
onChange: () => onSelect(id),
|
|
3231
|
+
name: props.name
|
|
3232
|
+
}),
|
|
3233
|
+
React.createElement(Typography, {
|
|
3234
|
+
children: props.label,
|
|
3235
|
+
linear: true
|
|
3236
|
+
})
|
|
3237
|
+
]
|
|
3238
|
+
});
|
|
3239
|
+
};
|
|
3240
|
+
const radioList = dt.div`
|
|
98
3241
|
display: flex;
|
|
99
3242
|
flex-direction: column;
|
|
100
3243
|
width: var(--all-fields-size);
|
|
@@ -102,47 +3245,928 @@
|
|
|
102
3245
|
@media (max-width: 900px) {
|
|
103
3246
|
width: 100%;
|
|
104
3247
|
}
|
|
105
|
-
|
|
3248
|
+
`;
|
|
3249
|
+
const columnGroup = dt.div`
|
|
106
3250
|
display: flex;
|
|
107
3251
|
gap: calc(var(--spacing) * 10);
|
|
108
3252
|
@media (max-width: 900px) {
|
|
109
3253
|
gap: var(--spacing);
|
|
110
3254
|
flex-direction: column;
|
|
111
3255
|
}
|
|
112
|
-
|
|
3256
|
+
`;
|
|
3257
|
+
const RadioGroup = (props) => {
|
|
3258
|
+
const elementsPerCol = props.elementsPerCol || 4;
|
|
3259
|
+
const columns = React.useMemo(() => {
|
|
3260
|
+
return props.options.reduce(
|
|
3261
|
+
(acc, o, i) => {
|
|
3262
|
+
var _a;
|
|
3263
|
+
const shouldCreateNewCol = i % elementsPerCol === 0 || i === 0;
|
|
3264
|
+
if (shouldCreateNewCol) {
|
|
3265
|
+
acc.push([]);
|
|
3266
|
+
}
|
|
3267
|
+
(_a = acc[acc.length - 1]) == null ? void 0 : _a.push(o);
|
|
3268
|
+
return acc;
|
|
3269
|
+
},
|
|
3270
|
+
[]
|
|
3271
|
+
);
|
|
3272
|
+
}, [elementsPerCol, props.options]);
|
|
3273
|
+
return React.createElement("div", {
|
|
3274
|
+
children: [
|
|
3275
|
+
React.createElement(Typography, {
|
|
3276
|
+
children: props.label,
|
|
3277
|
+
variant: "section"
|
|
3278
|
+
}),
|
|
3279
|
+
React.createElement(columnGroup, {
|
|
3280
|
+
children: columns.map(
|
|
3281
|
+
(col) => React.createElement(radioList, {
|
|
3282
|
+
children: col.map(
|
|
3283
|
+
(o) => React.createElement(Radio, {
|
|
3284
|
+
colorVariant: props.colorVariant,
|
|
3285
|
+
onSelect: props.onChange,
|
|
3286
|
+
value: props.value,
|
|
3287
|
+
id: props.formClientId,
|
|
3288
|
+
name: `${o.id}-${props.formClientId}`,
|
|
3289
|
+
label: o.label
|
|
3290
|
+
})
|
|
3291
|
+
)
|
|
3292
|
+
})
|
|
3293
|
+
)
|
|
3294
|
+
}),
|
|
3295
|
+
React.createElement(ErrorMessage, {
|
|
3296
|
+
errors: props.errors
|
|
3297
|
+
})
|
|
3298
|
+
]
|
|
3299
|
+
});
|
|
3300
|
+
};
|
|
3301
|
+
const TextInputStyled = dt.input((props) => {
|
|
3302
|
+
const color = useDefaultVariantColor(props.colorVariant);
|
|
3303
|
+
return {
|
|
3304
|
+
cursor: "text",
|
|
3305
|
+
border: `var(--border-width)solid ${color}`,
|
|
3306
|
+
appearance: "none",
|
|
3307
|
+
backgroundColor: "var(--color-base-100)",
|
|
3308
|
+
verticalAlign: "middle",
|
|
3309
|
+
whiteSpace: "nowrap",
|
|
3310
|
+
width: "clamp(3rem,30rem,100%)",
|
|
3311
|
+
height: "calc(var(--size-field, .25rem) * 10)",
|
|
3312
|
+
fontSize: "max(var(--font-size,.875rem),.875rem)",
|
|
3313
|
+
touchAction: "manipulation",
|
|
3314
|
+
borderColor: color,
|
|
3315
|
+
borderStartStartRadius: "var(--join-ss,var(--radius-field))",
|
|
3316
|
+
borderStartEndRadius: "var(--join-se,var(--radius-field))",
|
|
3317
|
+
borderEndEndRadius: "var(--join-ee,var(--radius-field))",
|
|
3318
|
+
borderEndStartRadius: "var(--join-es,var(--radius-field))",
|
|
3319
|
+
alignItems: "center",
|
|
3320
|
+
boxSizing: "border-box",
|
|
3321
|
+
paddingInline: ".75rem",
|
|
3322
|
+
"&:focus": {
|
|
3323
|
+
outline: `2px solid ${color}`,
|
|
3324
|
+
outlineOffset: "3px",
|
|
3325
|
+
isolation: "isolate"
|
|
3326
|
+
}
|
|
3327
|
+
};
|
|
3328
|
+
});
|
|
3329
|
+
const RangeInput = dt.input((props) => {
|
|
3330
|
+
const defaultVariant = useDefaultVariantColor(props.colorVariant);
|
|
3331
|
+
const color = defaultVariant;
|
|
3332
|
+
return {
|
|
3333
|
+
cursor: "pointer",
|
|
3334
|
+
flex: "1",
|
|
3335
|
+
verticalAlign: "middle",
|
|
3336
|
+
"--radius-selector-max": "calc(var(--radius-selector) + var(--radius-selector) + var(--radius-selector))",
|
|
3337
|
+
borderRadius: "calc(var(--radius-selector) + min(var(--range-p),var(--radius-selector-max)))",
|
|
3338
|
+
height: "var(--range-thumb-size)",
|
|
3339
|
+
backgroundColor: "#0000",
|
|
3340
|
+
border: "none",
|
|
3341
|
+
overflow: "hidden",
|
|
3342
|
+
appearance: "none",
|
|
3343
|
+
webkitAppearance: "none",
|
|
3344
|
+
margin: "0",
|
|
3345
|
+
"--range-thumb": "var(--color-base-100)",
|
|
3346
|
+
"--range-thumb-size": "calc(var(--size-selector,.25rem)*6)",
|
|
3347
|
+
"--range-progress": color,
|
|
3348
|
+
"--range-fill": "1",
|
|
3349
|
+
"--range-p": ".25rem",
|
|
3350
|
+
"--range-bg": color,
|
|
3351
|
+
font: "inherit",
|
|
3352
|
+
fontFeatureSettings: "inherit",
|
|
3353
|
+
fontVariationSettings: "inherit",
|
|
3354
|
+
letterSpacing: "inherit",
|
|
3355
|
+
color: "inherit",
|
|
3356
|
+
opacity: "1",
|
|
3357
|
+
"&::-webkit-slider-runnable-track": {
|
|
3358
|
+
backgroundColor: "var(--range-bg)",
|
|
3359
|
+
borderRadius: "var(--radius-selector)",
|
|
3360
|
+
width: "100%",
|
|
3361
|
+
height: "calc(var(--range-thumb-size)*.5)",
|
|
3362
|
+
"--range-bg": "color-mix(in oklab,currentColor 10%,#0000)"
|
|
3363
|
+
},
|
|
3364
|
+
"&::-webkit-slider-thumb": {
|
|
3365
|
+
boxSizing: "border-box",
|
|
3366
|
+
borderRadius: "calc(var(--radius-selector) + min(var(--range-p),var(--radius-selector-max)))",
|
|
3367
|
+
height: "var(--range-thumb-size)",
|
|
3368
|
+
width: "var(--range-thumb-size)",
|
|
3369
|
+
border: "var(--range-p)solid",
|
|
3370
|
+
appearance: "none",
|
|
3371
|
+
webkitAppearance: "none",
|
|
3372
|
+
color: "var(--range-progress)",
|
|
3373
|
+
boxShadow: "0 -1px oklch(0% 0 0 / calc(var(--depth) * .1)) inset, 0 8px 0 -4px oklch(100% 0 0 / calc(var(--depth) * .1)) inset, 0 0 1px 1px currentColor, 0 0 0 2rem var(--range-thumb) inset, calc((var(--range-dir, 1) * -100rem) - (var(--range-dir, 1) * var(--range-thumb-size) / 2)) 0 0 calc(100rem * var(--range-fill))",
|
|
3374
|
+
backgroundColor: color,
|
|
3375
|
+
position: "relative",
|
|
3376
|
+
top: "50%",
|
|
3377
|
+
transform: "translateY(-50%)"
|
|
3378
|
+
}
|
|
3379
|
+
};
|
|
3380
|
+
});
|
|
3381
|
+
const RangeSliderContainer = dt.div`
|
|
113
3382
|
width: clamp(3rem, 30rem, 100%);
|
|
114
|
-
|
|
3383
|
+
`;
|
|
3384
|
+
const RangeTextInput = dt(TextInputStyled)`
|
|
115
3385
|
width: calc(var(--size-field) * 15);
|
|
116
|
-
|
|
3386
|
+
`;
|
|
3387
|
+
const RangeSlideContainer = dt.div`
|
|
117
3388
|
display: flex;
|
|
118
3389
|
align-items: center;
|
|
119
3390
|
gap: calc(var(--spacing) * 2);
|
|
120
|
-
|
|
3391
|
+
`;
|
|
3392
|
+
const RangeSlide = (props) => {
|
|
3393
|
+
var _a;
|
|
3394
|
+
const min = props.min || 0;
|
|
3395
|
+
const max = props.max || 100;
|
|
3396
|
+
const onChange = (event) => {
|
|
3397
|
+
const value = Number.parseInt(event.target.value);
|
|
3398
|
+
if (Number.isNaN(value)) {
|
|
3399
|
+
console.error("RangeSlide must be a number");
|
|
3400
|
+
} else {
|
|
3401
|
+
props.onChange(value);
|
|
3402
|
+
}
|
|
3403
|
+
};
|
|
3404
|
+
React.useEffect(() => {
|
|
3405
|
+
props.onChange(props.value || props.initialValue || 0);
|
|
3406
|
+
}, []);
|
|
3407
|
+
return React.createElement(RangeSliderContainer, {
|
|
3408
|
+
children: [
|
|
3409
|
+
React.createElement(Typography, {
|
|
3410
|
+
children: props.label,
|
|
3411
|
+
variant: "section"
|
|
3412
|
+
}),
|
|
3413
|
+
React.createElement(RangeSlideContainer, {
|
|
3414
|
+
children: [
|
|
3415
|
+
React.createElement(RangeInput, {
|
|
3416
|
+
type: "range",
|
|
3417
|
+
min,
|
|
3418
|
+
max,
|
|
3419
|
+
useThemeColors: props.colorVariant,
|
|
3420
|
+
value: props.value,
|
|
3421
|
+
onChange
|
|
3422
|
+
}),
|
|
3423
|
+
React.createElement(RangeTextInput, {
|
|
3424
|
+
type: "number",
|
|
3425
|
+
value: ((_a = props.value) == null ? void 0 : _a.toString()) ?? "",
|
|
3426
|
+
max,
|
|
3427
|
+
min,
|
|
3428
|
+
colorVariant: props.colorVariant,
|
|
3429
|
+
onChange: (e) => props.onChange(+e.target.value)
|
|
3430
|
+
})
|
|
3431
|
+
]
|
|
3432
|
+
}),
|
|
3433
|
+
React.createElement(ErrorMessage, {
|
|
3434
|
+
errors: props.errors
|
|
3435
|
+
})
|
|
3436
|
+
]
|
|
3437
|
+
});
|
|
3438
|
+
};
|
|
3439
|
+
const heartSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="200" height="185"><path d="M100 184.606a15.384 15.384 0 0 1-8.653-2.678C53.565 156.28 37.205 138.695 28.182 127.7 8.952 104.264-.254 80.202.005 54.146.308 24.287 24.264 0 53.406 0c21.192 0 35.869 11.937 44.416 21.879a2.884 2.884 0 0 0 4.356 0C110.725 11.927 125.402 0 146.594 0c29.142 0 53.098 24.287 53.4 54.151.26 26.061-8.956 50.122-28.176 73.554-9.023 10.994-25.383 28.58-63.165 54.228a15.384 15.384 0 0 1-8.653 2.673Z" fill="black" fill-rule="nonzero"/></svg>`;
|
|
3440
|
+
const starSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="192" height="180"><path fill="black" d="m96 137.263-58.779 42.024 22.163-68.389L.894 68.481l72.476-.243L96 0l22.63 68.238 72.476.243-58.49 42.417 22.163 68.389z" fill-rule="evenodd"/></svg>`;
|
|
3441
|
+
const star2Svg = `<svg xmlns="http://www.w3.org/2000/svg" width="192" height="180"><path fill="black" d="m96 153.044-58.779 26.243 7.02-63.513L.894 68.481l63.117-13.01L96 0l31.989 55.472 63.117 13.01-43.347 47.292 7.02 63.513z" fill-rule="evenodd"/></svg>`;
|
|
3442
|
+
const allIcons = {
|
|
3443
|
+
heart: encodeURIComponent(heartSvg),
|
|
3444
|
+
star: encodeURIComponent(starSvg),
|
|
3445
|
+
star2: encodeURIComponent(star2Svg)
|
|
3446
|
+
};
|
|
3447
|
+
const sizes = {
|
|
3448
|
+
small: "1rem",
|
|
3449
|
+
medium: "1.5rem",
|
|
3450
|
+
large: "2rem"
|
|
3451
|
+
};
|
|
3452
|
+
const RatingItem = dt.input((props) => {
|
|
3453
|
+
const icon = allIcons[props.icon ?? "star2"];
|
|
3454
|
+
const defaultColorVariant = useDefaultVariantColor(props.colorVariant);
|
|
3455
|
+
return {
|
|
3456
|
+
maskImage: `url(data:image/svg+xml,${icon})`,
|
|
3457
|
+
backgroundColor: defaultColorVariant,
|
|
3458
|
+
appearance: "none",
|
|
3459
|
+
transform: props.selected ? "scale(1.1)" : "scale(1)",
|
|
3460
|
+
transition: "transform 0.3s",
|
|
3461
|
+
border: "none",
|
|
3462
|
+
opacity: props.selected ? "1" : 0.2,
|
|
3463
|
+
verticalAlign: "middle",
|
|
3464
|
+
display: "inline-block",
|
|
3465
|
+
WebkitMaskPosition: "50%",
|
|
3466
|
+
maskPosition: "50%",
|
|
3467
|
+
cursor: "pointer",
|
|
3468
|
+
WebkitMaskSize: "contain",
|
|
3469
|
+
maskSize: "contain",
|
|
3470
|
+
WebkitMaskRepeat: "no-repeat",
|
|
3471
|
+
maskRepeat: "no-repeat",
|
|
3472
|
+
borderRadius: "0",
|
|
3473
|
+
width: sizes[props.size ?? "medium"],
|
|
3474
|
+
height: sizes[props.size ?? "medium"]
|
|
3475
|
+
};
|
|
3476
|
+
});
|
|
3477
|
+
const RatingContainer = dt.div(() => {
|
|
3478
|
+
return {
|
|
3479
|
+
verticalAlign: "middle",
|
|
3480
|
+
position: "relative"
|
|
3481
|
+
};
|
|
3482
|
+
});
|
|
3483
|
+
const Rating = ({ value, max, errors, label, onChange }) => {
|
|
3484
|
+
return React.createElement(RatingContainer, {
|
|
3485
|
+
value: 1,
|
|
3486
|
+
max: 5,
|
|
3487
|
+
children: [
|
|
3488
|
+
React.createElement(Typography, {
|
|
3489
|
+
variant: "section",
|
|
3490
|
+
children: label
|
|
3491
|
+
}),
|
|
3492
|
+
Array(max).fill(1).map(
|
|
3493
|
+
(_2, i) => React.createElement(RatingItem, {
|
|
3494
|
+
selected: i < value,
|
|
3495
|
+
name: `rating-${i + 1}`,
|
|
3496
|
+
key: `${i}`,
|
|
3497
|
+
onChange: () => {
|
|
3498
|
+
onChange(i + 1);
|
|
3499
|
+
},
|
|
3500
|
+
type: "radio"
|
|
3501
|
+
})
|
|
3502
|
+
),
|
|
3503
|
+
React.createElement(ErrorMessage, {
|
|
3504
|
+
errors
|
|
3505
|
+
})
|
|
3506
|
+
]
|
|
3507
|
+
});
|
|
3508
|
+
};
|
|
3509
|
+
const TextareaContainer = dt.div`
|
|
121
3510
|
width: 100%;
|
|
122
|
-
|
|
3511
|
+
`;
|
|
3512
|
+
const TextareaStyled = dt.textarea((props) => {
|
|
3513
|
+
const color = useDefaultVariantColor(props.colorVariant);
|
|
3514
|
+
return {
|
|
3515
|
+
border: "var(--border-width)solid #0000",
|
|
3516
|
+
appearance: "none",
|
|
3517
|
+
borderRadius: "var(--radius-field)",
|
|
3518
|
+
backgroundColor: "var(--color-base-100)",
|
|
3519
|
+
verticalAlign: "middle",
|
|
3520
|
+
width: "clamp(3rem,30rem,100%)",
|
|
3521
|
+
maxWidth: "100%",
|
|
3522
|
+
minWidth: "3rem",
|
|
3523
|
+
minHeight: "5rem",
|
|
3524
|
+
fontSize: "max(var(--font-size,.875rem),.875rem)",
|
|
3525
|
+
touchAction: "manipulation",
|
|
3526
|
+
borderColor: color,
|
|
3527
|
+
flexShrink: "1",
|
|
3528
|
+
paddingBlock: ".5rem",
|
|
3529
|
+
boxSizing: "border-box",
|
|
3530
|
+
paddingInline: ".75rem",
|
|
3531
|
+
"&:focus": {
|
|
3532
|
+
outline: `2px solid ${color}`,
|
|
3533
|
+
outlineOffset: "3px",
|
|
3534
|
+
isolation: "isolate"
|
|
3535
|
+
}
|
|
3536
|
+
};
|
|
3537
|
+
});
|
|
3538
|
+
const Textarea = (props) => {
|
|
3539
|
+
const onChange = (e) => props.onChange(e.target.value);
|
|
3540
|
+
return React.createElement(TextareaContainer, {
|
|
3541
|
+
children: [
|
|
3542
|
+
React.createElement(Typography, {
|
|
3543
|
+
variant: "section",
|
|
3544
|
+
children: props.label
|
|
3545
|
+
}),
|
|
3546
|
+
React.createElement(TextareaStyled, {
|
|
3547
|
+
value: props.value ?? "",
|
|
3548
|
+
useThemeColors: props.colorVariant,
|
|
3549
|
+
rows: props.rows ?? 3,
|
|
3550
|
+
onChange
|
|
3551
|
+
}),
|
|
3552
|
+
React.createElement(ErrorMessage, {
|
|
3553
|
+
errors: props.errors
|
|
3554
|
+
})
|
|
3555
|
+
]
|
|
3556
|
+
});
|
|
3557
|
+
};
|
|
3558
|
+
const Div$1 = dt.div`
|
|
123
3559
|
width: 100%;
|
|
124
|
-
|
|
3560
|
+
`;
|
|
3561
|
+
const isPresent = (v2) => v2 !== void 0 && v2 !== null;
|
|
3562
|
+
const getDynamicValue = (conditions, getStateByKey) => {
|
|
3563
|
+
const byCondition = (values) => {
|
|
3564
|
+
if (!values) return conditions.default;
|
|
3565
|
+
const foundValue = values.find((val) => {
|
|
3566
|
+
return val.conditions.every((c) => {
|
|
3567
|
+
const state = getStateByKey(c.fieldName);
|
|
3568
|
+
if (!isPresent(state)) return false;
|
|
3569
|
+
const results = [];
|
|
3570
|
+
if (isPresent(c.eq)) {
|
|
3571
|
+
if (c.eq === state) {
|
|
3572
|
+
results.push(true);
|
|
3573
|
+
} else {
|
|
3574
|
+
results.push(false);
|
|
3575
|
+
}
|
|
3576
|
+
} else if (isPresent(c.lessThan)) {
|
|
3577
|
+
if (c.lessThan > state) {
|
|
3578
|
+
results.push(true);
|
|
3579
|
+
} else {
|
|
3580
|
+
results.push(false);
|
|
3581
|
+
}
|
|
3582
|
+
} else if (isPresent(c.moreThan)) {
|
|
3583
|
+
if (c.moreThan < state) {
|
|
3584
|
+
results.push(true);
|
|
3585
|
+
} else {
|
|
3586
|
+
results.push(false);
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
return results.every(Boolean);
|
|
3590
|
+
});
|
|
3591
|
+
});
|
|
3592
|
+
return (foundValue == null ? void 0 : foundValue.value) ?? conditions.default;
|
|
3593
|
+
};
|
|
3594
|
+
return byCondition(conditions.values);
|
|
3595
|
+
};
|
|
3596
|
+
const Field = (props) => {
|
|
3597
|
+
const getElement = () => {
|
|
3598
|
+
const onChange = (value) => props.setStateByKey(props.dataField, value);
|
|
3599
|
+
const label = getDynamicValue(props.fieldProps.label, props.getStateByKey);
|
|
3600
|
+
const commonFields = {
|
|
3601
|
+
formClientId: props.formClientId,
|
|
3602
|
+
label,
|
|
3603
|
+
errors: props.errors,
|
|
3604
|
+
onChange,
|
|
3605
|
+
value: props.getStateByKey(props.dataField),
|
|
3606
|
+
key: `${props.type}-${props.fieldProps.label}-${props.fieldProps.meta.name}`
|
|
3607
|
+
};
|
|
3608
|
+
switch (props.type) {
|
|
3609
|
+
case "matrix": {
|
|
3610
|
+
const fieldProps = props.fieldProps;
|
|
3611
|
+
return React.createElement(QuestionMatrix, {
|
|
3612
|
+
...fieldProps,
|
|
3613
|
+
...commonFields,
|
|
3614
|
+
max: 10
|
|
3615
|
+
});
|
|
3616
|
+
}
|
|
3617
|
+
case "radio-group": {
|
|
3618
|
+
const fieldProps = props.fieldProps;
|
|
3619
|
+
return React.createElement(RadioGroup, {
|
|
3620
|
+
...fieldProps,
|
|
3621
|
+
...commonFields
|
|
3622
|
+
});
|
|
3623
|
+
}
|
|
3624
|
+
case "checkbox-group": {
|
|
3625
|
+
const fieldProps = props.fieldProps;
|
|
3626
|
+
return React.createElement(CheckboxGroup, {
|
|
3627
|
+
...fieldProps,
|
|
3628
|
+
...commonFields
|
|
3629
|
+
});
|
|
3630
|
+
}
|
|
3631
|
+
case "range-slide": {
|
|
3632
|
+
const fieldProps = props.fieldProps;
|
|
3633
|
+
return React.createElement(RangeSlide, {
|
|
3634
|
+
...fieldProps,
|
|
3635
|
+
...commonFields
|
|
3636
|
+
});
|
|
3637
|
+
}
|
|
3638
|
+
case "rating": {
|
|
3639
|
+
const fieldProps = props.fieldProps;
|
|
3640
|
+
return React.createElement(Rating, {
|
|
3641
|
+
...fieldProps,
|
|
3642
|
+
...commonFields
|
|
3643
|
+
});
|
|
3644
|
+
}
|
|
3645
|
+
case "textarea": {
|
|
3646
|
+
const fieldProps = props.fieldProps;
|
|
3647
|
+
return React.createElement(Textarea, {
|
|
3648
|
+
...fieldProps,
|
|
3649
|
+
...commonFields
|
|
3650
|
+
});
|
|
3651
|
+
}
|
|
3652
|
+
default:
|
|
3653
|
+
return null;
|
|
3654
|
+
}
|
|
3655
|
+
};
|
|
3656
|
+
return React.createElement(Div$1, {
|
|
3657
|
+
children: getElement()
|
|
3658
|
+
});
|
|
3659
|
+
};
|
|
3660
|
+
const Div = dt.div({
|
|
3661
|
+
position: "relative",
|
|
3662
|
+
fontSize: "var(--font-size)"
|
|
3663
|
+
});
|
|
3664
|
+
const Footer$1 = dt.div`
|
|
125
3665
|
display: flex;
|
|
126
3666
|
align-items: center;
|
|
127
3667
|
justify-content: space-between;
|
|
128
3668
|
margin-top: calc(var(--spacing) * 10);
|
|
129
|
-
|
|
3669
|
+
`;
|
|
3670
|
+
const InPlaceForm = (props) => {
|
|
3671
|
+
const formClientRandomId = React.useMemo(
|
|
3672
|
+
() => Math.random().toString(36).substring(2, 10),
|
|
3673
|
+
[]
|
|
3674
|
+
);
|
|
3675
|
+
const [maxHeight, setMaxHeight] = React.useState(null);
|
|
3676
|
+
const onSetMaxHeight = React.useCallback((h) => {
|
|
3677
|
+
setMaxHeight((stateHeight) => {
|
|
3678
|
+
if (!stateHeight || stateHeight < h) return h;
|
|
3679
|
+
return stateHeight;
|
|
3680
|
+
});
|
|
3681
|
+
}, [setMaxHeight]);
|
|
3682
|
+
const populatedForm = useForm({
|
|
3683
|
+
form: props.inlineForm.form,
|
|
3684
|
+
formId: props.formId,
|
|
3685
|
+
domainId: props.domainId
|
|
3686
|
+
});
|
|
3687
|
+
const stepper = useStepper({
|
|
3688
|
+
domainId: props.domainId,
|
|
3689
|
+
formType: "inlineForm",
|
|
3690
|
+
stepsCount: populatedForm.steps.length,
|
|
3691
|
+
validationsPerStep: populatedForm.validationsPerStep,
|
|
3692
|
+
formId: props.formId,
|
|
3693
|
+
state: populatedForm.state
|
|
3694
|
+
});
|
|
3695
|
+
return React.createElement(Div, {
|
|
3696
|
+
children: [
|
|
3697
|
+
props.inlineForm.config.formTitle && React.createElement(Typography, {
|
|
3698
|
+
variant: "title",
|
|
3699
|
+
children: props.inlineForm.config.formTitle
|
|
3700
|
+
}),
|
|
3701
|
+
populatedForm.steps.map(
|
|
3702
|
+
(step, index) => {
|
|
3703
|
+
var _a;
|
|
3704
|
+
return React.createElement(Step, {
|
|
3705
|
+
key: index + `${(_a = step.meta) == null ? void 0 : _a.name}`,
|
|
3706
|
+
height: maxHeight,
|
|
3707
|
+
onSetMaxHeight,
|
|
3708
|
+
isVisible: index === stepper.step,
|
|
3709
|
+
children: step.fields.map(
|
|
3710
|
+
(field) => React.createElement(Field, {
|
|
3711
|
+
type: field.type,
|
|
3712
|
+
fieldProps: field,
|
|
3713
|
+
dataField: field.dataField,
|
|
3714
|
+
formClientId: formClientRandomId,
|
|
3715
|
+
onContinue: stepper.onContinue,
|
|
3716
|
+
errors: stepper.errors.filter((e) => e.field === field.dataField),
|
|
3717
|
+
getStateByKey: populatedForm.getStateByKey,
|
|
3718
|
+
setStateByKey: populatedForm.setStateByKey
|
|
3719
|
+
})
|
|
3720
|
+
)
|
|
3721
|
+
});
|
|
3722
|
+
}
|
|
3723
|
+
),
|
|
3724
|
+
React.createElement(Footer$1, {
|
|
3725
|
+
children: [
|
|
3726
|
+
React.createElement(Button, {
|
|
3727
|
+
children: "Back",
|
|
3728
|
+
disabled: stepper.step === 0,
|
|
3729
|
+
onClick: stepper.onBack
|
|
3730
|
+
}),
|
|
3731
|
+
React.createElement(StepsProgress, {
|
|
3732
|
+
steps: populatedForm.steps,
|
|
3733
|
+
currentStepIndex: stepper.step
|
|
3734
|
+
}),
|
|
3735
|
+
React.createElement(Button, {
|
|
3736
|
+
children: "Continue",
|
|
3737
|
+
onClick: stepper.onContinue
|
|
3738
|
+
})
|
|
3739
|
+
]
|
|
3740
|
+
})
|
|
3741
|
+
]
|
|
3742
|
+
});
|
|
3743
|
+
};
|
|
3744
|
+
const ModalBox = dt.div((props) => {
|
|
3745
|
+
return {
|
|
3746
|
+
backgroundColor: "var(--color-base-100)",
|
|
3747
|
+
borderTopLeftRadius: "var(--modal-tl,var(--radius-box))",
|
|
3748
|
+
borderTopRightRadius: "var(--modal-tr,var(--radius-box))",
|
|
3749
|
+
borderBottomLeftRadius: "var(--modal-bl,var(--radius-box))",
|
|
3750
|
+
borderBottomRightRadius: "var(--modal-br,var(--radius-box))",
|
|
3751
|
+
opacity: props.$visible ? "1" : "0",
|
|
3752
|
+
overscrollBehavior: "contain",
|
|
3753
|
+
gridRowStart: "1",
|
|
3754
|
+
gridColumnStart: "1",
|
|
3755
|
+
width: "91.6667%",
|
|
3756
|
+
maxWidth: "1080px",
|
|
3757
|
+
margin: "auto",
|
|
3758
|
+
maxHeight: "100vh",
|
|
3759
|
+
padding: "1.5rem",
|
|
3760
|
+
transition: "translate .3s ease-out,scale .3s ease-out,opacity .2s ease-out 50ms,box-shadow .3s ease-out",
|
|
3761
|
+
overflowY: "auto",
|
|
3762
|
+
scale: "95%",
|
|
3763
|
+
boxShadow: "0 25px 50px -12px #00000040",
|
|
3764
|
+
"@media (max-width: 900px)": {
|
|
3765
|
+
maxWidth: "initial",
|
|
3766
|
+
width: "auto"
|
|
3767
|
+
}
|
|
3768
|
+
};
|
|
3769
|
+
});
|
|
3770
|
+
const ModalFooter = dt.div(() => {
|
|
3771
|
+
return {};
|
|
3772
|
+
});
|
|
3773
|
+
const ModalStyled = dt.dialog(({ $visible }) => {
|
|
3774
|
+
return {
|
|
3775
|
+
pointerEvents: $visible ? "auto" : "none",
|
|
3776
|
+
visibility: $visible ? "visible" : "hidden",
|
|
3777
|
+
width: "100%",
|
|
3778
|
+
maxWidth: "none",
|
|
3779
|
+
height: "100%",
|
|
3780
|
+
maxHeight: "none",
|
|
3781
|
+
color: "inherit",
|
|
3782
|
+
transition: "visibility .3s allow-discrete,background-color .3s ease-out,opacity .1s ease-out",
|
|
3783
|
+
overscrollBehavior: "contain",
|
|
3784
|
+
zIndex: "99",
|
|
3785
|
+
scrollbarGutter: "auto",
|
|
3786
|
+
backgroundColor: $visible ? "#0006" : "#0000",
|
|
3787
|
+
placeItems: "center",
|
|
3788
|
+
margin: "0",
|
|
3789
|
+
padding: "0",
|
|
3790
|
+
display: "grid",
|
|
3791
|
+
position: "fixed",
|
|
3792
|
+
overflow: "clip",
|
|
3793
|
+
top: 0,
|
|
3794
|
+
border: 0,
|
|
3795
|
+
outline: 0
|
|
3796
|
+
};
|
|
3797
|
+
});
|
|
3798
|
+
const Modal = (props) => {
|
|
3799
|
+
const modalRef = React.useRef(null);
|
|
3800
|
+
const randomId = Math.random().toString(36).substring(2, 16);
|
|
3801
|
+
const onClick = React.useCallback(
|
|
3802
|
+
(e) => {
|
|
3803
|
+
if (e.target === modalRef.current) {
|
|
3804
|
+
props.onClose();
|
|
3805
|
+
}
|
|
3806
|
+
e.preventDefault();
|
|
3807
|
+
e.stopPropagation();
|
|
3808
|
+
},
|
|
3809
|
+
[props]
|
|
3810
|
+
);
|
|
3811
|
+
const onEscClick = React.useCallback((e) => {
|
|
3812
|
+
if (e.key === "Escape") {
|
|
3813
|
+
props.onClose();
|
|
3814
|
+
}
|
|
3815
|
+
e.preventDefault();
|
|
3816
|
+
}, []);
|
|
3817
|
+
React.useEffect(() => {
|
|
3818
|
+
if (modalRef.current && props.isOpen) {
|
|
3819
|
+
modalRef.current.show();
|
|
3820
|
+
} else if (modalRef.current && !props.isOpen) {
|
|
3821
|
+
modalRef.current.close();
|
|
3822
|
+
}
|
|
3823
|
+
}, [modalRef, props.isOpen]);
|
|
3824
|
+
React.useEffect(() => {
|
|
3825
|
+
document.addEventListener("keyup", onEscClick);
|
|
3826
|
+
return () => {
|
|
3827
|
+
document.removeEventListener("keyup", onEscClick);
|
|
3828
|
+
};
|
|
3829
|
+
}, []);
|
|
3830
|
+
return React.createElement(ModalStyled, {
|
|
3831
|
+
$visible: props.isOpen,
|
|
3832
|
+
onClick,
|
|
3833
|
+
ref: modalRef,
|
|
3834
|
+
id: randomId,
|
|
3835
|
+
children: React.createElement(ModalBox, {
|
|
3836
|
+
$visible: props.isOpen,
|
|
3837
|
+
children: [
|
|
3838
|
+
React.createElement(Typography, {
|
|
3839
|
+
children: props.heading,
|
|
3840
|
+
variant: "title"
|
|
3841
|
+
}),
|
|
3842
|
+
props.children,
|
|
3843
|
+
React.createElement(ModalFooter, {
|
|
3844
|
+
children: props.footer
|
|
3845
|
+
})
|
|
3846
|
+
]
|
|
3847
|
+
})
|
|
3848
|
+
});
|
|
3849
|
+
};
|
|
3850
|
+
const Footer = dt.div`
|
|
130
3851
|
display: flex;
|
|
131
3852
|
align-items: center;
|
|
132
3853
|
justify-content: space-between;
|
|
133
3854
|
margin-top: calc(var(--spacing) * 10);
|
|
134
|
-
|
|
3855
|
+
`;
|
|
3856
|
+
const ShowPopupButton = dt(Button)`
|
|
135
3857
|
position: fixed;
|
|
136
3858
|
width: fit-content;
|
|
137
3859
|
height: fit-content;
|
|
138
3860
|
transform: rotate(-90deg) translateY(calc(100% - 15px));
|
|
139
3861
|
padding: 10px 20px 30px 20px;
|
|
140
3862
|
margin: auto;
|
|
141
|
-
left: ${
|
|
142
|
-
right: ${
|
|
143
|
-
top: ${
|
|
144
|
-
bottom: ${
|
|
3863
|
+
left: ${(props) => isNotNil(props.$left) ? `${props.$left}px` : null};
|
|
3864
|
+
right: ${(props) => isNotNil(props.$right) ? `${props.$right}px` : null};
|
|
3865
|
+
top: ${(props) => isNotNil(props.$top) ? `${props.$top}px` : null};
|
|
3866
|
+
bottom: ${(props) => isNotNil(props.$bottom) ? `${props.$bottom}px` : null};
|
|
145
3867
|
&:active {
|
|
146
3868
|
transform: rotate(-90deg) translateY(calc(100% - 18px));
|
|
147
3869
|
}
|
|
148
|
-
|
|
3870
|
+
`;
|
|
3871
|
+
const PopupForm = (props) => {
|
|
3872
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
3873
|
+
const [maxHeight, setMaxHeight] = React.useState(null);
|
|
3874
|
+
const formClientRandomId = React.useMemo(
|
|
3875
|
+
() => Math.random().toString(36).substring(2, 10),
|
|
3876
|
+
[]
|
|
3877
|
+
);
|
|
3878
|
+
const onSetMaxHeight = React.useCallback((h) => {
|
|
3879
|
+
setMaxHeight((stateHeight) => {
|
|
3880
|
+
if (!stateHeight || stateHeight < h) return h;
|
|
3881
|
+
return stateHeight;
|
|
3882
|
+
});
|
|
3883
|
+
}, [setMaxHeight]);
|
|
3884
|
+
const populatedForm = useForm({
|
|
3885
|
+
form: props.popupForm.form,
|
|
3886
|
+
formId: props.formId,
|
|
3887
|
+
domainId: props.domainId
|
|
3888
|
+
});
|
|
3889
|
+
const stepper = useStepper({
|
|
3890
|
+
domainId: props.domainId,
|
|
3891
|
+
formType: "inlineForm",
|
|
3892
|
+
stepsCount: populatedForm.steps.length,
|
|
3893
|
+
validationsPerStep: populatedForm.validationsPerStep,
|
|
3894
|
+
formId: props.formId,
|
|
3895
|
+
state: populatedForm.state
|
|
3896
|
+
});
|
|
3897
|
+
return React.createElement(React.Fragment, {
|
|
3898
|
+
children: [
|
|
3899
|
+
React.createElement(ShowPopupButton, {
|
|
3900
|
+
children: props.popupForm.config.buttonText,
|
|
3901
|
+
onClick: () => setIsVisible(true),
|
|
3902
|
+
$left: props.popupForm.styles.left ?? null,
|
|
3903
|
+
$right: props.popupForm.styles.right ?? null,
|
|
3904
|
+
$top: props.popupForm.styles.top ?? null,
|
|
3905
|
+
$bottom: props.popupForm.styles.bottom ?? null
|
|
3906
|
+
}),
|
|
3907
|
+
React.createElement(Modal, {
|
|
3908
|
+
onClose: () => setIsVisible(false),
|
|
3909
|
+
heading: props.popupForm.config.formTitle,
|
|
3910
|
+
isOpen: isVisible,
|
|
3911
|
+
footer: React.createElement(Footer, {
|
|
3912
|
+
children: [
|
|
3913
|
+
React.createElement(Button, {
|
|
3914
|
+
children: "Back",
|
|
3915
|
+
disabled: stepper.step === 0,
|
|
3916
|
+
onClick: stepper.onBack
|
|
3917
|
+
}),
|
|
3918
|
+
React.createElement(StepsProgress, {
|
|
3919
|
+
steps: populatedForm.steps,
|
|
3920
|
+
currentStepIndex: stepper.step
|
|
3921
|
+
}),
|
|
3922
|
+
React.createElement(Button, {
|
|
3923
|
+
children: "Continue",
|
|
3924
|
+
onClick: stepper.onContinue
|
|
3925
|
+
})
|
|
3926
|
+
]
|
|
3927
|
+
}),
|
|
3928
|
+
children: populatedForm.steps.map(
|
|
3929
|
+
(step, index) => {
|
|
3930
|
+
var _a;
|
|
3931
|
+
return React.createElement(Step, {
|
|
3932
|
+
key: index + `${(_a = step.meta) == null ? void 0 : _a.name}`,
|
|
3933
|
+
height: maxHeight,
|
|
3934
|
+
onSetMaxHeight,
|
|
3935
|
+
isVisible: index === stepper.step,
|
|
3936
|
+
children: step.fields.map(
|
|
3937
|
+
(field) => React.createElement(Field, {
|
|
3938
|
+
type: field.type,
|
|
3939
|
+
fieldProps: field,
|
|
3940
|
+
formClientId: formClientRandomId,
|
|
3941
|
+
dataField: field.dataField,
|
|
3942
|
+
onContinue: stepper.onContinue,
|
|
3943
|
+
errors: stepper.errors.filter((e) => e.field === field.dataField),
|
|
3944
|
+
getStateByKey: populatedForm.getStateByKey,
|
|
3945
|
+
setStateByKey: populatedForm.setStateByKey
|
|
3946
|
+
})
|
|
3947
|
+
)
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
)
|
|
3951
|
+
})
|
|
3952
|
+
// populatedForm.steps.map((step, index) =>
|
|
3953
|
+
// React.createElement(Step, {
|
|
3954
|
+
// key: index + `${step.meta?.name}`,
|
|
3955
|
+
// isVisible: index === stepper.step,
|
|
3956
|
+
// children: [
|
|
3957
|
+
// // step.fields.map((field) =>
|
|
3958
|
+
// // React.createElement(Field, {
|
|
3959
|
+
// // type: field.type,
|
|
3960
|
+
// // dataField: field.dataField,
|
|
3961
|
+
// // onContinue: stepper.onContinue,
|
|
3962
|
+
// // errors: stepper.errors.filter((e) => e.field === field.dataField),
|
|
3963
|
+
// // getStateByKey: populatedForm.getStateByKey,
|
|
3964
|
+
// // setStateByKey: populatedForm.setStateByKey,
|
|
3965
|
+
// // })
|
|
3966
|
+
// // )
|
|
3967
|
+
// ],
|
|
3968
|
+
// })
|
|
3969
|
+
// ),
|
|
3970
|
+
]
|
|
3971
|
+
});
|
|
3972
|
+
};
|
|
3973
|
+
const App = (props) => {
|
|
3974
|
+
props.locale ?? "en-US";
|
|
3975
|
+
let { data, loading, error } = useRequest(
|
|
3976
|
+
() => getFormConfigMock({
|
|
3977
|
+
formId: props.formId
|
|
3978
|
+
})
|
|
3979
|
+
);
|
|
3980
|
+
const inPlaceForm = React.useMemo(() => {
|
|
3981
|
+
if (!(data == null ? void 0 : data.inlineForm)) return null;
|
|
3982
|
+
return React.createElement(InPlaceForm, {
|
|
3983
|
+
key: `inline-form-${props.formId}`,
|
|
3984
|
+
formId: props.formId,
|
|
3985
|
+
domainId: data.domainId,
|
|
3986
|
+
formTheme: data.attributes.theme,
|
|
3987
|
+
inlineForm: data.inlineForm
|
|
3988
|
+
});
|
|
3989
|
+
}, [data == null ? void 0 : data.attributes.theme, data == null ? void 0 : data.domainId, data == null ? void 0 : data.inlineForm, props.formId]);
|
|
3990
|
+
const popupForm = React.useMemo(() => {
|
|
3991
|
+
if (!(data == null ? void 0 : data.popupForm)) return null;
|
|
3992
|
+
return React.createElement(PopupForm, {
|
|
3993
|
+
key: `popup-form-${props.formId}`,
|
|
3994
|
+
formId: props.formId,
|
|
3995
|
+
domainId: data.domainId,
|
|
3996
|
+
formTheme: data.attributes.theme,
|
|
3997
|
+
popupForm: data.popupForm
|
|
3998
|
+
});
|
|
3999
|
+
}, [data == null ? void 0 : data.attributes.theme, data == null ? void 0 : data.domainId, data == null ? void 0 : data.inlineForm, props.formId]);
|
|
4000
|
+
if (!data && loading) return "Loading...";
|
|
4001
|
+
if (!data || error) return error ? error.message : "Unknown error";
|
|
4002
|
+
return React.createElement(ThemeProvider, {
|
|
4003
|
+
theme: data.attributes.theme,
|
|
4004
|
+
selectedVariant: data.attributes.variant,
|
|
4005
|
+
children: [inPlaceForm, popupForm]
|
|
4006
|
+
});
|
|
4007
|
+
};
|
|
4008
|
+
const StyledOption = dt.option(() => {
|
|
4009
|
+
return {
|
|
4010
|
+
borderRadius: "var(--radius-field)",
|
|
4011
|
+
whiteSpace: "normal",
|
|
4012
|
+
paddingBlock: ".375rem",
|
|
4013
|
+
paddingInline: ".75rem",
|
|
4014
|
+
transitionProperty: "color,background-color",
|
|
4015
|
+
transitionDuration: ".2s",
|
|
4016
|
+
transitionTimingFunction: "cubic-bezier(0,0,.2,1)"
|
|
4017
|
+
};
|
|
4018
|
+
});
|
|
4019
|
+
const SelectStyled = dt.select((props) => {
|
|
4020
|
+
const color = useDefaultVariantColor(props.colorVariant);
|
|
4021
|
+
return {
|
|
4022
|
+
border: `var(--border-width)solid ${color}`,
|
|
4023
|
+
backgroundColor: "var(--color-base-100)",
|
|
4024
|
+
verticalAlign: "middle",
|
|
4025
|
+
width: "clamp(3rem,30rem,100%)",
|
|
4026
|
+
height: "calc(var(--size-field,.25rem)*10)",
|
|
4027
|
+
touchAction: "manipulation",
|
|
4028
|
+
whiteSpace: "nowrap",
|
|
4029
|
+
textOverflow: "ellipsis",
|
|
4030
|
+
borderStartStartRadius: "var(--radius-field)",
|
|
4031
|
+
borderStartEndRadius: "var(--radius-field)",
|
|
4032
|
+
borderEndEndRadius: "var(--radius-field)",
|
|
4033
|
+
borderEndStartRadius: "var(--radius-field)",
|
|
4034
|
+
flexShrink: "1",
|
|
4035
|
+
alignItems: "center",
|
|
4036
|
+
gap: ".375rem",
|
|
4037
|
+
paddingInline: ".75rem 1.75rem",
|
|
4038
|
+
fontSize: ".875rem",
|
|
4039
|
+
display: "inline-flex",
|
|
4040
|
+
position: "relative",
|
|
4041
|
+
overflow: "hidden"
|
|
4042
|
+
};
|
|
4043
|
+
});
|
|
4044
|
+
const Select = (props) => {
|
|
4045
|
+
const onChange = (e) => props.onChange(e.target.value);
|
|
4046
|
+
return React.createElement("div", {
|
|
4047
|
+
children: [
|
|
4048
|
+
React.createElement(Typography, {
|
|
4049
|
+
children: props.label,
|
|
4050
|
+
variant: "section"
|
|
4051
|
+
}),
|
|
4052
|
+
React.createElement(SelectStyled, {
|
|
4053
|
+
colorVariant: props.colorVariant,
|
|
4054
|
+
value: props.value ?? null,
|
|
4055
|
+
defaultChecked: false,
|
|
4056
|
+
defaultValue: null,
|
|
4057
|
+
onChange,
|
|
4058
|
+
children: [
|
|
4059
|
+
React.createElement(StyledOption, {
|
|
4060
|
+
value: "",
|
|
4061
|
+
selected: !props.value,
|
|
4062
|
+
children: "Select an option",
|
|
4063
|
+
key: ""
|
|
4064
|
+
}),
|
|
4065
|
+
props.options.map(
|
|
4066
|
+
(o) => React.createElement(StyledOption, {
|
|
4067
|
+
value: o.id,
|
|
4068
|
+
selected: o.id === props.value,
|
|
4069
|
+
children: o.label,
|
|
4070
|
+
key: o.id
|
|
4071
|
+
})
|
|
4072
|
+
)
|
|
4073
|
+
]
|
|
4074
|
+
}),
|
|
4075
|
+
React.createElement(ErrorMessage, {
|
|
4076
|
+
errors: props.errors
|
|
4077
|
+
})
|
|
4078
|
+
]
|
|
4079
|
+
});
|
|
4080
|
+
};
|
|
4081
|
+
const initiateFeedbackModule = (options) => {
|
|
4082
|
+
if (!options) {
|
|
4083
|
+
console.error("options must be provided. Feedback module deactivated");
|
|
4084
|
+
return;
|
|
4085
|
+
}
|
|
4086
|
+
if (!options.formId) {
|
|
4087
|
+
console.error("formId must be provided. Feedback module deactivated");
|
|
4088
|
+
return;
|
|
4089
|
+
}
|
|
4090
|
+
const root = clientExports.createRoot(options.container || document);
|
|
4091
|
+
if (typeof window !== "undefined") {
|
|
4092
|
+
root.render(
|
|
4093
|
+
React.createElement(App, {
|
|
4094
|
+
formId: options.formId
|
|
4095
|
+
})
|
|
4096
|
+
);
|
|
4097
|
+
}
|
|
4098
|
+
};
|
|
4099
|
+
const renderFeedbackModule = (options) => {
|
|
4100
|
+
if (!options) {
|
|
4101
|
+
console.error("options must be provided. Feedback module deactivated");
|
|
4102
|
+
return null;
|
|
4103
|
+
}
|
|
4104
|
+
if (!options.formId) {
|
|
4105
|
+
console.error("formId must be provided. Feedback module deactivated");
|
|
4106
|
+
return null;
|
|
4107
|
+
}
|
|
4108
|
+
if (typeof window === "undefined") return null;
|
|
4109
|
+
return React.createElement(App, {
|
|
4110
|
+
formId: options.formId
|
|
4111
|
+
});
|
|
4112
|
+
};
|
|
4113
|
+
const FeedbackModule = (options) => {
|
|
4114
|
+
return renderFeedbackModule(options);
|
|
4115
|
+
};
|
|
4116
|
+
const PreviewInPlaceForm = (props) => {
|
|
4117
|
+
return React.createElement(ThemeProvider, {
|
|
4118
|
+
theme: props.formTheme,
|
|
4119
|
+
selectedVariant: props.variant,
|
|
4120
|
+
children: [React.createElement(InPlaceForm, props)]
|
|
4121
|
+
});
|
|
4122
|
+
};
|
|
4123
|
+
const PreviewPopupForm = (props) => {
|
|
4124
|
+
return React.createElement(ThemeProvider, {
|
|
4125
|
+
theme: props.formTheme,
|
|
4126
|
+
selectedVariant: props.variant,
|
|
4127
|
+
children: [React.createElement(PopupForm, props)]
|
|
4128
|
+
});
|
|
4129
|
+
};
|
|
4130
|
+
const SurveyFormComponents = {
|
|
4131
|
+
Checkbox: (props) => React.createElement(ThemeProvider, {
|
|
4132
|
+
theme: props.formTheme,
|
|
4133
|
+
selectedVariant: props.formVariant,
|
|
4134
|
+
children: [React.createElement(CheckboxGroup, props.cmpProps)]
|
|
4135
|
+
}),
|
|
4136
|
+
QuestionMatrix: (props) => React.createElement(ThemeProvider, {
|
|
4137
|
+
theme: props.formTheme,
|
|
4138
|
+
selectedVariant: props.formVariant,
|
|
4139
|
+
children: [React.createElement(QuestionMatrix, props.cmpProps)]
|
|
4140
|
+
}),
|
|
4141
|
+
Radio: (props) => React.createElement(ThemeProvider, {
|
|
4142
|
+
theme: props.formTheme,
|
|
4143
|
+
selectedVariant: props.formVariant,
|
|
4144
|
+
children: [React.createElement(RadioGroup, props.cmpProps)]
|
|
4145
|
+
}),
|
|
4146
|
+
Rating: (props) => React.createElement(ThemeProvider, {
|
|
4147
|
+
theme: props.formTheme,
|
|
4148
|
+
selectedVariant: props.formVariant,
|
|
4149
|
+
children: [React.createElement(Rating, props.cmpProps)]
|
|
4150
|
+
}),
|
|
4151
|
+
Select: (props) => React.createElement(ThemeProvider, {
|
|
4152
|
+
theme: props.formTheme,
|
|
4153
|
+
selectedVariant: props.formVariant,
|
|
4154
|
+
children: [React.createElement(Select, props.cmpProps)]
|
|
4155
|
+
}),
|
|
4156
|
+
Textarea: (props) => React.createElement(ThemeProvider, {
|
|
4157
|
+
theme: props.formTheme,
|
|
4158
|
+
selectedVariant: props.formVariant,
|
|
4159
|
+
children: [React.createElement(Textarea, props.cmpProps)]
|
|
4160
|
+
}),
|
|
4161
|
+
RangeSlide: (props) => React.createElement(ThemeProvider, {
|
|
4162
|
+
theme: props.formTheme,
|
|
4163
|
+
selectedVariant: props.formVariant,
|
|
4164
|
+
children: [React.createElement(RangeSlide, props.cmpProps)]
|
|
4165
|
+
})
|
|
4166
|
+
};
|
|
4167
|
+
exports.FeedbackModule = FeedbackModule;
|
|
4168
|
+
exports.PreviewInPlaceForm = PreviewInPlaceForm;
|
|
4169
|
+
exports.PreviewPopupForm = PreviewPopupForm;
|
|
4170
|
+
exports.SurveyFormComponents = SurveyFormComponents;
|
|
4171
|
+
exports.initiateFeedbackModule = initiateFeedbackModule;
|
|
4172
|
+
exports.renderFeedbackModule = renderFeedbackModule;
|