@web-site-utilities/feedback 0.0.1
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/LICENSE +551 -0
- package/README.md +3 -0
- package/dist/common/components/Button.d.ts +7 -0
- package/dist/common/components/Checkbox.d.ts +50 -0
- package/dist/common/components/ErrorMessage.d.ts +9 -0
- package/dist/common/components/Modal.d.ts +23 -0
- package/dist/common/components/QuestionMatrix.d.ts +40 -0
- package/dist/common/components/Radio.d.ts +51 -0
- package/dist/common/components/RangeSlide.d.ts +39 -0
- package/dist/common/components/Rating.d.ts +35 -0
- package/dist/common/components/Select.d.ts +39 -0
- package/dist/common/components/Step.d.ts +15 -0
- package/dist/common/components/StepsProgress.d.ts +17 -0
- package/dist/common/components/TextInput.d.ts +30 -0
- package/dist/common/components/Textarea.d.ts +27 -0
- package/dist/common/components/Typography.d.ts +13 -0
- package/dist/common/hooks/useForm.d.ts +21 -0
- package/dist/common/hooks/useStepper.d.ts +17 -0
- package/dist/common/theme/ThemeProvider.d.ts +114 -0
- package/dist/common/types/CommonFieldProps.d.ts +6 -0
- package/dist/common/types/FormConfig.d.ts +129 -0
- package/dist/common/types/FormError.d.ts +4 -0
- package/dist/common/types/Locale.d.ts +1 -0
- package/dist/common/types/Nullable.d.ts +1 -0
- package/dist/common/types/Option.d.ts +5 -0
- package/dist/common/types/ValidationPerStep.d.ts +6 -0
- package/dist/common/types/isNil.d.ts +2 -0
- package/dist/fields/Field/Field.d.ts +65 -0
- package/dist/form/App.d.ts +12 -0
- package/dist/form/api/baseApi.d.ts +8 -0
- package/dist/form/api/getFormConf.d.ts +8 -0
- package/dist/form/api/saveForm.d.ts +2 -0
- package/dist/form/api/useRequest.d.ts +7 -0
- package/dist/form/components/FeedbackInput/FeedbackInput.d.ts +12 -0
- package/dist/form/features/InPlaceForm/InPlaceForm.d.ts +31 -0
- package/dist/form/features/PopupForm/PopupForm.d.ts +10 -0
- package/dist/form/index.d.ts +10 -0
- package/dist/form/index.dev.d.ts +1 -0
- package/dist/form/types/InitiateFeedbackModuleOptions.d.ts +8 -0
- package/dist/index.cjs.js +148 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.es.js +3207 -0
- package/dist/index.iife.js +148 -0
- package/package.json +71 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var SiteUtilsFeedback=(function(je,s,Qr){"use strict";var ct={},Tn;function Jr(){if(Tn)return ct;Tn=1;var e=Qr;return ct.createRoot=e.createRoot,ct.hydrateRoot=e.hydrateRoot,ct}var eo=Jr(),H=function(){return H=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},H.apply(this,arguments)};function ut(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var k="-ms-",Ye="-moz-",C="-webkit-",wn="comm",dt="rule",zt="decl",to="@import",xn="@keyframes",no="@layer",Cn=Math.abs,Bt=String.fromCharCode,Ut=Object.assign;function ro(e,t){return z(e,0)^45?(((t<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3):0}function An(e){return e.trim()}function le(e,t){return(e=t.exec(e))?e[0]:e}function g(e,t,n){return e.replace(t,n)}function ft(e,t,n){return e.indexOf(t,n)}function z(e,t){return e.charCodeAt(t)|0}function Ie(e,t,n){return e.slice(t,n)}function ie(e){return e.length}function _n(e){return e.length}function qe(e,t){return t.push(e),e}function oo(e,t){return e.map(t).join("")}function In(e,t){return e.filter(function(n){return!le(n,t)})}var mt=1,ke=1,kn=0,Z=0,L=0,Oe="";function ht(e,t,n,r,o,a,l,d){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:mt,column:ke,length:l,return:"",siblings:d}}function he(e,t){return Ut(ht("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Pe(e){for(;e.root;)e=he(e.root,{children:[e]});qe(e,e.siblings)}function io(){return L}function ao(){return L=Z>0?z(Oe,--Z):0,ke--,L===10&&(ke=1,mt--),L}function J(){return L=Z<kn?z(Oe,Z++):0,ke++,L===10&&(ke=1,mt++),L}function ye(){return z(Oe,Z)}function pt(){return Z}function gt(e,t){return Ie(Oe,e,t)}function Wt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function so(e){return mt=ke=1,kn=ie(Oe=e),Z=0,[]}function lo(e){return Oe="",e}function Ht(e){return An(gt(Z-1,Vt(e===91?e+2:e===40?e+1:e)))}function co(e){for(;(L=ye())&&L<33;)J();return Wt(e)>2||Wt(L)>3?"":" "}function uo(e,t){for(;--t&&J()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return gt(e,pt()+(t<6&&ye()==32&&J()==32))}function Vt(e){for(;J();)switch(L){case e:return Z;case 34:case 39:e!==34&&e!==39&&Vt(L);break;case 40:e===41&&Vt(e);break;case 92:J();break}return Z}function fo(e,t){for(;J()&&e+L!==57;)if(e+L===84&&ye()===47)break;return"/*"+gt(t,Z-1)+"*"+Bt(e===47?e:J())}function mo(e){for(;!Wt(ye());)J();return gt(e,Z)}function ho(e){return lo(bt("",null,null,null,[""],e=so(e),0,[0],e))}function bt(e,t,n,r,o,a,l,d,u){for(var m=0,p=0,T=l,w=0,E=0,A=0,D=1,q=1,M=1,P=0,_="",b=o,O=a,x=r,y=_;q;)switch(A=P,P=J()){case 40:if(A!=108&&z(y,T-1)==58){ft(y+=g(Ht(P),"&","&\f"),"&\f",Cn(m?d[m-1]:0))!=-1&&(M=-1);break}case 34:case 39:case 91:y+=Ht(P);break;case 9:case 10:case 13:case 32:y+=co(A);break;case 92:y+=uo(pt()-1,7);continue;case 47:switch(ye()){case 42:case 47:qe(po(fo(J(),pt()),t,n,u),u);break;default:y+="/"}break;case 123*D:d[m++]=ie(y)*M;case 125*D:case 59:case 0:switch(P){case 0:case 125:q=0;case 59+p:M==-1&&(y=g(y,/\f/g,"")),E>0&&ie(y)-T&&qe(E>32?Pn(y+";",r,n,T-1,u):Pn(g(y," ","")+";",r,n,T-2,u),u);break;case 59:y+=";";default:if(qe(x=On(y,t,n,m,p,o,d,_,b=[],O=[],T,a),a),P===123)if(p===0)bt(y,t,x,x,b,a,T,d,O);else switch(w===99&&z(y,3)===110?100:w){case 100:case 108:case 109:case 115:bt(e,x,x,r&&qe(On(e,x,x,0,0,o,d,_,o,b=[],T,O),O),o,O,T,d,r?b:O);break;default:bt(y,x,x,x,[""],O,0,d,O)}}m=p=E=0,D=M=1,_=y="",T=l;break;case 58:T=1+ie(y),E=A;default:if(D<1){if(P==123)--D;else if(P==125&&D++==0&&ao()==125)continue}switch(y+=Bt(P),P*D){case 38:M=p>0?1:(y+="\f",-1);break;case 44:d[m++]=(ie(y)-1)*M,M=1;break;case 64:ye()===45&&(y+=Ht(J())),w=ye(),p=T=ie(_=y+=mo(pt())),P++;break;case 45:A===45&&ie(y)==2&&(D=0)}}return a}function On(e,t,n,r,o,a,l,d,u,m,p,T){for(var w=o-1,E=o===0?a:[""],A=_n(E),D=0,q=0,M=0;D<r;++D)for(var P=0,_=Ie(e,w+1,w=Cn(q=l[D])),b=e;P<A;++P)(b=An(q>0?E[P]+" "+_:g(_,/&\f/g,E[P])))&&(u[M++]=b);return ht(e,t,n,o===0?dt:d,u,m,p,T)}function po(e,t,n,r){return ht(e,t,n,wn,Bt(io()),Ie(e,2,-2),0,r)}function Pn(e,t,n,r,o){return ht(e,t,n,zt,Ie(e,0,r),Ie(e,r+1,-1),r,o)}function Nn(e,t,n){switch(ro(e,t)){case 5103:return C+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return C+e+e;case 4789:return Ye+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return C+e+Ye+e+k+e+e;case 5936:switch(z(e,t+11)){case 114:return C+e+k+g(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return C+e+k+g(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return C+e+k+g(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return C+e+k+e+e;case 6165:return C+e+k+"flex-"+e+e;case 5187:return C+e+g(e,/(\w+).+(:[^]+)/,C+"box-$1$2"+k+"flex-$1$2")+e;case 5443:return C+e+k+"flex-item-"+g(e,/flex-|-self/g,"")+(le(e,/flex-|baseline/)?"":k+"grid-row-"+g(e,/flex-|-self/g,""))+e;case 4675:return C+e+k+"flex-line-pack"+g(e,/align-content|flex-|-self/g,"")+e;case 5548:return C+e+k+g(e,"shrink","negative")+e;case 5292:return C+e+k+g(e,"basis","preferred-size")+e;case 6060:return C+"box-"+g(e,"-grow","")+C+e+k+g(e,"grow","positive")+e;case 4554:return C+g(e,/([^-])(transform)/g,"$1"+C+"$2")+e;case 6187:return g(g(g(e,/(zoom-|grab)/,C+"$1"),/(image-set)/,C+"$1"),e,"")+e;case 5495:case 3959:return g(e,/(image-set\([^]*)/,C+"$1$`$1");case 4968:return g(g(e,/(.+:)(flex-)?(.*)/,C+"box-pack:$3"+k+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+C+e+e;case 4200:if(!le(e,/flex-|baseline/))return k+"grid-column-align"+Ie(e,t)+e;break;case 2592:case 3360:return k+g(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,o){return t=o,le(r.props,/grid-\w+-end/)})?~ft(e+(n=n[t].value),"span",0)?e:k+g(e,"-start","")+e+k+"grid-row-span:"+(~ft(n,"span",0)?le(n,/\d+/):+le(n,/\d+/)-+le(e,/\d+/))+";":k+g(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return le(r.props,/grid-\w+-start/)})?e:k+g(g(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return g(e,/(.+)-inline(.+)/,C+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ie(e)-1-t>6)switch(z(e,t+1)){case 109:if(z(e,t+4)!==45)break;case 102:return g(e,/(.+:)(.+)-([^]+)/,"$1"+C+"$2-$3$1"+Ye+(z(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ft(e,"stretch",0)?Nn(g(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return g(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,o,a,l,d,u,m){return k+o+":"+a+m+(l?k+o+"-span:"+(d?u:+u-+a)+m:"")+e});case 4949:if(z(e,t+6)===121)return g(e,":",":"+C)+e;break;case 6444:switch(z(e,z(e,14)===45?18:11)){case 120:return g(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+C+(z(e,14)===45?"inline-":"")+"box$3$1"+C+"$2$3$1"+k+"$2box$3")+e;case 100:return g(e,":",":"+k)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return g(e,"scroll-","scroll-snap-")+e}return e}function yt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function go(e,t,n,r){switch(e.type){case no:if(e.children.length)break;case to:case zt:return e.return=e.return||e.value;case wn:return"";case xn:return e.return=e.value+"{"+yt(e.children,r)+"}";case dt:if(!ie(e.value=e.props.join(",")))return""}return ie(n=yt(e.children,r))?e.return=e.value+"{"+n+"}":""}function bo(e){var t=_n(e);return function(n,r,o,a){for(var l="",d=0;d<t;d++)l+=e[d](n,r,o,a)||"";return l}}function yo(e){return function(t){t.root||(t=t.return)&&e(t)}}function vo(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case zt:e.return=Nn(e.value,e.length,n);return;case xn:return yt([he(e,{value:g(e.value,"@","@"+C)})],r);case dt:if(e.length)return oo(n=e.props,function(o){switch(le(o,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Pe(he(e,{props:[g(o,/:(read-\w+)/,":"+Ye+"$1")]})),Pe(he(e,{props:[o]})),Ut(e,{props:In(n,r)});break;case"::placeholder":Pe(he(e,{props:[g(o,/:(plac\w+)/,":"+C+"input-$1")]})),Pe(he(e,{props:[g(o,/:(plac\w+)/,":"+Ye+"$1")]})),Pe(he(e,{props:[g(o,/:(plac\w+)/,k+"input-$1")]})),Pe(he(e,{props:[o]})),Ut(e,{props:In(n,r)});break}return""})}}var Eo={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ne=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",$n="active",Dn="data-styled-version",vt="6.1.19",Gt=`/*!sc*/
|
|
2
|
+
`,Et=typeof window<"u"&&typeof document<"u",So=!!(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),St=Object.freeze([]),$e=Object.freeze({});function To(e,t,n){return n===void 0&&(n=$e),e.theme!==n.theme&&e.theme||t||n.theme}var Mn=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"]),wo=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,xo=/(^-|-$)/g;function Ln(e){return e.replace(wo,"-").replace(xo,"")}var Co=/(a)(d)/gi,Tt=52,Fn=function(e){return String.fromCharCode(e+(e>25?39:97))};function jt(e){var t,n="";for(t=Math.abs(e);t>Tt;t=t/Tt|0)n=Fn(t%Tt)+n;return(Fn(t%Tt)+n).replace(Co,"$1-$2")}var Yt,Rn=5381,De=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},zn=function(e){return De(Rn,e)};function Ao(e){return jt(zn(e)>>>0)}function _o(e){return e.displayName||e.name||"Component"}function qt(e){return typeof e=="string"&&!0}var Bn=typeof Symbol=="function"&&Symbol.for,Un=Bn?Symbol.for("react.memo"):60115,Io=Bn?Symbol.for("react.forward_ref"):60112,ko={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Oo={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Wn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Po=((Yt={})[Io]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yt[Un]=Wn,Yt);function Hn(e){return("type"in(t=e)&&t.type.$$typeof)===Un?Wn:"$$typeof"in e?Po[e.$$typeof]:ko;var t}var No=Object.defineProperty,$o=Object.getOwnPropertyNames,Vn=Object.getOwnPropertySymbols,Do=Object.getOwnPropertyDescriptor,Mo=Object.getPrototypeOf,Gn=Object.prototype;function jn(e,t,n){if(typeof t!="string"){if(Gn){var r=Mo(t);r&&r!==Gn&&jn(e,r,n)}var o=$o(t);Vn&&(o=o.concat(Vn(t)));for(var a=Hn(e),l=Hn(t),d=0;d<o.length;++d){var u=o[d];if(!(u in Oo||n&&n[u]||l&&u in l||a&&u in a)){var m=Do(t,u);try{No(e,u,m)}catch{}}}}return e}function ve(e){return typeof e=="function"}function Kt(e){return typeof e=="object"&&"styledComponentId"in e}function Ee(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Yn(e,t){if(e.length===0)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function Ke(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Xt(e,t,n){if(n===void 0&&(n=!1),!n&&!Ke(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Xt(e[r],t[r]);else if(Ke(t))for(var r in t)e[r]=Xt(e[r],t[r]);return e}function Zt(e,t){Object.defineProperty(e,"toString",{value:t})}function Se(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];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 Lo=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r<t;r++)n+=this.groupSizes[r];return n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,o=r.length,a=o;t>=a;)if((a<<=1)<0)throw Se(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var l=o;l<a;l++)this.groupSizes[l]=0}for(var d=this.indexOfGroup(t+1),u=(l=0,n.length);l<u;l++)this.tag.insertRule(d,n[l])&&(this.groupSizes[t]++,d++)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),o=r+n;this.groupSizes[t]=0;for(var a=r;a<o;a++)this.tag.deleteRule(r)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],o=this.indexOfGroup(t),a=o+r,l=o;l<a;l++)n+="".concat(this.tag.getRule(l)).concat(Gt);return n},e})(),wt=new Map,xt=new Map,Ct=1,At=function(e){if(wt.has(e))return wt.get(e);for(;xt.has(Ct);)Ct++;var t=Ct++;return wt.set(e,t),xt.set(t,e),t},Fo=function(e,t){Ct=t+1,wt.set(e,t),xt.set(t,e)},Ro="style[".concat(Ne,"][").concat(Dn,'="').concat(vt,'"]'),zo=new RegExp("^".concat(Ne,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Bo=function(e,t,n){for(var r,o=n.split(","),a=0,l=o.length;a<l;a++)(r=o[a])&&e.registerName(t,r)},Uo=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(Gt),o=[],a=0,l=r.length;a<l;a++){var d=r[a].trim();if(d){var u=d.match(zo);if(u){var m=0|parseInt(u[1],10),p=u[2];m!==0&&(Fo(p,m),Bo(e,p,u[3]),e.getTag().insertRules(m,o)),o.length=0}else o.push(d)}}},qn=function(e){for(var t=document.querySelectorAll(Ro),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(Ne)!==$n&&(Uo(e,o),o.parentNode&&o.parentNode.removeChild(o))}};function Wo(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Kn=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=(function(d){var u=Array.from(d.querySelectorAll("style[".concat(Ne,"]")));return u[u.length-1]})(n),a=o!==void 0?o.nextSibling:null;r.setAttribute(Ne,$n),r.setAttribute(Dn,vt);var l=Wo();return l&&r.setAttribute("nonce",l),n.insertBefore(r,a),r},Ho=(function(){function e(t){this.element=Kn(t),this.element.appendChild(document.createTextNode("")),this.sheet=(function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,o=0,a=r.length;o<a;o++){var l=r[o];if(l.ownerNode===n)return l}throw Se(17)})(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e})(),Vo=(function(){function e(t){this.element=Kn(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,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})(),Go=(function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(this.rules.splice(t,0,n),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})(),Xn=Et,jo={isServer:!Et,useCSSOMInjection:!So},Zn=(function(){function e(t,n,r){t===void 0&&(t=$e),n===void 0&&(n={});var o=this;this.options=H(H({},jo),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&Et&&Xn&&(Xn=!1,qn(this)),Zt(this,function(){return(function(a){for(var l=a.getTag(),d=l.length,u="",m=function(T){var w=(function(M){return xt.get(M)})(T);if(w===void 0)return"continue";var E=a.names.get(w),A=l.getGroup(T);if(E===void 0||!E.size||A.length===0)return"continue";var D="".concat(Ne,".g").concat(T,'[id="').concat(w,'"]'),q="";E!==void 0&&E.forEach(function(M){M.length>0&&(q+="".concat(M,","))}),u+="".concat(A).concat(D,'{content:"').concat(q,'"}').concat(Gt)},p=0;p<d;p++)m(p);return u})(o)})}return e.registerId=function(t){return At(t)},e.prototype.rehydrate=function(){!this.server&&Et&&qn(this)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(H(H({},this.options),t),this.gs,n&&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(n){var r=n.useCSSOMInjection,o=n.target;return n.isServer?new Go(o):r?new Ho(o):new Vo(o)})(this.options),new Lo(t)));var t},e.prototype.hasNameForId=function(t,n){return this.names.has(t)&&this.names.get(t).has(n)},e.prototype.registerName=function(t,n){if(At(t),this.names.has(t))this.names.get(t).add(n);else{var r=new Set;r.add(n),this.names.set(t,r)}},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(At(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(At(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e})(),Yo=/&/g,qo=/^\s*\/\/.*$/gm;function Qn(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=Qn(n.children,t)),n})}function Ko(e){var t,n,r,o=$e,a=o.options,l=a===void 0?$e:a,d=o.plugins,u=d===void 0?St:d,m=function(w,E,A){return A.startsWith(n)&&A.endsWith(n)&&A.replaceAll(n,"").length>0?".".concat(t):w},p=u.slice();p.push(function(w){w.type===dt&&w.value.includes("&")&&(w.props[0]=w.props[0].replace(Yo,n).replace(r,m))}),l.prefix&&p.push(vo),p.push(go);var T=function(w,E,A,D){E===void 0&&(E=""),A===void 0&&(A=""),D===void 0&&(D="&"),t=D,n=E,r=new RegExp("\\".concat(n,"\\b"),"g");var q=w.replace(qo,""),M=ho(A||E?"".concat(A," ").concat(E," { ").concat(q," }"):q);l.namespace&&(M=Qn(M,l.namespace));var P=[];return yt(M,bo(p.concat(yo(function(_){return P.push(_)})))),P};return T.hash=u.length?u.reduce(function(w,E){return E.name||Se(15),De(w,E.name)},Rn).toString():"",T}var Xo=new Zn,Qt=Ko(),Jn=s.createContext({shouldForwardProp:void 0,styleSheet:Xo,stylis:Qt});Jn.Consumer,s.createContext(void 0);function er(){return s.useContext(Jn)}var Zo=(function(){function e(t,n){var r=this;this.inject=function(o,a){a===void 0&&(a=Qt);var l=r.name+a.hash;o.hasNameForId(r.id,l)||o.insertRules(r.id,l,a(r.rules,l,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Zt(this,function(){throw Se(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Qt),this.name+t.hash},e})(),Qo=function(e){return e>="A"&&e<="Z"};function tr(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;Qo(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var nr=function(e){return e==null||e===!1||e===""},rr=function(e){var t,n,r=[];for(var o in e){var a=e[o];e.hasOwnProperty(o)&&!nr(a)&&(Array.isArray(a)&&a.isCss||ve(a)?r.push("".concat(tr(o),":"),a,";"):Ke(a)?r.push.apply(r,ut(ut(["".concat(o," {")],rr(a),!1),["}"],!1)):r.push("".concat(tr(o),": ").concat((t=o,(n=a)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in Eo||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Te(e,t,n,r){if(nr(e))return[];if(Kt(e))return[".".concat(e.styledComponentId)];if(ve(e)){if(!ve(a=e)||a.prototype&&a.prototype.isReactComponent||!t)return[e];var o=e(t);return Te(o,t,n,r)}var a;return e instanceof Zo?n?(e.inject(n,r),[e.getName(r)]):[e]:Ke(e)?rr(e):Array.isArray(e)?Array.prototype.concat.apply(St,e.map(function(l){return Te(l,t,n,r)})):[e.toString()]}function Jo(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(ve(n)&&!Kt(n))return!1}return!0}var ei=zn(vt),ti=(function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&Jo(t),this.componentId=n,this.baseHash=De(ei,n),this.baseStyle=r,Zn.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))o=Ee(o,this.staticRulesId);else{var a=Yn(Te(this.rules,t,n,r)),l=jt(De(this.baseHash,a)>>>0);if(!n.hasNameForId(this.componentId,l)){var d=r(a,".".concat(l),void 0,this.componentId);n.insertRules(this.componentId,l,d)}o=Ee(o,l),this.staticRulesId=l}else{for(var u=De(this.baseHash,r.hash),m="",p=0;p<this.rules.length;p++){var T=this.rules[p];if(typeof T=="string")m+=T;else if(T){var w=Yn(Te(T,t,n,r));u=De(u,w+p),m+=w}}if(m){var E=jt(u>>>0);n.hasNameForId(this.componentId,E)||n.insertRules(this.componentId,E,r(m,".".concat(E),void 0,this.componentId)),o=Ee(o,E)}}return o},e})(),_t=s.createContext(void 0);_t.Consumer;function ni(e){var t=s.useContext(_t),n=s.useMemo(function(){return(function(r,o){if(!r)throw Se(14);if(ve(r)){var a=r(o);return a}if(Array.isArray(r)||typeof r!="object")throw Se(8);return o?H(H({},o),r):r})(e.theme,t)},[e.theme,t]);return e.children?s.createElement(_t.Provider,{value:n},e.children):null}var Jt={};function ri(e,t,n){var r=Kt(e),o=e,a=!qt(e),l=t.attrs,d=l===void 0?St:l,u=t.componentId,m=u===void 0?(function(b,O){var x=typeof b!="string"?"sc":Ln(b);Jt[x]=(Jt[x]||0)+1;var y="".concat(x,"-").concat(Ao(vt+x+Jt[x]));return O?"".concat(O,"-").concat(y):y})(t.displayName,t.parentComponentId):u,p=t.displayName,T=p===void 0?(function(b){return qt(b)?"styled.".concat(b):"Styled(".concat(_o(b),")")})(e):p,w=t.displayName&&t.componentId?"".concat(Ln(t.displayName),"-").concat(t.componentId):t.componentId||m,E=r&&o.attrs?o.attrs.concat(d).filter(Boolean):d,A=t.shouldForwardProp;if(r&&o.shouldForwardProp){var D=o.shouldForwardProp;if(t.shouldForwardProp){var q=t.shouldForwardProp;A=function(b,O){return D(b,O)&&q(b,O)}}else A=D}var M=new ti(n,w,r?o.componentStyle:void 0);function P(b,O){return(function(x,y,pe){var Fe=x.attrs,un=x.componentStyle,U=x.defaultProps,nt=x.foldedComponentIds,rt=x.styledComponentId,ot=x.target,dn=s.useContext(_t),fn=er(),it=x.shouldForwardProp||fn.shouldForwardProp,at=To(y,dn,U)||$e,te=(function(I,re,ge){for(var be,oe=H(H({},re),{className:void 0,theme:ge}),ze=0;ze<I.length;ze+=1){var Ce=ve(be=I[ze])?be(oe):be;for(var K in Ce)oe[K]=K==="className"?Ee(oe[K],Ce[K]):K==="style"?H(H({},oe[K]),Ce[K]):Ce[K]}return re.className&&(oe.className=Ee(oe.className,re.className)),oe})(Fe,y,at),xe=te.as||ot,N={};for(var ne in te)te[ne]===void 0||ne[0]==="$"||ne==="as"||ne==="theme"&&te.theme===at||(ne==="forwardedAs"?N.as=te.forwardedAs:it&&!it(ne,xe)||(N[ne]=te[ne]));var F=(function(I,re){var ge=er(),be=I.generateAndInjectStyles(re,ge.styleSheet,ge.stylis);return be})(un,te),Re=Ee(nt,rt);return F&&(Re+=" "+F),te.className&&(Re+=" "+te.className),N[qt(xe)&&!Mn.has(xe)?"class":"className"]=Re,pe&&(N.ref=pe),s.createElement(xe,N)})(_,b,O)}P.displayName=T;var _=s.forwardRef(P);return _.attrs=E,_.componentStyle=M,_.displayName=T,_.shouldForwardProp=A,_.foldedComponentIds=r?Ee(o.foldedComponentIds,o.styledComponentId):"",_.styledComponentId=w,_.target=r?o.target:e,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=r?(function(O){for(var x=[],y=1;y<arguments.length;y++)x[y-1]=arguments[y];for(var pe=0,Fe=x;pe<Fe.length;pe++)Xt(O,Fe[pe],!0);return O})({},o.defaultProps,b):b}}),Zt(_,function(){return".".concat(_.styledComponentId)}),a&&jn(_,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function or(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var ir=function(e){return Object.assign(e,{isCss:!0})};function oi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(ve(e)||Ke(e))return ir(Te(or(St,ut([e],t,!0))));var r=e;return t.length===0&&r.length===1&&typeof r[0]=="string"?Te(r):ir(Te(or(r,t)))}function en(e,t,n){if(n===void 0&&(n=$e),!t)throw Se(1,t);var r=function(o){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];return e(t,n,oi.apply(void 0,ut([o],a,!1)))};return r.attrs=function(o){return en(e,t,H(H({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},r.withConfig=function(o){return en(e,t,H(H({},n),o))},r}var ar=function(e){return en(ri,e)},S=ar;Mn.forEach(function(e){S[e]=ar(e)});const we={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},ii={selectedVariant:"primary",getDefaultVariantOrSelected:()=>"primary",...we},sr=s.createContext({...we,...ii}),ai=S.div`
|
|
3
|
+
font-family:
|
|
4
|
+
ui-sans-serif,
|
|
5
|
+
system-ui,
|
|
6
|
+
-apple-system,
|
|
7
|
+
BlinkMacSystemFont,
|
|
8
|
+
Segoe UI,
|
|
9
|
+
Roboto,
|
|
10
|
+
Helvetica Neue,
|
|
11
|
+
Vazirmatn,
|
|
12
|
+
Arial,
|
|
13
|
+
Noto Sans,
|
|
14
|
+
sans-serif,
|
|
15
|
+
Apple Color Emoji,
|
|
16
|
+
Segoe UI Emoji,
|
|
17
|
+
Segoe UI Symbol,
|
|
18
|
+
Noto Color Emoji;
|
|
19
|
+
color-scheme: light;
|
|
20
|
+
--color-base-100: ${e=>e.$theme.base100};
|
|
21
|
+
--color-base-200: ${e=>e.$theme.base200};
|
|
22
|
+
--color-base-300: ${e=>e.$theme.base300};
|
|
23
|
+
--color-base-content: ${e=>e.$theme.baseContent};
|
|
24
|
+
--color-primary: ${e=>e.$theme.primary};
|
|
25
|
+
--color-primary-content: ${e=>e.$theme.primaryContent};
|
|
26
|
+
--color-secondary: ${e=>e.$theme.secondary};
|
|
27
|
+
--color-secondary-content: ${e=>e.$theme.secondaryContent};
|
|
28
|
+
--color-accent: ${e=>e.$theme.accent};
|
|
29
|
+
--color-accent-content: ${e=>e.$theme.accentContent};
|
|
30
|
+
--color-neutral: ${e=>e.$theme.neutral};
|
|
31
|
+
--color-neutral-content: ${e=>e.$theme.neutralContent};
|
|
32
|
+
--color-info: ${e=>e.$theme.info};
|
|
33
|
+
--color-info-content: ${e=>e.$theme.infoContent};
|
|
34
|
+
--color-success: ${e=>e.$theme.success};
|
|
35
|
+
--color-success-content: ${e=>e.$theme.successContent};
|
|
36
|
+
--color-warning: ${e=>e.$theme.warning};
|
|
37
|
+
--color-warning-content: ${e=>e.$theme.warningContent};
|
|
38
|
+
--color-error: ${e=>e.$theme.error};
|
|
39
|
+
--color-error-content: ${e=>e.$theme.errorContent};
|
|
40
|
+
|
|
41
|
+
--radius-selector: ${e=>e.$theme.radiusSelectors};
|
|
42
|
+
--radius-field: ${e=>e.$theme.radiusField};
|
|
43
|
+
--radius-box: ${e=>e.$theme.radiusBox};
|
|
44
|
+
|
|
45
|
+
--border-width: ${e=>e.$theme.borderWidth};
|
|
46
|
+
|
|
47
|
+
--font-size: ${e=>e.$theme.fontSize};
|
|
48
|
+
--size-field: ${e=>e.$theme.sizeField};
|
|
49
|
+
--size-selector: ${e=>e.$theme.sizeSelector};
|
|
50
|
+
--depth: ${e=>e.$theme.depth};
|
|
51
|
+
--spacing: ${e=>e.$theme.spacing};
|
|
52
|
+
--all-fields-size: ${e=>e.$theme.allFieldsSize};
|
|
53
|
+
`,si=e=>{const t=e.selectedVariant??"primary";return s.createElement(ni,{theme:e.theme??we,children:s.createElement(ai,{$theme:e.theme??we,children:s.createElement(sr.Provider,{value:{selectedVariant:t,getDefaultVariantOrSelected:()=>t,...e.theme??we},children:e.children})})})},lr=()=>s.useContext(sr),ce=e=>{const{getDefaultVariantOrSelected:t}=lr(),n=t();return we[e??n]},cr=e=>{const{getDefaultVariantOrSelected:t}=lr(),n=t(),r=e?`${e}Content`:`${n}Content`;return we[r]},li=()=>{const e="http://localhost:4000/external",t=async n=>{const r=await n;if(!r.ok)switch(r.status){case 404:throw new Error("Not found");case 400:throw new Error("Bad request");default:throw new Error("Unknown error")}return(await n).json()};return{post:async(n,r,o)=>{var a;try{return t(fetch(`${e}${n}`,{method:"POST",body:JSON.stringify(r),signal:((a=o==null?void 0:o.abortController)==null?void 0:a.signal)??null,headers:{"Content-Type":"application/json",...(o==null?void 0:o.headers)??{}}}))}catch(l){throw console.log(l),l}},get:async(n,r)=>{var o;try{return t(fetch(`${e}${n}`,{method:"GET",signal:((o=r==null?void 0:r.abortController)==null?void 0:o.signal)??null,headers:{"Content-Type":"application/json",...(r==null?void 0:r.headers)??{}}}))}catch(a){throw console.log(a),a}}}},ur={meta:{name:"asd"},steps:[{title:"Overall altitude",meta:{name:"overall"},fields:[{type:"matrix",meta:{name:"asd",fieldKey:"recommendationChance"},validations:{required:!0},label:{default:"How likely are you to recommend this company to a friend or colleague?"},max:10},{type:"radio-group",meta:{name:"asd",fieldKey:"satisfactionLevel"},label:{default:"Overall, how satisfied or dissatisfied are you with our company?"},validations:{required:!0},options:[{label:"Very satisfied",id:"1"},{label:"Somewhat satisfied",id:"2"},{label:"Neither satisfied nor dissatisfied",id:"3"},{label:"Somewhat dissatisfied",id:"4"},{label:"Very dissatisfied",id:"5"}]},{type:"rating",icon:"star2",max:5,meta:{name:"asd",fieldKey:"satisfactionRating"},label:{default:"What is your general satisfaction?"},validations:{required:!0}}]},{meta:{name:"products"},title:"Product questions",fields:[{type:"checkbox-group",meta:{name:"asd",fieldKey:"productDescribeWords"},label:{default:"Which of the following words best describes your experience with our products?"},validations:{required:!0},options:[{label:"Reliable",id:"1"},{label:"High quality",id:"2"},{label:"Useful",id:"3"},{label:"Unique",id:"4"},{label:"Value for money",id:"5"},{label:"Overpriced",id:"6"},{label:"Ineffective",id:"7"},{label:"Poor quality",id:"8"},{label:"Unreliable",id:"9"}]},{type:"radio-group",meta:{name:"asd",fieldKey:"productExpectations"},label:{default:"How well products meet your expectations?"},validations:{required:!0},options:[{label:"Extremely well",id:"1"},{label:"Well",id:"2"},{label:"Somewhat well",id:"3"},{label:"Not well",id:"4"},{label:"Not at all well",id:"5"}]},{type:"matrix",meta:{name:"asd",fieldKey:"productQuality"},label:{default:"How would you rate the quality of our products?"},validations:{required:!0},max:10,minText:"Poor quality",maxText:"Good quality"}]},{meta:{name:"final-questions"},title:"Final questions",fields:[{type:"range-slide",defaultValue:77,meta:{name:"asd",fieldKey:"productsImpressionLevel"},label:{default:"What is your overall impression level of our products?"}},{type:"rating",icon:"heart",max:5,meta:{name:"asd",fieldKey:"productExpectations"},label:{default:"Do you like our service and products?"},validations:{required:!0}},{type:"select",meta:{name:"asd",fieldKey:"fromWhereDidYouHearAboutUs"},label:{default:"From where did you hear about us?"},validations:{required:!0},options:[{label:"Facebook",id:"1"},{label:"Instagram",id:"2"},{label:"Google search",id:"3"},{label:"AD",id:"4"},{label:"Other",id:"5"}]},{type:"textarea",meta:{name:"asd",fieldKey:"lastComments"},validations:{required:!1},label:{values:[{conditions:[{fieldName:"satisfactionRating",lessThan:4}],value:"How can we improve our service? (optional)"}],default:"What you would like to tell us about your experience with this company? (optional)?"}}]}]},ci=(e,t)=>new Promise(n=>{n({id:"",domainId:"",attributes:{theme:{},useSystemTheme:!0,variant:"primary"},popupForm:{meta:{name:"popupForm"},config:{canReturnToPreviousStep:!0,nextButtonText:"Next",previousButtonText:"Previous",submitButtonText:"Submit",formTitle:"We are looking forward to hear from you!",buttonText:"Feedback"},styles:{left:null,top:0,bottom:-20,right:0},form:ur},inlineForm:{meta:{name:"asd"},config:{canReturnToPreviousStep:!0,nextButtonText:"Next",previousButtonText:"Previous",submitButtonText:"Submit",formTitle:"We are looking forward to hear from you!"},form:ur}})}),ui=e=>{const[t,n]=s.useState(),[r,o]=s.useState(!0),[a,l]=s.useState(null);return s.useEffect(()=>{const d=new AbortController;return o(!0),e(d).then(n).catch(l).finally(()=>o(!1)),()=>{d.abort()}},[]),{data:t,loading:r,error:a}},Me=S.button(e=>{const t=ce(),n=cr(),o=!e.$outlined?t:"#fff",a=e.$outlined?t:n,l=e.$outlined?a:o,d=`calc(${e.theme.sizeField} * 10)`;return{borderRadius:e.theme.radiusField,borderColor:e.disabled?"#cfcfcf":l,borderStyle:e.$dashed?"dashed":"solid",cursor:"pointer",boxShadow:"inset 0 0 20px 20px transparent",height:d,fontWeight:"600",opacity:e.disabled?.5:1,paddingInline:"1.2rem",transition:"all 0.2s ease-in-out",background:e.disabled?"#cfcfcf":o,borderWidth:e.theme.borderWidth,userSelect:e.disabled?"none":void 0,color:e.disabled?"#888888":a,"&:active":{transform:e.disabled?void 0:"scale(0.97)"},"&:hover":{opacity:e.disabled?void 0:.8,cursor:e.disabled?"auto":"pointer",boxShadow:e.disabled?void 0:"inset 0 0 20px 20px #00000017"},"@media (max-width: 900px)":{paddingInline:"0.5rem"},"@media (max-width: 700px)":{paddingInline:"0.7rem"},"@media (max-width: 400px)":{paddingInline:"0.7rem"}}}),di=S.div`
|
|
54
|
+
visibility: ${e=>e.$isVisible&&e.$height?"visible":"hidden"};
|
|
55
|
+
opacity: ${e=>e.$isVisible?1:0};
|
|
56
|
+
display: flex;
|
|
57
|
+
min-height: ${e=>e.$height?`${e.$height}px`:"auto"};
|
|
58
|
+
gap: calc(var(--spacing) * 7);
|
|
59
|
+
top: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
position: ${e=>e.$isVisible?"relative":"absolute"};
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
justify-content: flex-start;
|
|
64
|
+
flex-wrap: wrap;
|
|
65
|
+
align-content: flex-start;
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
@media (max-width: 900px) {
|
|
68
|
+
min-height: auto;
|
|
69
|
+
height: ${e=>e.$isVisible?"auto":"0"};
|
|
70
|
+
width: ${e=>e.$isVisible?"auto":"0"};
|
|
71
|
+
}
|
|
72
|
+
`,dr=e=>{const t=s.useRef(null);return s.useEffect(()=>{t.current&&e.onSetMaxHeight(t.current.clientHeight)},[t]),s.createElement(di,{ref:t,$height:e.height,$isVisible:e.isVisible,children:e.children})},fi=S.ul`
|
|
73
|
+
counter-reset: step;
|
|
74
|
+
grid-auto-columns: 1fr;
|
|
75
|
+
grid-auto-flow: column;
|
|
76
|
+
display: inline-grid;
|
|
77
|
+
overflow: auto hidden;
|
|
78
|
+
@media (max-width: 900px) {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
`,mi=S.li(e=>{const t=ce(e.colorVariant),n=cr(e.colorVariant),r=e.shouldBeFilled?t:"var(--color-base-300)",o=e.shouldBeFilled?n:"var(--color-base-content)";return{textAlign:"center","--step-bg":r,"--step-fg":o,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"}}}),fr=e=>(console.log("props.currentStepIndex",e.currentStepIndex),s.createElement(fi,{children:[e.steps.map((t,n)=>s.createElement(mi,{key:t.title,colorVariant:e.colorVariant,shouldBeFilled:e.currentStepIndex>=n,children:t.title}))]})),hi={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"}},pi=S.div(e=>({...hi[e.$variant??"paragraph"],color:e.theme.baseContent,...e.$linear?{margin:"0"}:{}})),ae=e=>s.createElement(pi,{$variant:e.variant,$linear:e.linear,children:e.children}),gi=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}},mr=e=>{const t=s.useMemo(()=>e.form.steps.reduce((l,d,u)=>(l.validationsPerStep[u]={},l.steps=[...l.steps,{...d,fields:d.fields.map(m=>{const p=m.meta.fieldKey;return p?(l.validationsPerStep[u][p]={fieldType:m.type,validations:m.validations},l.state={...l.state,[p]:gi(m.type)},{dataField:p,...m}):{...m,dataField:null}})}],l),{validationsPerStep:{},state:{},steps:[]}),[e.form]),[n,r]=s.useState(t.state),o=s.useCallback((l,d)=>{l!==null&&r(u=>({...u,[l]:d}))},[r]),a=s.useCallback(l=>l?n[l]:null,[n]);return{steps:t.steps,validationsPerStep:t.validationsPerStep,state:n,setStateByKey:o,getStateByKey:a}},bi=li(),yi=(e,t)=>bi.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:hr,setPrototypeOf:pr,isFrozen:vi,getPrototypeOf:Ei,getOwnPropertyDescriptor:Si}=Object;let{freeze:G,seal:Q,create:gr}=Object,{apply:tn,construct:nn}=typeof Reflect<"u"&&Reflect;G||(G=function(t){return t}),Q||(Q=function(t){return t}),tn||(tn=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];return t.apply(n,o)}),nn||(nn=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const It=Y(Array.prototype.forEach),Ti=Y(Array.prototype.lastIndexOf),br=Y(Array.prototype.pop),Xe=Y(Array.prototype.push),wi=Y(Array.prototype.splice),kt=Y(String.prototype.toLowerCase),rn=Y(String.prototype.toString),on=Y(String.prototype.match),Ze=Y(String.prototype.replace),xi=Y(String.prototype.indexOf),Ci=Y(String.prototype.trim),ee=Y(Object.prototype.hasOwnProperty),j=Y(RegExp.prototype.test),Qe=Ai(TypeError);function Y(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return tn(e,t,r)}}function Ai(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nn(e,n)}}function v(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kt;pr&&pr(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const a=n(o);a!==o&&(vi(t)||(t[r]=a),o=a)}e[o]=!0}return e}function _i(e){for(let t=0;t<e.length;t++)ee(e,t)||(e[t]=null);return e}function ue(e){const t=gr(null);for(const[n,r]of hr(e))ee(e,n)&&(Array.isArray(r)?t[n]=_i(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=ue(r):t[n]=r);return t}function Je(e,t){for(;e!==null;){const r=Si(e,t);if(r){if(r.get)return Y(r.get);if(typeof r.value=="function")return Y(r.value)}e=Ei(e)}function n(){return null}return n}const yr=G(["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"]),an=G(["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"]),sn=G(["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"]),Ii=G(["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"]),ln=G(["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"]),ki=G(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vr=G(["#text"]),Er=G(["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"]),cn=G(["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"]),Sr=G(["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"]),Ot=G(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Oi=Q(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Pi=Q(/<%[\w\W]*|[\w\W]*%>/gm),Ni=Q(/\$\{[\w\W]*/gm),$i=Q(/^data-[\-\w.\u00B7-\uFFFF]+$/),Di=Q(/^aria-[\-\w]+$/),Tr=Q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mi=Q(/^(?:\w+script|data):/i),Li=Q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wr=Q(/^html$/i),Fi=Q(/^[a-z][.\w]*(-[.\w]+)+$/i);var xr=Object.freeze({__proto__:null,ARIA_ATTR:Di,ATTR_WHITESPACE:Li,CUSTOM_ELEMENT:Fi,DATA_ATTR:$i,DOCTYPE_NAME:wr,ERB_EXPR:Pi,IS_ALLOWED_URI:Tr,IS_SCRIPT_OR_DATA:Mi,MUSTACHE_EXPR:Oi,TMPLIT_EXPR:Ni});const et={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ri=function(){return typeof window>"u"?null:window},zi=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Cr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ar(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ri();const t=h=>Ar(h);if(t.version="3.2.7",t.removed=[],!e||!e.document||e.document.nodeType!==et.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:d,Element:u,NodeFilter:m,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:T,DOMParser:w,trustedTypes:E}=e,A=u.prototype,D=Je(A,"cloneNode"),q=Je(A,"remove"),M=Je(A,"nextSibling"),P=Je(A,"childNodes"),_=Je(A,"parentNode");if(typeof l=="function"){const h=n.createElement("template");h.content&&h.content.ownerDocument&&(n=h.content.ownerDocument)}let b,O="";const{implementation:x,createNodeIterator:y,createDocumentFragment:pe,getElementsByTagName:Fe}=n,{importNode:un}=r;let U=Cr();t.isSupported=typeof hr=="function"&&typeof _=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:nt,ERB_EXPR:rt,TMPLIT_EXPR:ot,DATA_ATTR:dn,ARIA_ATTR:fn,IS_SCRIPT_OR_DATA:it,ATTR_WHITESPACE:at,CUSTOM_ELEMENT:te}=xr;let{IS_ALLOWED_URI:xe}=xr,N=null;const ne=v({},[...yr,...an,...sn,...ln,...vr]);let F=null;const Re=v({},[...Er,...cn,...Sr,...Ot]);let I=Object.seal(gr(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}})),re=null,ge=null,be=!0,oe=!0,ze=!1,Ce=!0,K=!1,Nt=!0,Ae=!1,mn=!1,hn=!1,Be=!1,$t=!1,Dt=!1,Dr=!0,Mr=!1;const $a="user-content-";let pn=!0,st=!1,Ue={},We=null;const Lr=v({},["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 Fr=null;const Rr=v({},["audio","video","img","source","image","track"]);let gn=null;const zr=v({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Mt="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml";let He=de,bn=!1,yn=null;const Da=v({},[Mt,Lt,de],rn);let Ft=v({},["mi","mo","mn","ms","mtext"]),Rt=v({},["annotation-xml"]);const Ma=v({},["title","style","font","a","script"]);let lt=null;const La=["application/xhtml+xml","text/html"],Fa="text/html";let B=null,Ve=null;const Ra=n.createElement("form"),Br=function(i){return i instanceof RegExp||i instanceof Function},vn=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ve&&Ve===i)){if((!i||typeof i!="object")&&(i={}),i=ue(i),lt=La.indexOf(i.PARSER_MEDIA_TYPE)===-1?Fa:i.PARSER_MEDIA_TYPE,B=lt==="application/xhtml+xml"?rn:kt,N=ee(i,"ALLOWED_TAGS")?v({},i.ALLOWED_TAGS,B):ne,F=ee(i,"ALLOWED_ATTR")?v({},i.ALLOWED_ATTR,B):Re,yn=ee(i,"ALLOWED_NAMESPACES")?v({},i.ALLOWED_NAMESPACES,rn):Da,gn=ee(i,"ADD_URI_SAFE_ATTR")?v(ue(zr),i.ADD_URI_SAFE_ATTR,B):zr,Fr=ee(i,"ADD_DATA_URI_TAGS")?v(ue(Rr),i.ADD_DATA_URI_TAGS,B):Rr,We=ee(i,"FORBID_CONTENTS")?v({},i.FORBID_CONTENTS,B):Lr,re=ee(i,"FORBID_TAGS")?v({},i.FORBID_TAGS,B):ue({}),ge=ee(i,"FORBID_ATTR")?v({},i.FORBID_ATTR,B):ue({}),Ue=ee(i,"USE_PROFILES")?i.USE_PROFILES:!1,be=i.ALLOW_ARIA_ATTR!==!1,oe=i.ALLOW_DATA_ATTR!==!1,ze=i.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=i.SAFE_FOR_TEMPLATES||!1,Nt=i.SAFE_FOR_XML!==!1,Ae=i.WHOLE_DOCUMENT||!1,Be=i.RETURN_DOM||!1,$t=i.RETURN_DOM_FRAGMENT||!1,Dt=i.RETURN_TRUSTED_TYPE||!1,hn=i.FORCE_BODY||!1,Dr=i.SANITIZE_DOM!==!1,Mr=i.SANITIZE_NAMED_PROPS||!1,pn=i.KEEP_CONTENT!==!1,st=i.IN_PLACE||!1,xe=i.ALLOWED_URI_REGEXP||Tr,He=i.NAMESPACE||de,Ft=i.MATHML_TEXT_INTEGRATION_POINTS||Ft,Rt=i.HTML_INTEGRATION_POINTS||Rt,I=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&Br(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&Br(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(oe=!1),$t&&(Be=!0),Ue&&(N=v({},vr),F=[],Ue.html===!0&&(v(N,yr),v(F,Er)),Ue.svg===!0&&(v(N,an),v(F,cn),v(F,Ot)),Ue.svgFilters===!0&&(v(N,sn),v(F,cn),v(F,Ot)),Ue.mathMl===!0&&(v(N,ln),v(F,Sr),v(F,Ot))),i.ADD_TAGS&&(N===ne&&(N=ue(N)),v(N,i.ADD_TAGS,B)),i.ADD_ATTR&&(F===Re&&(F=ue(F)),v(F,i.ADD_ATTR,B)),i.ADD_URI_SAFE_ATTR&&v(gn,i.ADD_URI_SAFE_ATTR,B),i.FORBID_CONTENTS&&(We===Lr&&(We=ue(We)),v(We,i.FORBID_CONTENTS,B)),pn&&(N["#text"]=!0),Ae&&v(N,["html","head","body"]),N.table&&(v(N,["tbody"]),delete re.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=i.TRUSTED_TYPES_POLICY,O=b.createHTML("")}else b===void 0&&(b=zi(E,o)),b!==null&&typeof O=="string"&&(O=b.createHTML(""));G&&G(i),Ve=i}},Ur=v({},[...an,...sn,...Ii]),Wr=v({},[...ln,...ki]),za=function(i){let c=_(i);(!c||!c.tagName)&&(c={namespaceURI:He,tagName:"template"});const f=kt(i.tagName),$=kt(c.tagName);return yn[i.namespaceURI]?i.namespaceURI===Lt?c.namespaceURI===de?f==="svg":c.namespaceURI===Mt?f==="svg"&&($==="annotation-xml"||Ft[$]):!!Ur[f]:i.namespaceURI===Mt?c.namespaceURI===de?f==="math":c.namespaceURI===Lt?f==="math"&&Rt[$]:!!Wr[f]:i.namespaceURI===de?c.namespaceURI===Lt&&!Rt[$]||c.namespaceURI===Mt&&!Ft[$]?!1:!Wr[f]&&(Ma[f]||!Ur[f]):!!(lt==="application/xhtml+xml"&&yn[i.namespaceURI]):!1},se=function(i){Xe(t.removed,{element:i});try{_(i).removeChild(i)}catch{q(i)}},_e=function(i,c){try{Xe(t.removed,{attribute:c.getAttributeNode(i),from:c})}catch{Xe(t.removed,{attribute:null,from:c})}if(c.removeAttribute(i),i==="is")if(Be||$t)try{se(c)}catch{}else try{c.setAttribute(i,"")}catch{}},Hr=function(i){let c=null,f=null;if(hn)i="<remove></remove>"+i;else{const R=on(i,/^[\r\n\t ]+/);f=R&&R[0]}lt==="application/xhtml+xml"&&He===de&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const $=b?b.createHTML(i):i;if(He===de)try{c=new w().parseFromString($,lt)}catch{}if(!c||!c.documentElement){c=x.createDocument(He,"template",null);try{c.documentElement.innerHTML=bn?O:$}catch{}}const V=c.body||c.documentElement;return i&&f&&V.insertBefore(n.createTextNode(f),V.childNodes[0]||null),He===de?Fe.call(c,Ae?"html":"body")[0]:Ae?c.documentElement:V},Vr=function(i){return y.call(i.ownerDocument||i,i,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},En=function(i){return i instanceof T&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof p)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},Gr=function(i){return typeof d=="function"&&i instanceof d};function fe(h,i,c){It(h,f=>{f.call(t,i,c,Ve)})}const jr=function(i){let c=null;if(fe(U.beforeSanitizeElements,i,null),En(i))return se(i),!0;const f=B(i.nodeName);if(fe(U.uponSanitizeElement,i,{tagName:f,allowedTags:N}),Nt&&i.hasChildNodes()&&!Gr(i.firstElementChild)&&j(/<[/\w!]/g,i.innerHTML)&&j(/<[/\w!]/g,i.textContent)||i.nodeType===et.progressingInstruction||Nt&&i.nodeType===et.comment&&j(/<[/\w]/g,i.data))return se(i),!0;if(!N[f]||re[f]){if(!re[f]&&qr(f)&&(I.tagNameCheck instanceof RegExp&&j(I.tagNameCheck,f)||I.tagNameCheck instanceof Function&&I.tagNameCheck(f)))return!1;if(pn&&!We[f]){const $=_(i)||i.parentNode,V=P(i)||i.childNodes;if(V&&$){const R=V.length;for(let X=R-1;X>=0;--X){const me=D(V[X],!0);me.__removalCount=(i.__removalCount||0)+1,$.insertBefore(me,M(i))}}}return se(i),!0}return i instanceof u&&!za(i)||(f==="noscript"||f==="noembed"||f==="noframes")&&j(/<\/no(script|embed|frames)/i,i.innerHTML)?(se(i),!0):(K&&i.nodeType===et.text&&(c=i.textContent,It([nt,rt,ot],$=>{c=Ze(c,$," ")}),i.textContent!==c&&(Xe(t.removed,{element:i.cloneNode()}),i.textContent=c)),fe(U.afterSanitizeElements,i,null),!1)},Yr=function(i,c,f){if(Dr&&(c==="id"||c==="name")&&(f in n||f in Ra))return!1;if(!(oe&&!ge[c]&&j(dn,c))){if(!(be&&j(fn,c))){if(!F[c]||ge[c]){if(!(qr(i)&&(I.tagNameCheck instanceof RegExp&&j(I.tagNameCheck,i)||I.tagNameCheck instanceof Function&&I.tagNameCheck(i))&&(I.attributeNameCheck instanceof RegExp&&j(I.attributeNameCheck,c)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(c,i))||c==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&j(I.tagNameCheck,f)||I.tagNameCheck instanceof Function&&I.tagNameCheck(f))))return!1}else if(!gn[c]){if(!j(xe,Ze(f,at,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&i!=="script"&&xi(f,"data:")===0&&Fr[i])){if(!(ze&&!j(it,Ze(f,at,"")))){if(f)return!1}}}}}}return!0},qr=function(i){return i!=="annotation-xml"&&on(i,te)},Kr=function(i){fe(U.beforeSanitizeAttributes,i,null);const{attributes:c}=i;if(!c||En(i))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let $=c.length;for(;$--;){const V=c[$],{name:R,namespaceURI:X,value:me}=V,Ge=B(R),Sn=me;let W=R==="value"?Sn:Ci(Sn);if(f.attrName=Ge,f.attrValue=W,f.keepAttr=!0,f.forceKeepAttr=void 0,fe(U.uponSanitizeAttribute,i,f),W=f.attrValue,Mr&&(Ge==="id"||Ge==="name")&&(_e(R,i),W=$a+W),Nt&&j(/((--!?|])>)|<\/(style|title|textarea)/i,W)){_e(R,i);continue}if(Ge==="attributename"&&on(W,"href")){_e(R,i);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){_e(R,i);continue}if(!Ce&&j(/\/>/i,W)){_e(R,i);continue}K&&It([nt,rt,ot],Zr=>{W=Ze(W,Zr," ")});const Xr=B(i.nodeName);if(!Yr(Xr,Ge,W)){_e(R,i);continue}if(b&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!X)switch(E.getAttributeType(Xr,Ge)){case"TrustedHTML":{W=b.createHTML(W);break}case"TrustedScriptURL":{W=b.createScriptURL(W);break}}if(W!==Sn)try{X?i.setAttributeNS(X,R,W):i.setAttribute(R,W),En(i)?se(i):br(t.removed)}catch{_e(R,i)}}fe(U.afterSanitizeAttributes,i,null)},Ba=function h(i){let c=null;const f=Vr(i);for(fe(U.beforeSanitizeShadowDOM,i,null);c=f.nextNode();)fe(U.uponSanitizeShadowNode,c,null),jr(c),Kr(c),c.content instanceof a&&h(c.content);fe(U.afterSanitizeShadowDOM,i,null)};return t.sanitize=function(h){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,f=null,$=null,V=null;if(bn=!h,bn&&(h="<!-->"),typeof h!="string"&&!Gr(h))if(typeof h.toString=="function"){if(h=h.toString(),typeof h!="string")throw Qe("dirty is not a string, aborting")}else throw Qe("toString is not a function");if(!t.isSupported)return h;if(mn||vn(i),t.removed=[],typeof h=="string"&&(st=!1),st){if(h.nodeName){const me=B(h.nodeName);if(!N[me]||re[me])throw Qe("root node is forbidden and cannot be sanitized in-place")}}else if(h instanceof d)c=Hr("<!---->"),f=c.ownerDocument.importNode(h,!0),f.nodeType===et.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?c=f:c.appendChild(f);else{if(!Be&&!K&&!Ae&&h.indexOf("<")===-1)return b&&Dt?b.createHTML(h):h;if(c=Hr(h),!c)return Be?null:Dt?O:""}c&&hn&&se(c.firstChild);const R=Vr(st?h:c);for(;$=R.nextNode();)jr($),Kr($),$.content instanceof a&&Ba($.content);if(st)return h;if(Be){if($t)for(V=pe.call(c.ownerDocument);c.firstChild;)V.appendChild(c.firstChild);else V=c;return(F.shadowroot||F.shadowrootmode)&&(V=un.call(r,V,!0)),V}let X=Ae?c.outerHTML:c.innerHTML;return Ae&&N["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&j(wr,c.ownerDocument.doctype.name)&&(X="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
|
|
82
|
+
`+X),K&&It([nt,rt,ot],me=>{X=Ze(X,me," ")}),b&&Dt?b.createHTML(X):X},t.setConfig=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vn(h),mn=!0},t.clearConfig=function(){Ve=null,mn=!1},t.isValidAttribute=function(h,i,c){Ve||vn({});const f=B(h),$=B(i);return Yr(f,$,c)},t.addHook=function(h,i){typeof i=="function"&&Xe(U[h],i)},t.removeHook=function(h,i){if(i!==void 0){const c=Ti(U[h],i);return c===-1?void 0:wi(U[h],c,1)[0]}return br(U[h])},t.removeHooks=function(h){U[h]=[]},t.removeAllHooks=function(){U=Cr()},t}var Bi=Ar();const Ui=e=>e==null,tt=e=>!Ui(e),Wi=(e,t)=>t?t.required&&(e==null||e==="")?"Field is required":t.basicEmailValidation&&(e==null||e==="")?"Field should be email":null:null,_r=(e,t)=>t?Object.keys(t).map(o=>{const a=Wi(e[o],t[o].validations);return a?{field:o,error:a}:null},{}).filter(tt):[],Ir=e=>{const[t,n]=s.useState(0),[r,o]=s.useState([]),a=s.useCallback(async()=>{try{await yi({feedbackFormId:e.formId,link:window.location.pathname,rawHtml:Bi.sanitize(document.getElementsByTagName("html")[0]??""),domainId:e.domainId,data:e.state,formType:e.formType,viewport:{first:document.body.clientWidth,second:document.body.clientHeight},browser:{productSub:navigator.productSub,vendor:navigator.vendor,pdfViewerEnabled:navigator.pdfViewerEnabled,maxTouchPoints:navigator.maxTouchPoints,hardwareConcurrency:navigator.hardwareConcurrency,cookieEnabled:navigator.cookieEnabled,appVersion:navigator.appVersion,platform:navigator.platform,userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,webdriver:navigator.webdriver,deviceMemory:navigator.deviceMemory}})}catch(u){console.log(u)}},[e.state,e.formType]),l=s.useCallback(()=>{const u=_r(e.state,e.validationsPerStep[t]);o(u),u.length||(t<e.stepsCount-1?n(m=>m+1):a())},[e.state,e.validationsPerStep,t,a]),d=s.useCallback(()=>{t!==0&&(o([]),n(u=>u-1))},[t]);return s.useEffect(()=>{o(u=>{if(u.length){const m=_r(e.state,e.validationsPerStep[t]);if(m.length!==u.length)return m}return u})},[r,e.state,t]),{step:t,errors:r,onContinue:l,onBack:d}},Hi=S.div({marginTop:"1rem",color:"var(--color-error)",height:"20px"}),Le=({errors:e})=>{var t;return s.createElement(Hi,{children:((t=(e||[])[0])==null?void 0:t.error)??null})},Vi=S.input(({theme:e,colorVariant:t,selected:n})=>{const r=`calc(${e.sizeSelector} * 6);`,o=ce(t);return{cursor:"pointer",appearance:"none",borderRadius:"var(--radius-selector)",verticalAlign:"middle",color:"var(--color-base-content)",width:r,border:`1px solid ${o}`,height:r,flexShrink:"0",padding:".25rem",transition:"background-color .2s,box-shadow .2s",display:"inline-block",position:"relative","&::before":{content:'""',opacity:"0",clipPath:"polygon(20% 100%,20% 80%,50% 80%,50% 80%,70% 80%,70% 100%)",width:"100%",height:"100%",boxShadow:"0 3px oklch(100% 0 0/calc(var(--depth)*.1)) inset",backgroundColor:`${o}`,fontSize:"1rem",lineHeight:".75",transition:"clip-path .3s .1s,opacity .1s .1s,rotate .3s .1s,translate .3s .1s",display:"block",rotate:"45deg",...n?{clipPath:"polygon(20% 100%,20% 80%,50% 80%,50% 0%,70% 0%,70% 100%)",opacity:"1"}:{}}}}),Gi=S.label(e=>({display:"flex",fontWeight:e.selected?"500":"normal",transition:".2s ease-in-out",alignItems:"center",cursor:"pointer",gap:"calc(var(--spacing) * 2)"})),ji=e=>{const t=s.useMemo(()=>`${e.id}-${e.label.replace(/\s/g,"-").toLowerCase()}`,[]),n=o=>{e.onSelect(e.value.includes(o)?e.value.filter(a=>a!==o):[...e.value,o])},r=e.value.includes(t);return s.createElement(Gi,{selected:r,children:[s.createElement(Vi,{id:t,type:"checkbox",selected:r,colorVariant:e.colorVariant,onChange:()=>n(t),name:e.name}),s.createElement(ae,{children:e.label,linear:!0})]})},Yi=S.div`
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
width: var(--all-fields-size);
|
|
86
|
+
gap: var(--spacing);
|
|
87
|
+
@media (max-width: 900px) {
|
|
88
|
+
width: 100%;
|
|
89
|
+
}
|
|
90
|
+
`,qi=S.div`
|
|
91
|
+
display: flex;
|
|
92
|
+
gap: calc(var(--spacing) * 10);
|
|
93
|
+
@media (max-width: 900px) {
|
|
94
|
+
gap: var(--spacing);
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
}
|
|
97
|
+
`,Ki=e=>{const t=e.label.replace(/\s/g,"-").toLowerCase(),n=e.elementsPerCol||4,r=s.useMemo(()=>e.options.reduce((o,a,l)=>{var u;return(l%n===0||l===0)&&o.push([]),(u=o[o.length-1])==null||u.push(a),o},[]),[n,e.options]);return s.createElement("div",{children:[s.createElement(ae,{children:e.label,variant:"section"}),s.createElement(qi,{children:r.map((o,a)=>s.createElement(Yi,{key:a,children:o.map(l=>s.createElement(ji,{onSelect:e.onChange,colorVariant:e.colorVariant,value:e.value,id:e.formClientId,name:t,label:l.label}))}))}),s.createElement(Le,{errors:e.errors})]})},Xi=S(Me)(()=>({"&:not(:last-of-type):not(:first-of-type)":{borderRadius:"0",marginRight:"-1px",marginLeft:"-1px"},"&:first-of-type":{borderTopRightRadius:"0",borderBottomRightRadius:"0"},"&:last-of-type":{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},"@media (max-width: 900px)":{}})),Zi=e=>s.createElement(Xi,{onClick:e.onChange,$outlined:!e.selected,children:e.label}),kr=S("span")(({min:e,variant:t})=>{const n=t||ce();return{position:"absolute",left:e?"0":void 0,right:e?void 0:"0",bottom:"-2px",opacity:"0.5",fontWeight:"300",transform:"translateY(100%)",textTransform:"uppercase",color:n}}),Qi=S.div(e=>({verticalAlign:"middle",display:"inline-flex",position:"relative",marginBottom:e.withText?"calc(var(--spacing) * 6)":"0"})),Ji=e=>s.createElement("div",{children:[s.createElement(ae,{children:e.label,variant:"section"}),s.createElement(Qi,{withText:e.maxText||e.minText,children:[e.maxText?s.createElement(kr,{min:!1,children:e.maxText}):null,e.minText?s.createElement(kr,{min:!0,children:e.minText}):null,Array(e.max).fill(1).map((t,n)=>s.createElement(Zi,{onChange:()=>e.onChange(n+1),selected:n+1===e.value,key:`${n}`,label:`${n+1}`}))]}),s.createElement(Le,{errors:e.errors})]}),ea=S.input(({theme:e,selected:t,colorVariant:n})=>{const r=`calc(${e.sizeSelector} * 6);`,o=ce(n);return{width:r,height:r,color:e.neutral,margin:"0",cursor:"pointer",appearance:"none",verticalAlign:"middle",borderRadius:"3.40282e38px",border:`1px solid ${o}`,flexShrink:"0",padding:t?".25rem":"0.4rem",transition:".2s ease-in-out",display:"inline-block",position:"relative",boxSizing:"border-box","&::before":{content:'""',borderRadius:"3.40282e38px",background:t?o:"transparent",width:"100%",height:"100%",display:"block"}}}),ta=S.label(e=>({display:"flex",fontWeight:e.selected?"500":"normal",transition:".2s ease-in-out",alignItems:"center",cursor:"pointer",gap:"calc(var(--spacing) * 2)"})),na=e=>{const t=s.useMemo(()=>`${e.id}-${e.label.replace(/\s/g,"-").toLowerCase()}`,[e.id]),n=o=>{e.onSelect(o)},r=e.value===t;return s.createElement(ta,{selected:r,htmlFor:t,children:[s.createElement(ea,{id:t,type:"radio",variant:e.colorVariant,selected:r,onChange:()=>n(t),name:e.name}),s.createElement(ae,{children:e.label,linear:!0})]})},ra=S.div`
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
width: var(--all-fields-size);
|
|
101
|
+
gap: var(--spacing);
|
|
102
|
+
@media (max-width: 900px) {
|
|
103
|
+
width: 100%;
|
|
104
|
+
}
|
|
105
|
+
`,oa=S.div`
|
|
106
|
+
display: flex;
|
|
107
|
+
gap: calc(var(--spacing) * 10);
|
|
108
|
+
@media (max-width: 900px) {
|
|
109
|
+
gap: var(--spacing);
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
}
|
|
112
|
+
`,ia=e=>{const t=e.elementsPerCol||4,n=s.useMemo(()=>e.options.reduce((r,o,a)=>{var d;return(a%t===0||a===0)&&r.push([]),(d=r[r.length-1])==null||d.push(o),r},[]),[t,e.options]);return s.createElement("div",{children:[s.createElement(ae,{children:e.label,variant:"section"}),s.createElement(oa,{children:n.map(r=>s.createElement(ra,{children:r.map(o=>s.createElement(na,{colorVariant:e.colorVariant,onSelect:e.onChange,value:e.value,id:e.formClientId,name:`${o.id}-${e.formClientId}`,label:o.label}))}))}),s.createElement(Le,{errors:e.errors})]})},aa=S.input(e=>{const t=ce(e.colorVariant);return{cursor:"text",border:`var(--border-width)solid ${t}`,appearance:"none",backgroundColor:"var(--color-base-100)",verticalAlign:"middle",whiteSpace:"nowrap",width:"clamp(3rem,30rem,100%)",height:"calc(var(--size-field, .25rem) * 10)",fontSize:"max(var(--font-size,.875rem),.875rem)",touchAction:"manipulation",borderColor:t,borderStartStartRadius:"var(--join-ss,var(--radius-field))",borderStartEndRadius:"var(--join-se,var(--radius-field))",borderEndEndRadius:"var(--join-ee,var(--radius-field))",borderEndStartRadius:"var(--join-es,var(--radius-field))",alignItems:"center",boxSizing:"border-box",paddingInline:".75rem","&:focus":{outline:`2px solid ${t}`,outlineOffset:"3px",isolation:"isolate"}}}),sa=S.input(e=>{const n=ce(e.colorVariant);return{cursor:"pointer",flex:"1",verticalAlign:"middle","--radius-selector-max":"calc(var(--radius-selector) + var(--radius-selector) + var(--radius-selector))",borderRadius:"calc(var(--radius-selector) + min(var(--range-p),var(--radius-selector-max)))",height:"var(--range-thumb-size)",backgroundColor:"#0000",border:"none",overflow:"hidden",appearance:"none",webkitAppearance:"none",margin:"0","--range-thumb":"var(--color-base-100)","--range-thumb-size":"calc(var(--size-selector,.25rem)*6)","--range-progress":n,"--range-fill":"1","--range-p":".25rem","--range-bg":n,font:"inherit",fontFeatureSettings:"inherit",fontVariationSettings:"inherit",letterSpacing:"inherit",color:"inherit",opacity:"1","&::-webkit-slider-runnable-track":{backgroundColor:"var(--range-bg)",borderRadius:"var(--radius-selector)",width:"100%",height:"calc(var(--range-thumb-size)*.5)","--range-bg":"color-mix(in oklab,currentColor 10%,#0000)"},"&::-webkit-slider-thumb":{boxSizing:"border-box",borderRadius:"calc(var(--radius-selector) + min(var(--range-p),var(--radius-selector-max)))",height:"var(--range-thumb-size)",width:"var(--range-thumb-size)",border:"var(--range-p)solid",appearance:"none",webkitAppearance:"none",color:"var(--range-progress)",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))",backgroundColor:n,position:"relative",top:"50%",transform:"translateY(-50%)"}}}),la=S.div`
|
|
113
|
+
width: clamp(3rem, 30rem, 100%);
|
|
114
|
+
`,ca=S(aa)`
|
|
115
|
+
width: calc(var(--size-field) * 15);
|
|
116
|
+
`,ua=S.div`
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: calc(var(--spacing) * 2);
|
|
120
|
+
`,da=e=>{var o;const t=e.min||0,n=e.max||100,r=a=>{const l=Number.parseInt(a.target.value);Number.isNaN(l)?console.error("RangeSlide must be a number"):e.onChange(l)};return s.useEffect(()=>{e.onChange(e.value||e.initialValue||0)},[]),s.createElement(la,{children:[s.createElement(ae,{children:e.label,variant:"section"}),s.createElement(ua,{children:[s.createElement(sa,{type:"range",min:t,max:n,useThemeColors:e.colorVariant,value:e.value,onChange:r}),s.createElement(ca,{type:"number",value:((o=e.value)==null?void 0:o.toString())??"",max:n,min:t,colorVariant:e.colorVariant,onChange:a=>e.onChange(+a.target.value)})]}),s.createElement(Le,{errors:e.errors})]})},fa={heart:encodeURIComponent('<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>'),star:encodeURIComponent('<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>'),star2:encodeURIComponent('<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>')},Or={small:"1rem",medium:"1.5rem",large:"2rem"},ma=S.input(e=>{const t=fa[e.icon??"star2"],n=ce(e.colorVariant);return{maskImage:`url(data:image/svg+xml,${t})`,backgroundColor:n,appearance:"none",transform:e.selected?"scale(1.1)":"scale(1)",transition:"transform 0.3s",border:"none",opacity:e.selected?"1":.2,verticalAlign:"middle",display:"inline-block",WebkitMaskPosition:"50%",maskPosition:"50%",cursor:"pointer",WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",borderRadius:"0",width:Or[e.size??"medium"],height:Or[e.size??"medium"]}}),ha=S.div(()=>({verticalAlign:"middle",position:"relative"})),pa=({value:e,max:t,errors:n,label:r,onChange:o})=>s.createElement(ha,{value:1,max:5,children:[s.createElement(ae,{variant:"section",children:r}),Array(t).fill(1).map((a,l)=>s.createElement(ma,{selected:l<e,name:`rating-${l+1}`,key:`${l}`,onChange:()=>{o(l+1)},type:"radio"})),s.createElement(Le,{errors:n})]}),ga=S.div`
|
|
121
|
+
width: 100%;
|
|
122
|
+
`,ba=S.textarea(e=>{const t=ce(e.colorVariant);return{border:"var(--border-width)solid #0000",appearance:"none",borderRadius:"var(--radius-field)",backgroundColor:"var(--color-base-100)",verticalAlign:"middle",width:"clamp(3rem,30rem,100%)",maxWidth:"100%",minWidth:"3rem",minHeight:"5rem",fontSize:"max(var(--font-size,.875rem),.875rem)",touchAction:"manipulation",borderColor:t,flexShrink:"1",paddingBlock:".5rem",boxSizing:"border-box",paddingInline:".75rem","&:focus":{outline:`2px solid ${t}`,outlineOffset:"3px",isolation:"isolate"}}}),ya=e=>{const t=n=>e.onChange(n.target.value);return s.createElement(ga,{children:[s.createElement(ae,{variant:"section",children:e.label}),s.createElement(ba,{value:e.value??"",useThemeColors:e.colorVariant,rows:e.rows??3,onChange:t}),s.createElement(Le,{errors:e.errors})]})},va=S.div`
|
|
123
|
+
width: 100%;
|
|
124
|
+
`,Pt=e=>e!=null,Ea=(e,t)=>(r=>{if(!r)return e.default;const o=r.find(a=>a.conditions.every(l=>{const d=t(l.fieldName);if(!Pt(d))return!1;const u=[];return Pt(l.eq)?l.eq===d?u.push(!0):u.push(!1):Pt(l.lessThan)?l.lessThan>d?u.push(!0):u.push(!1):Pt(l.moreThan)&&(l.moreThan<d?u.push(!0):u.push(!1)),u.every(Boolean)}));return(o==null?void 0:o.value)??e.default})(e.values),Pr=e=>{const t=()=>{const n=a=>e.setStateByKey(e.dataField,a),r=Ea(e.fieldProps.label,e.getStateByKey),o={formClientId:e.formClientId,label:r,errors:e.errors,onChange:n,value:e.getStateByKey(e.dataField),key:`${e.type}-${e.fieldProps.label}-${e.fieldProps.meta.name}`};switch(e.type){case"matrix":{const a=e.fieldProps;return s.createElement(Ji,{...a,...o,max:10})}case"radio-group":{const a=e.fieldProps;return s.createElement(ia,{...a,...o})}case"checkbox-group":{const a=e.fieldProps;return s.createElement(Ki,{...a,...o})}case"range-slide":{const a=e.fieldProps;return s.createElement(da,{...a,...o})}case"rating":{const a=e.fieldProps;return s.createElement(pa,{...a,...o})}case"textarea":{const a=e.fieldProps;return s.createElement(ya,{...a,...o})}default:return null}};return s.createElement(va,{children:t()})},Sa=S.div({position:"relative",fontSize:"var(--font-size)"}),Ta=S.div`
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: space-between;
|
|
128
|
+
margin-top: calc(var(--spacing) * 10);
|
|
129
|
+
`,wa=e=>{const t=s.useMemo(()=>Math.random().toString(36).substring(2,10),[]),[n,r]=s.useState(null),o=d=>{r(u=>!u||u<d?d:u)},a=mr({form:e.inlineForm.form,formId:e.formId,domainId:e.domainId}),l=Ir({domainId:e.domainId,formType:"inlineForm",stepsCount:a.steps.length,validationsPerStep:a.validationsPerStep,formId:e.formId,state:a.state});return s.createElement(Sa,{children:[e.inlineForm.config.formTitle&&s.createElement(ae,{variant:"title",children:e.inlineForm.config.formTitle}),a.steps.map((d,u)=>{var m;return s.createElement(dr,{key:u+`${(m=d.meta)==null?void 0:m.name}`,height:n,onSetMaxHeight:o,isVisible:u===l.step,children:d.fields.map(p=>s.createElement(Pr,{type:p.type,fieldProps:p,dataField:p.dataField,formClientId:t,onContinue:l.onContinue,errors:l.errors.filter(T=>T.field===p.dataField),getStateByKey:a.getStateByKey,setStateByKey:a.setStateByKey}))})}),s.createElement(Ta,{children:[s.createElement(Me,{children:"Back",disabled:l.step===0,onClick:l.onBack}),s.createElement(fr,{steps:a.steps,currentStepIndex:l.step}),s.createElement(Me,{children:"Continue",onClick:l.onContinue})]})]})},xa=S.div(e=>({backgroundColor:"var(--color-base-100)",borderTopLeftRadius:"var(--modal-tl,var(--radius-box))",borderTopRightRadius:"var(--modal-tr,var(--radius-box))",borderBottomLeftRadius:"var(--modal-bl,var(--radius-box))",borderBottomRightRadius:"var(--modal-br,var(--radius-box))",opacity:e.$visible?"1":"0",overscrollBehavior:"contain",gridRowStart:"1",gridColumnStart:"1",width:"91.6667%",maxWidth:"1080px",margin:"auto",maxHeight:"100vh",padding:"1.5rem",transition:"translate .3s ease-out,scale .3s ease-out,opacity .2s ease-out 50ms,box-shadow .3s ease-out",overflowY:"auto",scale:"95%",boxShadow:"0 25px 50px -12px #00000040","@media (max-width: 900px)":{maxWidth:"initial",width:"auto"}})),Ca=S.div(()=>({})),Aa=S.dialog(({$visible:e})=>({pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden",width:"100%",maxWidth:"none",height:"100%",maxHeight:"none",color:"inherit",transition:"visibility .3s allow-discrete,background-color .3s ease-out,opacity .1s ease-out",overscrollBehavior:"contain",zIndex:"99",scrollbarGutter:"auto",backgroundColor:e?"#0006":"#0000",placeItems:"center",margin:"0",padding:"0",display:"grid",position:"fixed",overflow:"clip",top:0,border:0,outline:0})),_a=e=>{const t=s.useRef(null),n=Math.random().toString(36).substring(2,16),r=s.useCallback(a=>{a.target===t.current&&e.onClose(),a.preventDefault(),a.stopPropagation()},[e]),o=s.useCallback(a=>{a.key==="Escape"&&e.onClose(),a.preventDefault()},[]);return s.useEffect(()=>{t.current&&e.isOpen?t.current.show():t.current&&!e.isOpen&&t.current.close()},[t,e.isOpen]),s.useEffect(()=>(document.addEventListener("keyup",o),()=>{document.removeEventListener("keyup",o)}),[]),s.createElement(Aa,{$visible:e.isOpen,onClick:r,ref:t,id:n,children:s.createElement(xa,{$visible:e.isOpen,children:[s.createElement(ae,{children:e.heading,variant:"title"}),e.children,s.createElement(Ca,{children:e.footer})]})})},Ia=S.div`
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
margin-top: calc(var(--spacing) * 10);
|
|
134
|
+
`,ka=S(Me)`
|
|
135
|
+
position: fixed;
|
|
136
|
+
width: fit-content;
|
|
137
|
+
height: fit-content;
|
|
138
|
+
transform: rotate(-90deg) translateY(calc(100% - 15px));
|
|
139
|
+
padding: 10px 20px 30px 20px;
|
|
140
|
+
margin: auto;
|
|
141
|
+
left: ${e=>tt(e.$left)?`${e.$left}px`:null};
|
|
142
|
+
right: ${e=>tt(e.$right)?`${e.$right}px`:null};
|
|
143
|
+
top: ${e=>tt(e.$top)?`${e.$top}px`:null};
|
|
144
|
+
bottom: ${e=>tt(e.$bottom)?`${e.$bottom}px`:null};
|
|
145
|
+
&:active {
|
|
146
|
+
transform: rotate(-90deg) translateY(calc(100% - 18px));
|
|
147
|
+
}
|
|
148
|
+
`,Oa=e=>{const[t,n]=s.useState(!1),[r,o]=s.useState(null),a=s.useMemo(()=>Math.random().toString(36).substring(2,10),[]),l=m=>{o(p=>!p||p<m?m:p)},d=mr({form:e.popupForm.form,formId:e.formId,domainId:e.domainId}),u=Ir({domainId:e.domainId,formType:"inlineForm",stepsCount:d.steps.length,validationsPerStep:d.validationsPerStep,formId:e.formId,state:d.state});return s.createElement(s.Fragment,{children:[s.createElement(ka,{children:e.popupForm.config.buttonText,onClick:()=>n(!0),$left:e.popupForm.styles.left??null,$right:e.popupForm.styles.right??null,$top:e.popupForm.styles.top??null,$bottom:e.popupForm.styles.bottom??null}),s.createElement(_a,{onClose:()=>n(!1),heading:e.popupForm.config.formTitle,isOpen:t,footer:s.createElement(Ia,{children:[s.createElement(Me,{children:"Back",disabled:u.step===0,onClick:u.onBack}),s.createElement(fr,{steps:d.steps,currentStepIndex:u.step}),s.createElement(Me,{children:"Continue",onClick:u.onContinue})]}),children:d.steps.map((m,p)=>{var T;return s.createElement(dr,{key:p+`${(T=m.meta)==null?void 0:T.name}`,height:r,onSetMaxHeight:l,isVisible:p===u.step,children:m.fields.map(w=>s.createElement(Pr,{type:w.type,fieldProps:w,formClientId:a,dataField:w.dataField,onContinue:u.onContinue,errors:u.errors.filter(E=>E.field===w.dataField),getStateByKey:d.getStateByKey,setStateByKey:d.setStateByKey}))})})})]})},Nr=e=>{e.locale;let{data:t,loading:n,error:r}=ui(()=>ci({formId:e.formId}));const o=s.useMemo(()=>t!=null&&t.inlineForm?s.createElement(wa,{key:`inline-form-${e.formId}`,formId:e.formId,domainId:t.domainId,formTheme:t.attributes.theme,inlineForm:t.inlineForm}):null,[t==null?void 0:t.attributes.theme,t==null?void 0:t.domainId,t==null?void 0:t.inlineForm,e.formId]),a=s.useMemo(()=>t!=null&&t.popupForm?s.createElement(Oa,{key:`popup-form-${e.formId}`,formId:e.formId,domainId:t.domainId,formTheme:t.attributes.theme,popupForm:t.popupForm}):null,[t==null?void 0:t.attributes.theme,t==null?void 0:t.domainId,t==null?void 0:t.inlineForm,e.formId]);return!t&&n?"Loading...":!t||r?r?r.message:"Unknown error":s.createElement(si,{theme:t.attributes.theme,selectedVariant:t.attributes.variant,children:[o,a]})},Pa=e=>{if(!e){console.error("options must be provided. Feedback module deactivated");return}if(!e.formId){console.error("formId must be provided. Feedback module deactivated");return}const t=eo.createRoot(e.container||document);typeof window<"u"&&t.render(s.createElement(Nr,{formId:e.formId}))},$r=e=>e?e.formId?typeof window>"u"?null:s.createElement(Nr,{formId:e.formId}):(console.error("formId must be provided. Feedback module deactivated"),null):(console.error("options must be provided. Feedback module deactivated"),null),Na=e=>$r(e);return je.FeedbackModule=Na,je.initiateFeedbackModule=Pa,je.renderFeedbackModule=$r,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"}),je})({},React,require$$0);
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@web-site-utilities/feedback",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"workspaces": [
|
|
5
|
+
"src/**",
|
|
6
|
+
"examples/**"
|
|
7
|
+
],
|
|
8
|
+
"description": "Site utils feedback snippet deployed to npm and external script",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.es.js",
|
|
12
|
+
"require": "./dist/index.cjs.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.cjs.js",
|
|
16
|
+
"module": "./dist/index.es.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"tsconfig.json"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"typecheck": "tsc",
|
|
26
|
+
"build-lib": "vite build -c vite.build.ts",
|
|
27
|
+
"build-types": "tsc --declarationDir dist --noEmit false --emitDeclarationOnly",
|
|
28
|
+
"build": "npm run build-lib && npm run build-types",
|
|
29
|
+
"dev": "vite -c vite.build.ts",
|
|
30
|
+
"examples-npm-start": "npm -w @site-utils/feedback-ui-example-npm run start"
|
|
31
|
+
},
|
|
32
|
+
"author": "zabedovskiya@gmail.com",
|
|
33
|
+
"license": "AGPL-3.0-or-later",
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^9.35.0",
|
|
36
|
+
"@types/node": "^24.5.0",
|
|
37
|
+
"@types/react": "^19.1.13",
|
|
38
|
+
"@types/react-dom": "^19.1.9",
|
|
39
|
+
"@types/styled-components": "^5.1.34",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
41
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
42
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
43
|
+
"eslint": "^8.57.1",
|
|
44
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
45
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
46
|
+
"eslint-config-prettier": "^10.1.8",
|
|
47
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
48
|
+
"eslint-plugin-import": "^2.32.0",
|
|
49
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
50
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
51
|
+
"eslint-plugin-react": "^7.37.5",
|
|
52
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
53
|
+
"globals": "^16.4.0",
|
|
54
|
+
"path": "^0.12.7",
|
|
55
|
+
"prettier": "^3.6.2",
|
|
56
|
+
"react": "18.3.1",
|
|
57
|
+
"react-dom": "18.3.1",
|
|
58
|
+
"styled-components": "6.1.19",
|
|
59
|
+
"typescript": "^5.9.2",
|
|
60
|
+
"vite": "^6.3.6"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"react": "18",
|
|
64
|
+
"react-dom": "18",
|
|
65
|
+
"styled-components": "6.1.19"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"dompurify": "^3.2.7",
|
|
69
|
+
"vite-plugin-dts": "^4.5.4"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["DOM", "ES2024"],
|
|
4
|
+
"types": ["react", "node"],
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"module": "CommonJS",
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"allowUnusedLabels": false,
|
|
12
|
+
"allowUnreachableCode": false,
|
|
13
|
+
"exactOptionalPropertyTypes": true,
|
|
14
|
+
"noFallthroughCasesInSwitch": true,
|
|
15
|
+
"noImplicitOverride": true,
|
|
16
|
+
"noImplicitReturns": true,
|
|
17
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
18
|
+
"noUncheckedIndexedAccess": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"skipLibCheck": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["src", "src/"],
|
|
26
|
+
"exclude": [
|
|
27
|
+
"vite.build.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|