@sprig-technologies/sprig-browser 2.21.0 → 2.21.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/dist/index.cjs +686 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6415 -0
- package/dist/sprig-browser/index.d.ts +168 -0
- package/dist/src/constants/css.d.ts +43 -0
- package/dist/src/constants/sprigEvents.d.ts +62 -0
- package/dist/src/constants/sprigRecordingEvents.d.ts +40 -0
- package/dist/src/controller/OptimizelyIntegration.d.ts +40 -0
- package/dist/src/controller/Queue.d.ts +18 -0
- package/dist/src/controller/controller.d.ts +9 -0
- package/dist/src/controller/iframe.d.ts +17 -0
- package/dist/src/helpers/Deferred.d.ts +9 -0
- package/dist/src/helpers/conflicting_widgets/index.d.ts +4 -0
- package/dist/src/helpers/conflicting_widgets/intercom.d.ts +2 -0
- package/dist/src/helpers/document.d.ts +6 -0
- package/dist/src/helpers/eventEmitter.d.ts +85 -0
- package/dist/src/helpers/general.d.ts +9 -0
- package/dist/src/helpers/network.d.ts +15 -0
- package/dist/src/types/card.d.ts +297 -0
- package/dist/src/types/config.d.ts +233 -0
- package/dist/src/types/event.d.ts +18 -0
- package/dist/src/types/global.d.ts +253 -0
- package/dist/src/view/app.d.ts +3 -0
- package/dist/src/view/cards/consentLegalCard.d.ts +6 -0
- package/dist/src/view/cards/index.d.ts +10 -0
- package/dist/src/view/cards/likertCard/index.d.ts +1 -0
- package/dist/src/view/cards/likertCard/likertCard.d.ts +6 -0
- package/dist/src/view/cards/likertCard/likertOption.d.ts +16 -0
- package/dist/src/view/cards/multipleChoice/baseMultiChoiceCard.d.ts +15 -0
- package/dist/src/view/cards/multipleChoice/index.d.ts +2 -0
- package/dist/src/view/cards/multipleChoice/multiSelectCard.d.ts +5 -0
- package/dist/src/view/cards/multipleChoice/singleSelectCard.d.ts +5 -0
- package/dist/src/view/cards/npsCard.d.ts +8 -0
- package/dist/src/view/cards/openTextCard.d.ts +6 -0
- package/dist/src/view/cards/recordedTask/actions.d.ts +21 -0
- package/dist/src/view/cards/recordedTask/card.d.ts +5 -0
- package/dist/src/view/cards/recordedTask/components.d.ts +30 -0
- package/dist/src/view/cards/recordedTask/constants.d.ts +5 -0
- package/dist/src/view/cards/recordedTask/helpers.d.ts +6 -0
- package/dist/src/view/cards/recordedTask/index.d.ts +1 -0
- package/dist/src/view/cards/recordedTask/store.d.ts +24 -0
- package/dist/src/view/cards/textUrlPromptCard.d.ts +6 -0
- package/dist/src/view/cards/thanksCard.d.ts +5 -0
- package/dist/src/view/cards/types.d.ts +34 -0
- package/dist/src/view/cards/uploadingCard.d.ts +5 -0
- package/dist/src/view/cards/videoVoiceCard.d.ts +6 -0
- package/dist/src/view/components/button.d.ts +3 -0
- package/dist/src/view/components/header.d.ts +8 -0
- package/dist/src/view/components/index.d.ts +4 -0
- package/dist/src/view/components/mobileEmbedView.d.ts +16 -0
- package/dist/src/view/components/option.d.ts +22 -0
- package/dist/src/view/footer.d.ts +2 -0
- package/dist/src/view/helpers/card.d.ts +6 -0
- package/dist/src/view/helpers/getAttributedUrl.d.ts +6 -0
- package/dist/src/view/helpers/skipLogicHelpers.d.ts +34 -0
- package/dist/src/view/hooks/index.d.ts +1 -0
- package/dist/src/view/hooks/useAutoSize.d.ts +2 -0
- package/dist/src/view/logo.d.ts +5 -0
- package/dist/src/view/recorder/recorder.d.ts +2 -0
- package/dist/src/view/store.d.ts +2 -0
- package/dist/src/view/view.d.ts +6 -0
- package/dist/style.css +1 -0
- package/package.json +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,686 @@
|
|
|
1
|
+
"use strict";var Zo=Object.defineProperty;var Yo=(e,t,n)=>t in e?Zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var se=(e,t,n)=>(Yo(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var fe=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.PageChange="page.change",e.API="api",e.Override="override",e))(fe||{}),N=(e=>(e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e))(N||{}),or=(e=>(e.SurveyId="survey.id",e))(or||{});const Xt={SDK_READY:"sdk.ready",SURVEY_APPEARED:"survey.appeared",SURVEY_CLOSED:"survey.closed",SURVEY_DIMENSIONS:"survey.dimensions",SURVEY_FADING_OUT:"survey.fadingOut",SURVEY_HEIGHT:"survey.height",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",CLOSE_SURVEY_ON_OVERLAY_CLICK:"close.survey.overlayClick",VISITOR_ID_UPDATED:"visitor.id.updated",DATA:{DISMISS_REASONS:{API:"api",CLOSED:"close.click",COMPLETE:"survey.completed",PAGE_CHANGE:"page.change",OVERRIDE:"override"},SURVEY_ID:"survey.id"}};var X=(e=>(e.VerifyViewVersion="verify.view.version",e.CurrentQuestion="survey.question",e.ViewPrototypeClick="question.prototype.click",e.ViewAgreementClick="question.agreement.click",e.RecordedTaskStart="recorded.task.start",e.RecordedTaskPermissionScreen="recorded.task.permission.screen",e.SurveyComplete="survey.complete",e))(X||{}),Te=(e=>(e.ViewVersion="view.version",e.QuestionId="qid",e.Props="props",e))(Te||{});let lt;const Ko=new Uint8Array(16);function Qo(){if(!lt&&(lt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lt(Ko)}const G=[];for(let e=0;e<256;++e)G.push((e+256).toString(16).slice(1));function Jo(e,t=0){return(G[e[t+0]]+G[e[t+1]]+G[e[t+2]]+G[e[t+3]]+"-"+G[e[t+4]]+G[e[t+5]]+"-"+G[e[t+6]]+G[e[t+7]]+"-"+G[e[t+8]]+G[e[t+9]]+"-"+G[e[t+10]]+G[e[t+11]]+G[e[t+12]]+G[e[t+13]]+G[e[t+14]]+G[e[t+15]]).toLowerCase()}const Xo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gn={randomUUID:Xo};function _t(e,t,n){if(gn.randomUUID&&!t&&!e)return gn.randomUUID();e=e||{};const r=e.random||(e.rng||Qo)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return Jo(r)}const Ne="ul-app";var b=(e=>(e.Caption="ul-caption",e.CardContainer="ul-card__container",e.CardMainContent="ul-card-main-content",e.Choice="choice",e.ChoiceCheckbox="select-checkbox",e.ChoiceGroup="ul-card__choices",e.ChoiceLabel="select-label",e.ChoiceLabelContainer="choice-label-container",e.ChoiceRadio="select-radio",e.ChoiceTextEntryContainer="choice-text-entry-container",e.ChoiceTextInput="choice-text-input",e.CloseButton="close-btn",e.CloseContainer="close-container",e.ConsentLegalNameInput="ul-consent-legal__name-input",e.CustomStyle="ul-custom-style",e.DesktopSuffix="--desktop",e.FadeInTransition="fade-in-transition",e.LikertNumber="likert-number",e.LikertSmiley="likert-smiley",e.LikertStar="likert-star",e.LoadingSpinner="ul-loading-spinner",e.LoadingSpinnerContainer="ul-loading-spinner-container",e.LoadingSpinnerFirst="first",e.LoadingSpinnerFourth="fourth",e.LoadingSpinnerSecond="second",e.LoadingSpinnerThird="third",e.MobileSuffix="--mobile",e.NPSNumber="nps-number",e.OpenTextInput="ul-card-text__input",e.QuestionHeader="ul-question",e.VideoCard="ul-card--video",e.CheckmarkButton="ul-button-checkmark",e.InactiveButton="ul-button-inactive",e.LeftAlignButton="ul-button-left-align",e.ButtonDisabled="sprig-button-disabled",e))(b||{});const en="#e6e6e6",Ke="#bd282a",ei=500,ti=1030,ir=()=>{try{return window.parent.Intercom}catch(e){return console.error(e),null}},ni=()=>{const e=ir();!e||(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)},ri=()=>{const e=ir();!e||(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},oi=Object.freeze(Object.defineProperty({__proto__:null,enable:ni,disable:ri},Symbol.toStringTag,{value:"Module"})),_n=[oi];class Ft{static disable(){_n.forEach(t=>t.disable())}static enable(){_n.forEach(t=>t.enable())}}const ii=1,He=e=>e instanceof HTMLElement,si=e=>e instanceof HTMLInputElement,Qe=e=>e instanceof HTMLTextAreaElement,sr=(e,t,n)=>{const r=e.createElement("style");n&&(r.nonce=n),r.textContent=t,r.id=b.CustomStyle,e.head.appendChild(r)},ar=e=>{const t=e.querySelector(`.${b.CardContainer}`),n=t?t.scrollHeight:600,r=t&&t.parentElement?t.parentElement.clientHeight-t.clientHeight:0;return n+r+ii},ai=e=>{const t=e.querySelector(`.${b.CardContainer}`);t&&(t.scrollTop=0)};var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ci(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var lr={},Et={},tn={exports:{}},Me=typeof Reflect=="object"?Reflect:null,wn=Me&&typeof Me.apply=="function"?Me.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},dt;Me&&typeof Me.ownKeys=="function"?dt=Me.ownKeys:Object.getOwnPropertySymbols?dt=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:dt=function(t){return Object.getOwnPropertyNames(t)};function di(e){console&&console.warn&&console.warn(e)}var cr=Number.isNaN||function(t){return t!==t};function H(){H.init.call(this)}tn.exports=H;tn.exports.once=mi;H.EventEmitter=H;H.prototype._events=void 0;H.prototype._eventsCount=0;H.prototype._maxListeners=void 0;var yn=10;function Lt(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(H,"defaultMaxListeners",{enumerable:!0,get:function(){return yn},set:function(e){if(typeof e!="number"||e<0||cr(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");yn=e}});H.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};H.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||cr(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function dr(e){return e._maxListeners===void 0?H.defaultMaxListeners:e._maxListeners}H.prototype.getMaxListeners=function(){return dr(this)};H.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var o=t==="error",i=this._events;if(i!==void 0)o=o&&i.error===void 0;else if(!o)return!1;if(o){var s;if(n.length>0&&(s=n[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(c===void 0)return!1;if(typeof c=="function")wn(c,this,n);else for(var d=c.length,l=hr(c,d),r=0;r<d;++r)wn(l[r],this,n);return!0};function ur(e,t,n,r){var o,i,s;if(Lt(n),i=e._events,i===void 0?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),s===void 0)s=i[t]=n,++e._eventsCount;else if(typeof s=="function"?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),o=dr(e),o>0&&s.length>o&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,di(a)}return e}H.prototype.addListener=function(t,n){return ur(this,t,n,!1)};H.prototype.on=H.prototype.addListener;H.prototype.prependListener=function(t,n){return ur(this,t,n,!0)};function ui(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function pr(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=ui.bind(r);return o.listener=n,r.wrapFn=o,o}H.prototype.once=function(t,n){return Lt(n),this.on(t,pr(this,t,n)),this};H.prototype.prependOnceListener=function(t,n){return Lt(n),this.prependListener(t,pr(this,t,n)),this};H.prototype.removeListener=function(t,n){var r,o,i,s,a;if(Lt(n),o=this._events,o===void 0)return this;if(r=o[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){a=r[s].listener,i=s;break}if(i<0)return this;i===0?r.shift():pi(r,i),r.length===1&&(o[t]=r[0]),o.removeListener!==void 0&&this.emit("removeListener",t,a||n)}return this};H.prototype.off=H.prototype.removeListener;H.prototype.removeAllListeners=function(t){var n,r,o;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i=Object.keys(r),s;for(o=0;o<i.length;++o)s=i[o],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(o=n.length-1;o>=0;o--)this.removeListener(t,n[o]);return this};function fr(e,t,n){var r=e._events;if(r===void 0)return[];var o=r[t];return o===void 0?[]:typeof o=="function"?n?[o.listener||o]:[o]:n?fi(o):hr(o,o.length)}H.prototype.listeners=function(t){return fr(this,t,!0)};H.prototype.rawListeners=function(t){return fr(this,t,!1)};H.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):mr.call(e,t)};H.prototype.listenerCount=mr;function mr(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}H.prototype.eventNames=function(){return this._eventsCount>0?dt(this._events):[]};function hr(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function pi(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function fi(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function mi(e,t){return new Promise(function(n,r){function o(s){e.removeListener(t,i),r(s)}function i(){typeof e.removeListener=="function"&&e.removeListener("error",o),n([].slice.call(arguments))}vr(e,t,i,{once:!0}),t!=="error"&&hi(e,o,{once:!0})})}function hi(e,t,n){typeof e.on=="function"&&vr(e,"error",t,n)}function vr(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function o(i){r.once&&e.removeEventListener(t,o),n(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var vi=be&&be.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gi=be&&be.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};Et.__esModule=!0;Et.StrictEventEmitter=void 0;var _i=tn.exports,wi=function(e){vi(t,e);function t(){return e.call(this)||this}return t.prototype.on=function(n,r){return e.prototype.on.call(this,n.toString(),r)},t.prototype.once=function(n,r){return e.prototype.once.call(this,n.toString(),r)},t.prototype.off=function(n,r){return e.prototype.off.call(this,n.toString(),r)},t.prototype.emit=function(n){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e.prototype.emit.apply(this,gi([n.toString()],r))},t.prototype.addListener=function(n,r){return e.prototype.addListener.call(this,n.toString(),r)},t.prototype.prependListener=function(n,r){return e.prototype.prependListener.call(this,n.toString(),r)},t.prototype.prependOnceListener=function(n,r){return e.prototype.prependOnceListener.call(this,n.toString(),r)},t.prototype.removeListener=function(n,r){return e.prototype.removeListener.call(this,n.toString(),r)},t.prototype.removeAllListeners=function(n){return n?e.prototype.removeAllListeners.call(this,n.toString()):e.prototype.removeAllListeners.call(this)},t.prototype.eventNames=function(){return e.prototype.eventNames.call(this)},t.prototype.listeners=function(n){return e.prototype.listeners.call(this,n.toString())},t.prototype.rawListeners=function(n){return e.prototype.rawListeners.call(this,n.toString())},t.prototype.listenerCount=function(n){return e.prototype.listenerCount.call(this,n.toString())},t}(_i.EventEmitter);Et.StrictEventEmitter=wi;(function(e){var t=be&&be.__createBinding||(Object.create?function(r,o,i,s){s===void 0&&(s=i),Object.defineProperty(r,s,{enumerable:!0,get:function(){return o[i]}})}:function(r,o,i,s){s===void 0&&(s=i),r[s]=o[i]}),n=be&&be.__exportStar||function(r,o){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,r,i)};e.__esModule=!0,n(Et,e)})(lr);const V=new lr.StrictEventEmitter;var Ye=(e=>(e.BottomLeft="bottomLeft",e.BottomRight="bottomRight",e.Center="center",e.TopLeft="topLeft",e.TopRight="topRight",e))(Ye||{}),le=(e=>(e.Error="x-ul-error",e.EnvironmentID="x-ul-environment-id",e.InstallationMethod="x-ul-installation-method",e.PartnerAnonymousId="x-ul-anonymous-id",e.Platform="userleap-platform",e.PreviewMode="x-ul-preview-mode",e.UserID="x-ul-user-id",e.VisitorID="x-ul-visitor-id",e))(le||{}),je=(e=>(e.Email="email",e.Link="link",e.Web="web",e))(je||{}),Se=(e=>(e.Npm="web-npm",e.Gtm="web-gtm",e.Segment="web-segment",e.Snippet="web-snippet",e))(Se||{});const wt=e=>new Promise(t=>{setTimeout(()=>{t()},e)}),Ve=({"userleap-platform":e})=>e!==je.Web,q=(e,t)=>{const n=t?b.MobileSuffix:b.DesktopSuffix;return[e+n,e]},ue=(e,t)=>[e,`${e}__${t}`];class yi{constructor(t){se(this,"payload");se(this,"promise");se(this,"reject",()=>{});se(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((n,r)=>{this.reject=r,this.resolve=n})}resolveRequest(t){this.resolve(t)}}const bi={RATELIMIT_RESET_DEFAULT:10};let gr=!1,_r="",ct=!1,ut=[];const xi=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?Se.Gtm:e._segment?Se.Segment:Se.Snippet,zt=(e="")=>{gr=!0,_r=e};function it(e={}){const t={"Content-Type":"application/json","userleap-platform":je.Web,"x-ul-sdk-version":"2.21.1",[le.InstallationMethod]:xi(e)};if(e.envId&&(t[le.EnvironmentID]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t[le.UserID]=e.userId),e.visitorId&&(t[le.VisitorID]=e.visitorId),e.partnerAnonymousId&&(t[le.PartnerAnonymousId]=e.partnerAnonymousId),e.mobileHeadersJSON){const n=JSON.parse(e.mobileHeadersJSON);Object.assign(t,n)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t[le.PreviewMode]="1"),t}const bn=async(e,t,n)=>{if(e)return{status:429};{const r=new yi(n);return ut.push(r),r.promise}},ge=async(e,t,n=0,r=!1,o=!1)=>{const i={url:e,options:t,attempt:n,shouldDropOnRateLimit:r};if(ct&&!o)return bn(r,o,i);const s={ok:!1,reportError:!1};if(gr)return console.info(`UserLeap - ${_r}`),s;try{t.headers=Object.assign(it(),t.headers);const a=await fetch(e,t);if(a.status===429)if(!ct&&!r||o){ct=!0;const d=a.headers.has("ratelimit-reset")?Number(a.headers.get("ratelimit-reset")):bi.RATELIMIT_RESET_DEFAULT;return await wt(d*1e3),ge(e,t,0,r,!0)}else return bn(r,!1,i);if(ct=!1,ut.length&&(ut.map(c=>{const{url:d,options:l,attempt:h,shouldDropOnRateLimit:p}=c.payload;ge(d,l,h,p).then(f=>{c.resolveRequest(f)})}),ut=[]),a.ok){if(a.status===249)return zt(),s;const c=await a.text();try{return c&&c!=="OK"&&(a.json=JSON.parse(c)),a}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${c}`)}}}return a}catch(a){const c=n+1;return c>5?{ok:!1,reportError:!1,error:a}:(await wt(Math.pow(2,n)*1e3),ge(e,t,c))}};var st,k,wr,Je,xn,yr,yt={},br=[],Ci=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ve(e,t){for(var n in t)e[n]=t[n];return e}function xr(e){var t=e.parentNode;t&&t.removeChild(e)}function z(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?st.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Xe(e,s,r,o,null)}function Xe(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o==null?++wr:o};return o==null&&k.vnode!=null&&k.vnode(i),i}function Cr(){return{current:null}}function ie(e){return e.children}function re(e,t){this.props=e,this.context=t}function tt(e,t){if(t==null)return e.__?tt(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?tt(e):null}function Sr(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Sr(e)}}function qt(e){(!e.__d&&(e.__d=!0)&&Je.push(e)&&!bt.__r++||xn!==k.debounceRendering)&&((xn=k.debounceRendering)||setTimeout)(bt)}function bt(){for(var e;bt.__r=Je.length;)e=Je.sort(function(t,n){return t.__v.__b-n.__v.__b}),Je=[],e.some(function(t){var n,r,o,i,s,a;t.__d&&(s=(i=(n=t).__v).__e,(a=n.__P)&&(r=[],(o=ve({},i)).__v=i.__v+1,nn(a,i,o,n.__n,a.ownerSVGElement!==void 0,i.__h!=null?[s]:null,r,s==null?tt(i):s,i.__h),Ur(r,i),i.__e!=s&&Sr(i)))})}function kr(e,t,n,r,o,i,s,a,c,d){var l,h,p,f,m,v,g,w=r&&r.__k||br,y=w.length;for(n.__k=[],l=0;l<t.length;l++)if((f=n.__k[l]=(f=t[l])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?Xe(null,f,null,null,f):Array.isArray(f)?Xe(ie,{children:f},null,null,null):f.__b>0?Xe(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=n,f.__b=n.__b+1,(p=w[l])===null||p&&f.key==p.key&&f.type===p.type)w[l]=void 0;else for(h=0;h<y;h++){if((p=w[h])&&f.key==p.key&&f.type===p.type){w[h]=void 0;break}p=null}nn(e,f,p=p||yt,o,i,s,a,c,d),m=f.__e,(h=f.ref)&&p.ref!=h&&(g||(g=[]),p.ref&&g.push(p.ref,null,f),g.push(h,f.__c||m,f)),m!=null?(v==null&&(v=m),typeof f.type=="function"&&f.__k===p.__k?f.__d=c=Er(f,c,e):c=Lr(e,f,p,w,m,c),typeof n.type=="function"&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=e&&(c=tt(p))}for(n.__e=v,l=y;l--;)w[l]!=null&&Tr(w[l],w[l]);if(g)for(l=0;l<g.length;l++)Ir(g[l],g[++l],g[++l])}function Er(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t=typeof r.type=="function"?Er(r,t,n):Lr(n,r,r,o,r.__e,t));return t}function _e(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){_e(n,t)}):t.push(e)),t}function Lr(e,t,n,r,o,i){var s,a,c;if(t.__d!==void 0)s=t.__d,t.__d=void 0;else if(n==null||o!=i||o.parentNode==null)e:if(i==null||i.parentNode!==e)e.appendChild(o),s=null;else{for(a=i,c=0;(a=a.nextSibling)&&c<r.length;c+=1)if(a==o)break e;e.insertBefore(o,i),s=i}return s!==void 0?s:o.nextSibling}function Si(e,t,n,r,o){var i;for(i in n)i==="children"||i==="key"||i in t||xt(e,i,null,n[i],r);for(i in t)o&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||n[i]===t[i]||xt(e,i,t[i],n[i],r)}function Cn(e,t,n){t[0]==="-"?e.setProperty(t,n):e[t]=n==null?"":typeof n!="number"||Ci.test(t)?n:n+"px"}function xt(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Cn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Cn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?kn:Sn,i):e.removeEventListener(t,i?kn:Sn,i);else if(t!=="dangerouslySetInnerHTML"){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,n))}}function Sn(e){this.l[e.type+!1](k.event?k.event(e):e)}function kn(e){this.l[e.type+!0](k.event?k.event(e):e)}function nn(e,t,n,r,o,i,s,a,c){var d,l,h,p,f,m,v,g,w,y,j,x,U,D,C,T=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,i=[a]),(d=k.__b)&&d(t);try{e:if(typeof T=="function"){if(g=t.props,w=(d=T.contextType)&&r[d.__c],y=d?w?w.props.value:d.__:r,n.__c?v=(l=t.__c=n.__c).__=l.__E:("prototype"in T&&T.prototype.render?t.__c=l=new T(g,y):(t.__c=l=new re(g,y),l.constructor=T,l.render=Ei),w&&w.sub(l),l.props=g,l.state||(l.state={}),l.context=y,l.__n=r,h=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),T.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=ve({},l.__s)),ve(l.__s,T.getDerivedStateFromProps(g,l.__s))),p=l.props,f=l.state,h)T.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(T.getDerivedStateFromProps==null&&g!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,y),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,y)===!1||t.__v===n.__v){for(l.props=g,l.state=l.__s,t.__v!==n.__v&&(l.__d=!1),l.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(P){P&&(P.__=t)}),j=0;j<l._sb.length;j++)l.__h.push(l._sb[j]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,y),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,f,m)})}if(l.context=y,l.props=g,l.__v=t,l.__P=e,x=k.__r,U=0,"prototype"in T&&T.prototype.render){for(l.state=l.__s,l.__d=!1,x&&x(t),d=l.render(l.props,l.state,l.context),D=0;D<l._sb.length;D++)l.__h.push(l._sb[D]);l._sb=[]}else do l.__d=!1,x&&x(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++U<25);l.state=l.__s,l.getChildContext!=null&&(r=ve(ve({},r),l.getChildContext())),h||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(p,f)),C=d!=null&&d.type===ie&&d.key==null?d.props.children:d,kr(e,Array.isArray(C)?C:[C],t,n,r,o,i,s,a,c),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),v&&(l.__E=l.__=null),l.__e=!1}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ki(n.__e,t,n,r,o,i,s,c);(d=k.diffed)&&d(t)}catch(P){t.__v=null,(c||i!=null)&&(t.__e=a,t.__h=!!c,i[i.indexOf(a)]=null),k.__e(P,t,n)}}function Ur(e,t){k.__c&&k.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){k.__e(r,n.__v)}})}function ki(e,t,n,r,o,i,s,a){var c,d,l,h=n.props,p=t.props,f=t.type,m=0;if(f==="svg"&&(o=!0),i!=null){for(;m<i.length;m++)if((c=i[m])&&"setAttribute"in c==!!f&&(f?c.localName===f:c.nodeType===3)){e=c,i[m]=null;break}}if(e==null){if(f===null)return document.createTextNode(p);e=o?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),i=null,a=!1}if(f===null)h===p||a&&e.data===p||(e.data=p);else{if(i=i&&st.call(e.childNodes),d=(h=n.props||yt).dangerouslySetInnerHTML,l=p.dangerouslySetInnerHTML,!a){if(i!=null)for(h={},m=0;m<e.attributes.length;m++)h[e.attributes[m].name]=e.attributes[m].value;(l||d)&&(l&&(d&&l.__html==d.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(Si(e,p,h,o,a),l)t.__k=[];else if(m=t.props.children,kr(e,Array.isArray(m)?m:[m],t,n,r,o&&f!=="foreignObject",i,s,i?i[0]:n.__k&&tt(n,0),a),i!=null)for(m=i.length;m--;)i[m]!=null&&xr(i[m]);a||("value"in p&&(m=p.value)!==void 0&&(m!==e.value||f==="progress"&&!m||f==="option"&&m!==h.value)&&xt(e,"value",m,h.value,!1),"checked"in p&&(m=p.checked)!==void 0&&m!==e.checked&&xt(e,"checked",m,h.checked,!1))}return e}function Ir(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){k.__e(r,n)}}function Tr(e,t,n){var r,o;if(k.unmount&&k.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Ir(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){k.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Tr(r[o],t,n||typeof e.type!="function");n||e.__e==null||xr(e.__e),e.__=e.__e=e.__d=void 0}function Ei(e,t,n){return this.constructor(e,n)}function $e(e,t,n){var r,o,i;k.__&&k.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],nn(t,e=(!r&&n||t).__k=z(ie,null,[e]),o||yt,yt,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?st.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r),Ur(i,e)}function Pr(e,t){$e(e,t,Pr)}function Li(e,t,n){var r,o,i,s=ve({},e.props);for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];return arguments.length>2&&(s.children=arguments.length>3?st.call(arguments,2):n),Xe(e.type,s,r||e.key,o||e.ref,null)}function Rr(e,t){var n={__c:t="__cC"+yr++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(qt)},this.sub=function(s){o.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),a&&a.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}st=br.slice,k={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},wr=0,re.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ve({},this.state),typeof e=="function"&&(e=e(ve({},n),this.props)),e&&ve(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),qt(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),qt(this))},re.prototype.render=ie,Je=[],bt.__r=0,yr=0;var E=(e=>(e.ConsentLegal="consentlegal",e.Likert="likert",e.MultipleChoice="multiplechoice",e.MultipleSelect="multipleselect",e.NPS="nps",e.Open="open",e.RecordedTask="recordedtask",e.TextUrlPrompt="texturlprompt",e.Thanks="thanks",e.Uploading="uploading",e.VideoVoice="videovoice",e))(E||{}),Re=(e=>(e.Answered="answered",e.Equal="eq",e.NotEqual="neq",e.Skipped="skipped",e.LessThan="lt",e.LessThanOrEqual="lte",e.GivenUp="given_up",e.GreaterThan="gt",e.GreaterThanOrEqual="gte",e.ListAll="list_all",e.ListAtLeastOne="list_alo",e.ListExact="list_exact",e))(Re||{}),Be=(e=>(e.Camera="camera",e.Microphone="microphone",e.Screen="screen",e))(Be||{}),J=(e=>(e.AvPermission="av_permission",e.ScreenPermission="screen_permission",e.StartTask="start_task",e.CompleteTask="complete_task",e))(J||{}),Pe=(e=>(e.Number="number",e.Smiley="smiley",e.Star="star",e))(Pe||{}),me=(e=>(e.Video="video",e.Audio="audio",e.Screen="screen",e))(me||{}),Z=(e=>(e.PermissionStatus="permission.status",e.AvPermission="av.permission",e.ScreenPermission="screen.permission",e.BeginRecording="begin.recording",e.StartTask="start.task",e.FinishTask="finish.task",e))(Z||{}),ee=(e=>(e.Abandoned="abandoned",e.GivenUp="given.up",e.Completed="completed",e))(ee||{}),A=(e=>(e.PermissionDescriptors="permission.descriptors",e.PermissionStatusCallback="permission.status.callback",e.StreamReadyCallback="stream.ready.callback",e.StreamCanceledCallback="stream.canceled.callback",e.TaskCompleteCallback="task.complete.callback",e.TaskResponse="task.response",e.TaskStatus="task.status",e.RecordingMediaTypes="recording.media.types",e.StartRecordingCallback="start.recording.callback",e.PassthroughData="passthrough.data",e.CurrentIndex="current.index",e.UploadCallback="upload.callback",e.ProgressCallback="progress.callback",e.BeginCallback="begin.callback",e))(A||{});const En=e=>{let t;const n=new Set,r=(c,d)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const h=t;t=(d!=null?d:typeof l!="object")?l:Object.assign({},t,l),n.forEach(p=>p(t,h))}},o=()=>t,a={setState:r,getState:o,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return t=e(r,o,a),a},Ui=e=>e?En(e):En;var Ee,$,Rt,Ln,Fe=0,jr=[],pt=[],Un=k.__b,In=k.__r,Tn=k.diffed,Pn=k.__c,Rn=k.unmount;function Oe(e,t){k.__h&&k.__h($,e,Fe||t),Fe=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:pt}),n.__[e]}function Y(e){return Fe=1,rn(Mr,e)}function rn(e,t,n){var r=Oe(Ee++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Mr(void 0,t),function(i){var s=r.__N?r.__N[0]:r.__[0],a=r.t(s,i);s!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=$,!$.u)){$.u=!0;var o=$.shouldComponentUpdate;$.shouldComponentUpdate=function(i,s,a){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(l){return l.__c});if(c.every(function(l){return!l.__N}))return!o||o.call(this,i,s,a);var d=!1;return c.forEach(function(l){if(l.__N){var h=l.__[0];l.__=l.__N,l.__N=void 0,h!==l.__[0]&&(d=!0)}}),!(!d&&r.__c.props===i)&&(!o||o.call(this,i,s,a))}}return r.__N||r.__}function oe(e,t){var n=Oe(Ee++,3);!k.__s&&sn(n.__H,t)&&(n.__=e,n.i=t,$.__H.__h.push(n))}function at(e,t){var n=Oe(Ee++,4);!k.__s&&sn(n.__H,t)&&(n.__=e,n.i=t,$.__h.push(n))}function ke(e){return Fe=5,Ut(function(){return{current:e}},[])}function Or(e,t,n){Fe=6,at(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Ut(e,t){var n=Oe(Ee++,7);return sn(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Ar(e,t){return Fe=8,Ut(function(){return e},t)}function Dr(e){var t=$.context[e.__c],n=Oe(Ee++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub($)),t.props.value):e.__}function on(e,t){k.useDebugValue&&k.useDebugValue(t?t(e):e)}function Ii(e){var t=Oe(Ee++,10),n=Y();return t.__=e,$.componentDidCatch||($.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Nr(){var e=Oe(Ee++,11);if(!e.__){for(var t=$.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ti(){for(var e;e=jr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ft),e.__H.__h.forEach(Wt),e.__H.__h=[]}catch(t){e.__H.__h=[],k.__e(t,e.__v)}}k.__b=function(e){$=null,Un&&Un(e)},k.__r=function(e){In&&In(e),Ee=0;var t=($=e.__c).__H;t&&(Rt===$?(t.__h=[],$.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=pt,n.__N=n.i=void 0})):(t.__h.forEach(ft),t.__h.forEach(Wt),t.__h=[])),Rt=$},k.diffed=function(e){Tn&&Tn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(jr.push(t)!==1&&Ln===k.requestAnimationFrame||((Ln=k.requestAnimationFrame)||Pi)(Ti)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==pt&&(n.__=n.__V),n.i=void 0,n.__V=pt})),Rt=$=null},k.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ft),n.__h=n.__h.filter(function(r){return!r.__||Wt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],k.__e(r,n.__v)}}),Pn&&Pn(e,t)},k.unmount=function(e){Rn&&Rn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ft(r)}catch(o){t=o}}),n.__H=void 0,t&&k.__e(t,n.__v))};var jn=typeof requestAnimationFrame=="function";function Pi(e){var t,n=function(){clearTimeout(r),jn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);jn&&(t=requestAnimationFrame(n))}function ft(e){var t=$,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$=t}function Wt(e){var t=$;e.__c=e.__(),$=t}function sn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Mr(e,t){return typeof t=="function"?t(e):t}function Vr(e,t){for(var n in t)e[n]=t[n];return e}function Gt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function jt(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Ct(e){this.props=e}function Hr(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:Gt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,z(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Ct.prototype=new re).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,t){return Gt(this.props,e)||Gt(this.state,t)};var On=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),On&&On(e)};var Ri=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function $r(e){function t(n){var r=Vr({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Ri,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var An=function(e,t){return e==null?null:_e(_e(e).map(t))},Br={map:An,forEach:An,count:function(e){return e?_e(e).length:0},only:function(e){var t=_e(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:_e},ji=k.__e;k.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}ji(e,t,n,r)};var Dn=k.unmount;function Fr(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Vr({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Fr(r,t,n)})),e}function zr(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return zr(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function et(){this.__u=0,this.t=null,this.__b=null}function qr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Wr(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return z(n,i)}return o.displayName="Lazy",o.__f=!0,o}function De(){this.u=null,this.o=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Dn&&Dn(e)},(et.prototype=new re).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=qr(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var d=r.state.__a;r.__v.__k[0]=zr(d,d.__c.__P,d.__c.__O)}var l;for(r.setState({__a:r.__b=null});l=r.t.pop();)l.forceUpdate()}},c=t.__h===!0;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},et.prototype.componentWillUnmount=function(){this.t=[]},et.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Fr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&z(ie,null,e.fallback);return o&&(o.__h=null),[z(ie,null,t.__a?null:e.children),o]};var Nn=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Oi(e){return this.getChildContext=function(){return e.context},e.children}function Ai(e){var t=this,n=e.i;t.componentWillUnmount=function(){$e(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),$e(z(Oi,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Gr(e,t){var n=z(Ai,{__v:e,i:t});return n.containerInfo=t,n}(De.prototype=new re).__a=function(e){var t=this,n=qr(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Nn(t,e,r)):o()};n?n(i):i()}},De.prototype.render=function(e){this.u=null,this.o=new Map;var t=_e(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},De.prototype.componentDidUpdate=De.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Nn(e,n,t)})};var Zr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Di=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ni=typeof document<"u",Mi=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Yr(e,t,n){return t.__k==null&&(t.textContent=""),$e(e,t),typeof n=="function"&&n(),e?e.__c:null}function Kr(e,t,n){return Pr(e,t),typeof n=="function"&&n(),e?e.__c:null}re.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(re.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Mn=k.event;function Vi(){}function Hi(){return this.cancelBubble}function $i(){return this.defaultPrevented}k.event=function(e){return Mn&&(e=Mn(e)),e.persist=Vi,e.isPropagationStopped=Hi,e.isDefaultPrevented=$i,e.nativeEvent=e};var Qr,Vn={configurable:!0,get:function(){return this.class}},Hn=k.vnode;k.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var o=t.indexOf("-")===-1;for(var i in r={},n){var s=n[i];Ni&&i==="children"&&t==="noscript"||i==="value"&&"defaultValue"in n&&s==null||(i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Mi(n.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&Di.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():s===null&&(s=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),r[i]&&(i="oninputCapture")),r[i]=s)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=_e(n.children).forEach(function(a){a.props.selected=r.value.indexOf(a.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=_e(n.children).forEach(function(a){a.props.selected=r.multiple?r.defaultValue.indexOf(a.props.value)!=-1:r.defaultValue==a.props.value})),e.props=r,n.class!=n.className&&(Vn.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",Vn))}e.$$typeof=Zr,Hn&&Hn(e)};var $n=k.__r;k.__r=function(e){$n&&$n(e),Qr=e.__c};var Jr={ReactCurrentDispatcher:{current:{readContext:function(e){return Qr.__n[e.__c].props.value}}}},Bi="17.0.2";function Xr(e){return z.bind(null,e)}function an(e){return!!e&&e.$$typeof===Zr}function eo(e){return an(e)?Li.apply(null,arguments):e}function to(e){return!!e.__k&&($e(null,e),!0)}function no(e){return e&&(e.base||e.nodeType===1&&e)||null}var ro=function(e,t){return e(t)},oo=function(e,t){return e(t)},io=ie;function ln(e){e()}function so(e){return e}function ao(){return[!1,ln]}var lo=at;function co(e,t){var n=t(),r=Y({h:{__:n,v:t}}),o=r[0].h,i=r[1];return at(function(){o.__=n,o.v=t,jt(o.__,t())||i({h:o})},[e,n,t]),oe(function(){return jt(o.__,o.v())||i({h:o}),e(function(){jt(o.__,o.v())||i({h:o})})},[e]),n}var Fi={useState:Y,useId:Nr,useReducer:rn,useEffect:oe,useLayoutEffect:at,useInsertionEffect:lo,useTransition:ao,useDeferredValue:so,useSyncExternalStore:co,startTransition:ln,useRef:ke,useImperativeHandle:Or,useMemo:Ut,useCallback:Ar,useContext:Dr,useDebugValue:on,version:"17.0.2",Children:Br,render:Yr,hydrate:Kr,unmountComponentAtNode:to,createPortal:Gr,createElement:z,createContext:Rr,createFactory:Xr,cloneElement:eo,createRef:Cr,Fragment:ie,isValidElement:an,findDOMNode:no,Component:re,PureComponent:Ct,memo:Hr,forwardRef:$r,flushSync:oo,unstable_batchedUpdates:ro,StrictMode:io,Suspense:et,SuspenseList:De,lazy:Wr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Jr};const zi=Object.freeze(Object.defineProperty({__proto__:null,Children:Br,PureComponent:Ct,StrictMode:io,Suspense:et,SuspenseList:De,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Jr,cloneElement:eo,createFactory:Xr,createPortal:Gr,default:Fi,findDOMNode:no,flushSync:oo,forwardRef:$r,hydrate:Kr,isValidElement:an,lazy:Wr,memo:Hr,render:Yr,startTransition:ln,unmountComponentAtNode:to,unstable_batchedUpdates:ro,useDeferredValue:so,useInsertionEffect:lo,useSyncExternalStore:co,useTransition:ao,version:Bi,Component:re,Fragment:ie,createContext:Rr,createElement:z,createRef:Cr,useCallback:Ar,useContext:Dr,useDebugValue:on,useEffect:oe,useErrorBoundary:Ii,useId:Nr,useImperativeHandle:Or,useLayoutEffect:at,useMemo:Ut,useReducer:rn,useRef:ke,useState:Y},Symbol.toStringTag,{value:"Module"}));var uo={exports:{}},po={};const fo=ci(zi);var mo={exports:{}},ho={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ze=fo;function qi(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wi=typeof Object.is=="function"?Object.is:qi,Gi=ze.useState,Zi=ze.useEffect,Yi=ze.useLayoutEffect,Ki=ze.useDebugValue;function Qi(e,t){var n=t(),r=Gi({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Yi(function(){o.value=n,o.getSnapshot=t,Ot(o)&&i({inst:o})},[e,n,t]),Zi(function(){return Ot(o)&&i({inst:o}),e(function(){Ot(o)&&i({inst:o})})},[e]),Ki(n),n}function Ot(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wi(e,n)}catch{return!0}}function Ji(e,t){return t()}var Xi=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ji:Qi;ho.useSyncExternalStore=ze.useSyncExternalStore!==void 0?ze.useSyncExternalStore:Xi;(function(e){e.exports=ho})(mo);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var It=fo,es=mo.exports;function ts(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ns=typeof Object.is=="function"?Object.is:ts,rs=es.useSyncExternalStore,os=It.useRef,is=It.useEffect,ss=It.useMemo,as=It.useDebugValue;po.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=os(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=ss(function(){function c(f){if(!d){if(d=!0,l=f,f=r(f),o!==void 0&&s.hasValue){var m=s.value;if(o(m,f))return h=m}return h=f}if(m=h,ns(l,f))return m;var v=r(f);return o!==void 0&&o(m,v)?m:(l=f,h=v)}var d=!1,l,h,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,o]);var a=rs(e,i[0],i[1]);return is(function(){s.hasValue=!0,s.value=a},[a]),as(a),a};(function(e){e.exports=po})(uo);const ls=li(uo.exports),{useSyncExternalStoreWithSelector:cs}=ls;function ds(e,t=e.getState,n){const r=cs(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return on(r),r}const Bn=e=>{const t=typeof e=="function"?Ui(e):e,n=(r,o)=>ds(t,r,o);return Object.assign(n,t),n},vo=e=>e?Bn(e):Bn,At=1,cn={eq(e,t){return e==t},neq(e,t){return!this.eq(e,t)},gt(e,t){return e>t},gte(e,t){return e>=t},lt(e,t){return e<t},lte(e,t){return e<=t},list_exact(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.slice().sort().join(",")===t.slice().sort().join(",")},list_all(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:!t.some(n=>e.indexOf(n)===-1)},list_alo(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:t.some(n=>e.indexOf(n)!=-1)}},go=(e,t,n)=>{switch(t){case E.VideoVoice:return Boolean(e&&e.value);case E.Open:return!!n;case E.MultipleSelect:return Boolean(n&&!!Object.keys(n).length);case E.RecordedTask:return(n==null?void 0:n.taskStatus)===ee.Completed;case E.TextUrlPrompt:return!e.value;case E.ConsentLegal:return n!==null;case E.MultipleChoice:return n!==void 0;case E.NPS:return n!==null;case E.Likert:return n!==null;default:return!0}},_o=({cards:e,index:t,hasEndCard:n,selectedValue:r,hasValidAnswer:o=!0,uploadProgress:i={}})=>{if(t>=e.length||t<0)return null;const a=e[t].props.routingOptions||[];let c=null,d=null;for(let f=0;f<a.length;f++){const{comparator:m,target:v,value:g}=a[f];if(m===Re.Answered&&o){c=v;break}else if(m===Re.GivenUp&&r instanceof Object&&"taskStatus"in r&&(r==null?void 0:r.taskStatus)===ee.GivenUp){c=v;break}else if(m===Re.Skipped&&!o&&!(r instanceof Object&&"taskStatus"in r&&(r==null?void 0:r.taskStatus)===ee.GivenUp)){c=v;break}else if(o&&wo(m)&&cn[m](r,g)){c=v;break}}const l=c&&parseInt(String(c),10);c&&l!==null&&!isNaN(l)&&(l===-1||l>t)&&(d=l);const h=e.findIndex(f=>f.type===E.Uploading);let p;return h>0&&n?p=e.length-3:h>0||n?p=e.length-2:p=e.length-1,t>=p||d===-1||d!==null&&d>p?h>0&&Object.values(i).some(m=>m.isSubmitted&&!m.isComplete)?h:n?e.length-1:null:d!==null?d:t+1},us=13,ps=e=>e.reduce((t,n)=>t.concat(t.map(r=>[...r,n])),[[]]),Fn=e=>!!(Array.isArray(e)?e.length:e),fs=e=>{switch(e.type){case E.MultipleSelect:return!e||!e.props||!e.props.options?null:e.props.options.length>us?e.props.options.map(t=>[t.value]):ps(e.props.options.map(t=>t.value));case E.MultipleChoice:return!e||!e.props||!e.props.options?null:e.props.options.map(t=>t.value);case E.Likert:return[1,2,3,4,5];case E.NPS:return[0,1,2,3,4,5,6,7,8,9,10];case E.VideoVoice:case E.Open:return[At,""];case E.RecordedTask:return[At,ee.GivenUp,""];case E.TextUrlPrompt:case E.ConsentLegal:default:return[At]}},wo=e=>e in cn,ms=(e,t)=>{const n=new Set([E.Thanks,E.Uploading]);if(t>=e.length||t<0||n.has(e[t].type))return 0;const r=e.filter(i=>!n.has(i.type));if(t===r.length-1)return 1;const o={[r.length-1]:1,[-1]:0};for(let i=r.length-2;i>=t;i--){const s=r[i],a=s.props.routingOptions||[];if(a.length===0){o[i]=o[i+1]+1;continue}let c=0,d=fs(s);if(d===null)return r.length-1-t;for(let l=0;l<a.length&&d.length!==0;l++){const{comparator:h,target:p,value:f}=a[l],m=d.filter(v=>!(h===Re.Answered&&Fn(v)&&v!==ee.GivenUp||h===Re.Skipped&&!Fn(v)||h===Re.GivenUp&&v===ee.GivenUp||wo(h)&&cn[h](v,f)));if(m.length<d.length){const v=parseInt(String(p),10);if(v!==-1&&v<=i||v>=r.length)return r.length-1-t;c=Math.max(o[v]+1,c)}d=m}d.length>0&&(c=Math.max(o[i+1]+1,c)),o[i]=c}return o[t]},hs=e=>!(e.type===E.Thanks||e.type===E.Uploading),F=vo()((e,t)=>({answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=Ne)=>{const r=t(),{fadeout:o,remove:i,trackHistory:s}=r;await o(n),Dt(r)||s({event:"closed"}),Ft.enable(),i({initiator:fe.Closed})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:o,remove:i}=t();r(X.SurveyComplete),await o(n),Ft.enable(),i({initiator:fe.Complete})},endCard:{headline:""},envId:"",eventEmitFn:V.emit.bind(V),fadeout:async n=>{const{eventEmitFn:r,headers:o,viewDocument:i}=t();return Ve(o)?Promise.resolve():(r(N.SurveyFadingOut),new Promise(s=>{const a=i.getElementById(n);a?(a.addEventListener("transitionend",()=>{s()}),a.classList.remove("ul-app--visible")):s()}))},frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:o,index:i}=t();o(n,{[Te.QuestionId]:r[i].name,[Te.Props]:r[i].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:o,isSubmitted:i})=>{var p,f,m;const{cards:s,destroy:a,index:c,uploadProgress:d}=t(),l={...d,[n]:{progressPct:o||o===0?o:(p=d[n])==null?void 0:p.progressPct,isComplete:r||((f=d[n])==null?void 0:f.isComplete),isSubmitted:i||((m=d[n])==null?void 0:m.isSubmitted)}};if(s[c].type!==E.Uploading){e({uploadProgress:l});return}const h=Object.entries(d).every(([v,g])=>!g.isSubmitted||g.isComplete||n==v&&r);if(h&&c>=s.length-1){a(Ne);return}e({index:h?c+1:c,uploadingCardViewed:!0,uploadProgress:l})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":je.Web,"x-ul-environment-id":"","x-ul-installation-method":Se.Snippet,"x-ul-sdk-version":"","x-ul-visitor-id":""},index:0,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{cards:r,eventEmitFn:o,index:i,responseGroupUid:s,submit:a,trackHistory:c,uploadProgress:d,viewedCardCount:l}=t(),h=Date.now(),p=[...r],f=p[i],{type:m}=n.data,v={...n.data},g=v.value;hs(f)&&(f.value=g),v.answeredAt=h,delete v.type;const w={response:v,responseGroupUid:s};let y=m===E.MultipleChoice?Object.values(g).find(C=>C!==!1):g;m===E.MultipleSelect&&(y=p[i].props.options.reduce((C,T)=>(g[T.id]&&C.push(T.value),C),[]));const j=go(v,m,y),x=_o({cards:p,index:i,selectedValue:y,hasEndCard:!!n.endCard,hasValidAnswer:j,uploadProgress:d});if(x===null){w.completedAt=h,a(w),n.completeSurvey();return}else[E.Thanks,E.Uploading].includes(p[x].type)&&(w.completedAt=h);const U=a(w);[E.Thanks,E.Uploading].includes(p[x].type)||U.finally(()=>{c({event:"seen",index:x})});const D=p[x];p[x]&&o&&o(X.CurrentQuestion,{[Te.QuestionId]:D.name,[Te.Props]:D.props}),e({cards:p,hasViewedEmbed:!1,index:x,viewedCardCount:l+1})},recorder:()=>{},recorderEventEmitter:V,responseGroupUid:"",remove:({initiator:n})=>{const{frame:r,headers:o,eventEmitFn:i}=t();["ios","android"].includes(o["userleap-platform"])&&i(N.SurveyWillClose,{name:N.SurveyWillClose,initiator:n}),!Ve(o)&&(i(N.SurveyWillClose,{name:N.SurveyWillClose,initiator:n}),r.remove())},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,response:r,responseGroupUid:o})=>{const i=t();if(!o||Dt(i))return;const s={responseGroupUid:o,meta:i.meta,customMetadata:i.customMetadata,responses:[r],completedAt:n},a=await ge(`${i.apiURL}/sdk/1/environments/${i.envId}/visitors/${i.userId}/responses/submit`,{body:JSON.stringify(s),headers:i.headers,method:"POST"});if(!a.ok){a.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",a.error),await zn(i,"submitResponse",a.error));return}},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:o=!1})=>{const i=t();if(Dt(i))return;const{cards:s,index:a}=i,c=r!==void 0?s[r]:s[a],d={sid:i.surveyId,qid:c.name,action:n,vid:i.userId,eid:i.envId,isNew:o,responseGroupUid:i.responseGroupUid},l=await ge(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`,{body:JSON.stringify(d),headers:i.headers,method:"POST"});!l.ok&&l.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",l.error),await zn(i,"trackHistory",l.error))},update:()=>{const{headers:n,eventEmitFn:r,frame:o,viewDocument:i}=t();setTimeout(()=>{var a;const s=ar(i);Ve(n)?r(N.SurveyHeight,{name:N.SurveyHeight,contentFrameHeight:s}):(a=o.setHeight)==null||a.call(o,s)},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),Dt=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview,zn=async(e,t,n)=>{const{mode:r,userId:o,envId:i,apiURL:s,headers:a,viewDocument:c}=e,d=c.documentElement,l={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:d.clientWidth,clientHeight:d.clientHeight,location:window.location.href,language:window.navigator.language},h={action:t,err:{message:n==null?void 0:n.message,stack:n==null?void 0:n.stack},meta:l,vid:o,envId:i};(await ge(`${s}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},a),body:JSON.stringify(h)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},vs=async(e,t)=>{var r;const n=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok){const o=await n.json();return(r=o==null?void 0:o.upload)==null?void 0:r.url}else return null},yo=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",qn=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:yo()};return new MediaRecorder(e,t)},Wn=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function Gn(e,t,n,r,o,i){if(e&&e.state!=="inactive"){const{[A.BeginCallback]:s}=r,a=e.currentMediaRecordingUid;if(!a)return;s&&s(a),e.onstop=()=>gs(t,e,n,r,a,o,i),e.stop()}}async function gs(e,t,n,r,o,i,s){const a=F.getState().viewDocument,{[A.UploadCallback]:c,[A.ProgressCallback]:d}=r,l={mediaType:n,updatedAt:new Date().toISOString(),mediaRecordingUid:o,...r[A.PassthroughData]},h=await vs(l,e);if(!h){c&&c(null,{message:"failed to get upload url"});return}const p=new Blob(s,{type:yo()});if(!a.defaultView)return;const f=new a.defaultView.File([p],`recording video ${Date.now()}`),m=i.createUpload({endpoint:h,file:f,chunkSize:5120});m.startTime=Date.now(),m.on("error",v=>{c&&c(null,v)}),m.on("progress",v=>{d&&d(o,v)}),m.on("success",()=>{c&&c(o,!0)})}const _s={chunks:{}},ws={state:{..._s},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:o}=this.state,i=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?me.Video:me.Audio;this.state.chunks&&t&&o&&(n!=null&&n.currentMediaRecordingUid&&Gn(n,t,i,e,o,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&Gn(r,t,me.Screen,e,o,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e,t){const n=e.getVideoTracks(),r=e.getAudioTracks();let o=n.length&&n[0];o=o||r.length&&r[0],o&&o.addEventListener("ended",()=>{let i=!1;[this.state.avRecorder,this.state.screenRecorder].map(s=>{s&&(s.state==="recording"&&s.stop(),s.stream.getTracks().map(a=>{a.readyState==="live"&&a.stop()}),i=!0)}),Object.assign(this.state,{avStream:null,captureStream:null,avRecorder:null,screenRecorder:null}),i&&t&&t()})},taskDurationMillisecond(){return this.state.startTime?new Date().getTime()-this.state.startTime.getTime():0},setUpChunk(e){this.state.UpChunk=e},configure(e,t){Object.assign(this.state,t),this.state.uploadApiEndpoint=`${t.apiURL}/2/environments/integrations/upload`,this.state.chunks={},e.on(Z.PermissionStatus,this.permissionStatusCallback.bind(this)),e.on(Z.AvPermission,async n=>{this.avPermissionCallback(n)}),e.on(Z.BeginRecording,this.beginRecordingCallback.bind(this)),e.on(Z.StartTask,this.startTaskCallback.bind(this)),e.on(Z.ScreenPermission,async n=>{this.screenPermissionCallback(n)}),e.on(Z.FinishTask,async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var o,i,s;const{[A.StreamReadyCallback]:t,[A.StreamCanceledCallback]:n,[A.PermissionDescriptors]:r}=e;try{(o=this.state.avStream)!=null&&o.active&&(this.state.avStream.getTracks().map(a=>a.readyState==="live"&&a.stop()),((i=this.state.captureStream)==null?void 0:i.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:r.includes(Be.Camera),audio:!0}),((s=this.state.captureStream)==null?void 0:s.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream,n)}catch(a){console.warn("Error: failed to get permissions: "+a),t&&t(null,null);return}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{[A.StreamReadyCallback]:t,[A.StreamCanceledCallback]:n}=e;try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){console.warn("Error: failed to get permissions: "+r),t&&t(null,null);return}this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream,n),t&&t(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{[A.RecordingMediaTypes]:t,[A.StartRecordingCallback]:n}=e;if(!t)return;const r=[];if(t.includes(me.Video)&&this.state.avStream){this.state.avRecorder=qn(this.state.avStream);const o=_t();Wn(this.state.avRecorder,o,this.state.chunks),r.push(o)}if(t.includes(me.Screen)&&this.state.captureStream){this.state.screenRecorder=qn(this.state.captureStream);const o=_t();Wn(this.state.screenRecorder,o,this.state.chunks),r.push(o)}r&&n&&n(r)},async finishTaskCallback(e){const{[A.CurrentIndex]:t,[A.TaskResponse]:n,[A.TaskCompleteCallback]:r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{[A.PermissionStatusCallback]:t}=e,n=this.state.avStream;t&&t(n,n?(n==null?void 0:n.getVideoTracks().length)>0:!1,!!((r=this.state.captureStream)!=null&&r.active))},lookAheadAndStopStream(e,t,n,r){const{avRecorder:o,screenRecorder:i}=this.state,s=_o({cards:n,index:e,selectedValue:t.value,hasEndCard:r,hasValidAnswer:go(t,t.type,t.value)});s!==null&&n[s].type===E.RecordedTask||[o,i].map(a=>{a&&(a.state==="recording"&&a.stop(),a.stream.getTracks().map(c=>{c.readyState==="live"&&c.stop()}))})}},mt=Object.create(ws);Object.freeze(mt);function bo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=bo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function R(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=bo(e))&&(r&&(r+=" "),r+=t);return r}var ys=0;function u(e,t,n,r,o){var i,s,a={};for(s in t)s=="ref"?i=t[s]:a[s]=t[s];var c={type:e,props:a,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--ys,__source:o,__self:r};if(typeof e=="function"&&(i=e.defaultProps))for(s in i)a[s]===void 0&&(a[s]=i[s]);return k.vnode&&k.vnode(c),c}const K=e=>u("button",{...e,className:R("ul-card-text__button",e.className),id:"ul-card-text__button"}),pe=({message:e,properties:t})=>{const n=t==null?void 0:t.captionText;return u(ie,{children:[e&&u("h1",{className:b.QuestionHeader,id:b.QuestionHeader,...n?{}:{style:{marginBottom:"15px"}},children:e}),n&&u("p",{className:b.Caption,id:b.Caption,children:n})]})},Zn=({buttonText:e="View Prototype",handleClick:t})=>u("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),Le=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var h;const{handleClickEmbedButton:r,hasViewedEmbed:o,headers:i,useDesktopPrototype:s}=F(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),a=(n==null?void 0:n.conceptUrl)||((h=n==null?void 0:n.consentDocument)==null?void 0:h.url),c=window.innerWidth<ti,d=i["userleap-platform"],l=(p,f)=>{p.preventDefault(),r(f)};if(!s&&c&&!o&&a&&["email","link"].includes(d)){if(t==="prototype")return u(Zn,{handleClick:p=>{l(p,X.ViewPrototypeClick)}});if(t==="pdf")return u(Zn,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{l(p,X.ViewAgreementClick)}})}return e()},xo=(e,t)=>{const n=ke(0),r=()=>{if(e.current){const o=e.current;o.style.height="1px";const i=o.scrollHeight,s=o.offsetHeight-o.clientHeight,a=i+s,c=parseInt(window.getComputedStyle(o).getPropertyValue("max-height")),d=a<=c?a:c;n.current!==d&&t(),n.current=d,o.style.height=`${d}px`}};return oe(r,[]),r},Co=({border:e,label:t,isSelected:n,value:r,text:o,id:i,isRadio:s,useMobileStyling:a,error:c,allowTextEntry:d,promptText:l,onUserInputChanged:h})=>{const{styleNonce:p,viewDocument:f}=F(P=>({styleNonce:P.styleNonce,viewDocument:P.viewDocument})),[m,v]=Y(!1);Cs(f,e,p);const g=({isSelected:P,userText:M})=>{h&&h({id:i||"",selected:P,value:r,userText:M})},w=P=>{P.stopPropagation(),g({isSelected:s||!n,userText:o}),v(!1)},y=()=>{m||v(!0)},j=()=>{m&&v(!1)},x=P=>{Qe(P.target)||(P.key==="Enter"||P.key===" ")&&w(P)},U={onClick:P=>w(P),onKeyPress:P=>x(P)};"ontouchstart"in f.documentElement?(U.onTouchStart=j,U.onTouchCancel=j,U.onTouchEnd=j):(U.onMouseDown=y,U.onMouseLeave=j);const D=s?`radio-${i}`:`checkbox-${i}`,C=n||m?[ht]:[],T=[...c?[So]:[],...C];return u("div",{className:R([...q(b.Choice,a),...T]),id:`choice-div-${i}`,style:c?{borderColor:Ke}:{},...U,children:[u("div",{className:R([b.ChoiceLabelContainer]),children:[s?u("div",{"aria-labelledby":`label-${i}`,className:R([b.ChoiceRadio,...C]),id:D,role:"radio",tabIndex:0}):u("div",{"aria-checked":n,"aria-labelledby":`label-${i}`,className:b.ChoiceCheckbox,id:D,role:"checkbox",style:n?{backgroundColor:e,borderColor:e,boxShadow:"none"}:{},tabIndex:0,children:n&&u("svg",{fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})}),u("label",{className:R(q(b.ChoiceLabel,a)),htmlFor:D,id:`label-${i}`,children:t})]}),d&&n&&u("div",{className:R([b.ChoiceTextEntryContainer,...C]),children:u(bs,{onTextChange:P=>g({isSelected:n,userText:P}),promptText:l||"Please specify",textValue:o,useMobileStyling:a})})]})},bs=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const o=ke(null),{update:i}=F(a=>({update:a.update})),s=xo(o,()=>i());return oe(()=>{o.current&&o.current.focus()},[]),u("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:R(q(b.ChoiceTextInput,r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:a=>{s(),Qe(a.target)&&(a.stopPropagation(),n(a.target.value))},onClick:a=>{a.stopPropagation()},onKeyPress:a=>{a.stopPropagation()},placeholder:e,ref:o,role:"textbox",rows:1,value:t})},Yn="ul-select-style-element",ht="ul-select-active-dynamic-style",So="ul-select-error-dynamic-style",xs=e=>e.tagName.toLowerCase()==="style",Cs=(e,t,n)=>{let r=e.getElementById(Yn),o=!1;r||(r=e.createElement("style"),o=!0),xs(r)&&(r.id=Yn,n&&(r.nonce=n),r.textContent=Ss(t),o&&e.head.appendChild(r))},Ss=e=>`
|
|
18
|
+
.${ht} {
|
|
19
|
+
border-color: ${e};
|
|
20
|
+
}
|
|
21
|
+
.${ht} .${b.ChoiceRadio}, .${ht}.${b.ChoiceRadio} {
|
|
22
|
+
border: 6px solid ${e};
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
}
|
|
25
|
+
.${So} {
|
|
26
|
+
border-color: ${Ke};
|
|
27
|
+
}
|
|
28
|
+
`,qe=e=>(e==null?void 0:e.buttonText)||"Next",dn=e=>(e==null?void 0:e.skipButtonText)||"Skip",ks=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{headers:s,useMobileStyling:a,border:c}=F(S=>({headers:S.headers,useMobileStyling:S.useMobileStyling,border:S.border})),[d,l]=Y(!1),[h,p]=Y(""),[f,m]=Y(!1),v=s["userleap-platform"],g=r==null?void 0:r.collectName,w=(r==null?void 0:r.nameLabelText)||"Full Name",y=(r==null?void 0:r.consentText)||"I agree to the stated conditions",j=(r==null?void 0:r.submitButtonText)||"Submit",x=!!h.trim(),U=d&&(!g||x),D=(S,_=!1)=>{S.preventDefault(),S.stopPropagation();let L=null;if(!_){if(!U){m(!0);return}L={submitted:!0},g&&(L.name=h)}n({value:L,questionId:o,type:i})},C=S=>{si(S.target)&&(S.preventDefault(),S.stopPropagation(),p(S.target.value))},T=S=>{He(S.target)&&(S.target.style.borderColor=f&&!x?Ke:c)},P=S=>{He(S.target)&&(S.target.style.borderColor=f&&!x?Ke:en)},M=()=>u("div",{children:[u(Co,{allowTextEntry:!1,border:c,error:f&&!d,index:0,isRadio:!1,isSelected:d,label:y,onUserInputChanged:({selected:S})=>{S!==d&&l(!d)},useMobileStyling:a}),g&&u("input",{"aria-label":w,"aria-placeholder":w,className:R(q(b.ConsentLegalNameInput,a)),"data-gramm":"false",maxLength:250,name:"name",onBlur:P,onFocus:T,onInput:C,placeholder:w,style:f&&!x?{borderColor:Ke}:{},tabIndex:0,value:h}),u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[u(K,{className:U?"":b.ButtonDisabled,onClick:D,children:j}),r.required===!1&&u("button",{className:"ul-card-skip__button",onClick:S=>D(S,!0),children:dn(r)})]})]});return u("div",{className:R(ue(b.CardMainContent,v)),children:u("div",{className:R([e,"ul-card__consent-legal",b.FadeInTransition]),children:[u(pe,{message:t}),u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r&&r.richTextBody?{__html:r&&r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"}),u(Le,{properties:r,defaultBody:M,embeddedType:"pdf"})]},o)})},Es=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:o,range:i,scaleLabelType:s,setActiveValue:a,setIsPressed:c,useMobileStyling:d,value:l})=>{const h=`option-${l}`,p=s===Pe.Number,f=s===Pe.Star,m=p&&l===e,[v,g]=(()=>l<=e&&f||l===e?r?[t,1]:[t,.3]:["",1])(),w=()=>{switch(s){case Pe.Star:return R([...q(b.LikertStar,d),...q(`${b.LikertStar}-${l}`,d)]);case Pe.Smiley:return R([...q(b.LikertSmiley,d),...q(`${b.LikertSmiley}-${l}`,d)]);default:return R(l===i?[...q(b.LikertNumber,d),...q(`${b.LikertNumber}-${l}`,d),...q("likert-last-option",d)]:[...q(b.LikertNumber,d),...q(`${b.LikertNumber}-${l}`,d)])}},y=()=>{a(-1),c(!1)};return u("div",{"aria-label":p?void 0:l,className:w(),dangerouslySetInnerHTML:{__html:n},id:h,onClick:()=>o(),onPointerDown:()=>c(!0),onPointerEnter:()=>a(l),onPointerLeave:y,role:"radio",style:{color:p?"":v,borderColor:m?v:"",fillOpacity:m?"":g,zIndex:m?3:"auto"},tabIndex:0})},Ls=({className:e,labels:t,message:n,next:r,properties:o,questionId:i,type:s})=>{const{border:a,headers:c,useMobileStyling:d}=F(M=>({border:M.border,headers:M.headers,useMobileStyling:M.useMobileStyling})),[l,h]=Y(-1),[p,f]=Y(!1),m=c["userleap-platform"],v=t&&t.left,g=t&&t.right;let w;const{range:y,scaleLabelType:j,ratingIcons:x}=o;y&&(w=Number(y));const U=w||5,D=M=>{var S,_;switch(j){case Pe.Star:return(S=x[0])==null?void 0:S.svg;case Pe.Smiley:return(_=x[M])==null?void 0:_.svg;default:return String(M+1)}},C=[...Array(U)].map((M,S)=>{const _=S+1;return u(Es,{activeValue:l,border:a,icon:D(S),isPressed:p,onSubmit:()=>r({value:_,questionId:i,type:s}),range:U,scaleLabelType:j,setActiveValue:h,setIsPressed:f,useMobileStyling:d,value:_},S)}),T=M=>{M.preventDefault(),M.stopPropagation(),r({value:null,questionId:i,type:s})},P=()=>u(ie,{children:[u("div",{"aria-label":`Rating (1 - ${U})`,className:"ul-card--likert__numbers",role:"radiogroup",children:C}),u("div",{className:"ul-card--likert__labels",children:[u("span",{children:v}),u("span",{children:g})]}),!o.required&&u("div",{className:"ul-vertical-centered-container",children:u(K,{onClick:T,children:qe(o)})})]});return u("div",{className:R(ue(b.CardMainContent,m)),children:u("form",{className:R([e,"ul-card--likert",b.FadeInTransition]),children:[u(pe,{message:n,properties:o}),u(Le,{properties:o,defaultBody:P})]},i)})},ko=({className:e,message:t,onSubmit:n,options:r=[],properties:o,questionId:i,type:s})=>{const{border:a,headers:c,useMobileStyling:d}=F(C=>({border:C.border,headers:C.headers,useMobileStyling:C.useMobileStyling})),l=r.reduce((C,T)=>(C[T.id]={isSelected:!1},C),{}),[h,p]=Y(l),f=c["userleap-platform"],m=s===E.MultipleChoice,v=o.required,g=Object.entries(h).some(([C,T])=>{var S;const P=r.find(_=>`${_.id}`===C),M=T.userText===void 0||T.userText.trim()==="";return((S=P==null?void 0:P.optionProperties)==null?void 0:S.allowsTextEntry)&&M&&T.isSelected}),w=Object.values(h).some(C=>C.isSelected),y=g||v&&!w,j=r.map(({id:C,label:T,value:P,optionProperties:M},S)=>{var B,Q;const _=`${C}`,{allowsTextEntry:L}=M||{allowsTextEntry:!1};return u(Co,{allowTextEntry:L,border:a,error:!1,id:_,index:S,isRadio:m,isSelected:!!((B=h[_])!=null&&B.isSelected),label:T,onUserInputChanged:We=>U(We.id,We.selected,We.userText),promptText:"Please specify",text:(Q=h[C])==null?void 0:Q.userText,useMobileStyling:d,value:P},_)}),x=C=>{C.preventDefault(),C.stopPropagation(),n(h)},U=(C,T,P)=>{const M=Object.assign({},h);if(m&&T)for(const S of Object.values(M))S.isSelected=!1,delete S.userText;M[C]={isSelected:T,userText:P},p(M)},D=()=>u("div",{children:[u("div",{className:R(q(b.ChoiceGroup,d)),role:m?"radiogroup":"group",children:j}),u("div",{className:"ul-card__button-wrapper",children:u(K,{disabled:y,onClick:x,children:qe(o)})})]});return u("div",{className:R(ue(b.CardMainContent,f)),children:u("form",{className:R([e,"ul-card--multiple",b.FadeInTransition]),id:"text-form",onSubmit:x,children:[u(pe,{message:t,properties:o}),u(Le,{properties:o,defaultBody:D})]},i)})},Us=e=>{const{questionId:t,type:n,next:r,options:o}=e;return u(ko,{...e,onSubmit:s=>{const a=Object.entries(s).find(([,p])=>p.isSelected)||[void 0,void 0],[c,d]=a,l=o.find(p=>`${p.id}`===c),h=d!=null&&d.userText?{[c]:{userText:d.userText}}:null;r({value:l&&c?{[c]:l.value}:{},secondaryValue:h,questionId:t,type:n})}})},Is=e=>{const{questionId:t,type:n,next:r}=e;return u(ko,{...e,onSubmit:i=>{const s={},a=Object.entries(i).reduce((d,[l,h])=>(d[l]=h.isSelected,d),s),c=Object.entries(i).reduce((d,[l,h])=>{if(!h.userText)return d;const p=d||{};return p[l]={userText:h.userText},p},null);r({value:a,secondaryValue:c,questionId:t,type:n})}})},Ts=({className:e,props:{labels:t,message:n,properties:r},next:o,questionId:i,type:s})=>{const{border:a,headers:c,useMobileStyling:d}=F(g=>({border:g.border,headers:g.headers,useMobileStyling:g.useMobileStyling})),l=c["userleap-platform"],h=t&&t.left,p=t&&t.right,f=[...Array(11)].map((g,w)=>u("div",{className:R([...q(b.NPSNumber,d),...q(`${b.NPSNumber}-${w}`,d)]),id:`option-${w}`,onClick:()=>o({value:w,questionId:i,type:s}),onKeyPress:y=>{y.preventDefault(),(y.key==="Enter"||y.key===" ")&&o({value:w,questionId:i,type:s})},onPointerDown:y=>{He(y.target)&&(y.target.style.zIndex="2",y.target.style.borderColor=a)},onPointerLeave:y=>{He(y.target)&&(y.target.style.zIndex="auto",y.target.style.borderColor=en)},role:"radio",tabIndex:0,children:w},w)),m=g=>{g.preventDefault(),g.stopPropagation(),o({value:null,questionId:i,type:s})},v=()=>u("div",{children:[u("div",{className:"ul-card--nps__numbers",children:f}),u("div",{className:"ul-card--nps__labels",children:[u("span",{children:h}),u("span",{children:p})]}),!r.required&&u("div",{className:"ul-vertical-centered-container",children:u(K,{onClick:m,children:qe(r)})})]});return u("div",{className:R(ue(b.CardMainContent,l)),children:u("form",{className:R([e,"ul-card--nps",b.FadeInTransition]),children:[u(pe,{message:n,properties:r}),u(Le,{properties:r,defaultBody:v})]},i)})},Ps=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{border:s,headers:a,useMobileStyling:c,update:d}=F(C=>({border:C.border,headers:C.headers,useMobileStyling:C.useMobileStyling,update:C.update})),[l,h]=Y(""),p=ke(null),f=a["userleap-platform"],m=l.trim(),v=r.required===!0&&!m,g=xo(p,()=>d()),w=C=>{g(),C.preventDefault(),C.stopPropagation(),Qe(C.target)&&h(C.target.value)},y=C=>{C.preventDefault(),C.stopPropagation(),n({value:l,questionId:o,type:i})},j=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",x=C=>{Qe(C.target)&&(C.target.style.borderColor=s)},U=C=>{Qe(C.target)&&(C.target.style.borderColor=en)},D=()=>u("div",{className:"ul-card-text",children:[u("div",{className:"ul-card-text__container",children:u("textarea",{"aria-label":j,"aria-labelledby":b.QuestionHeader,"aria-multiline":"true","aria-placeholder":j,className:R(q(b.OpenTextInput,c)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:U,onChange:w,onFocus:x,placeholder:j,ref:p,role:"textbox",tabIndex:0})}),u(K,{disabled:v,onClick:y,style:{backgroundColor:v?"":s},children:qe(r)})]});return u("div",{className:R(ue(b.CardMainContent,f)),children:u("form",{className:R([e,"ul-card--text",b.FadeInTransition]),id:"text-form",children:[u(pe,{message:t,properties:r}),u(Le,{defaultBody:D,properties:r})]},o)})};var xe=(e=>(e[e.RequestNeeded=1]="RequestNeeded",e[e.TryAgain=2]="TryAgain",e[e.Ready=3]="Ready",e))(xe||{});const Tt=e=>e.type===J.AvPermission,Eo=e=>e.type===J.ScreenPermission,Rs=(e,t)=>!(Tt(t)?t.permissionDescriptors:[]).includes(Be.Camera)||e.getVideoTracks().length>0,Lo=(e,t)=>{if(e===void 0)return xe.RequestNeeded;if(e){if(!Rs(e,t))return xe.RequestNeeded}else return xe.TryAgain;return xe.Ready},Kn={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},de=vo(e=>({...Kn,reset:()=>{e(Kn)},updatePage:t=>{e(t)}}));function Zt({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:o}=de.getState(),{recorderEventEmitter:i}=F.getState();i.emit(Z.AvPermission,{[A.PermissionDescriptors]:e.permissionDescriptors,[A.StreamReadyCallback]:(s,a)=>{if(n===s)return;let c=e;if(s&&!e.permissionDescriptors.includes(Be.Camera)){const d=t.indexOf(e),l=a!=null&&a.active?d+2:d+1;(a==null?void 0:a.active)&&r&&i.emit(Z.BeginRecording,{[A.RecordingMediaTypes]:r,[A.StartRecordingCallback]:h=>o({mediaRecordingUids:h})}),c=t[l]}o({currentPage:c,avStream:s})},[A.StreamCanceledCallback]:()=>{nt({status:ee.Abandoned})}})}function js({pages:e,userId:t,responseGroupUid:n,surveyId:r,questionId:o,next:i}){const{updatePage:s}=de.getState(),{eventEmitFn:a,recorderEventEmitter:c}=F.getState(),d={questionId:o,surveyId:r,visitorId:t,responseGroupUid:n};let l=0;c.emit(X.RecordedTaskPermissionScreen),a(X.RecordedTaskPermissionScreen),c.emit(Z.PermissionStatus,{[A.PermissionStatusCallback]:(p,f,m)=>{const v=e[l],{type:g}=v,w=[me.Screen];if(Tt(v)){const{permissionDescriptors:y}=v,j=y==null?void 0:y.includes(Be.Microphone),x=y==null?void 0:y.includes(Be.Camera);j&&w.push(me.Audio),x&&w.push(me.Video);const U=(p==null?void 0:p.active)&&!x,D=(p==null?void 0:p.active)&&f;(U||D)&&l++}Eo(e[l])&&m&&(l++,c.emit(Z.BeginRecording,{[A.RecordingMediaTypes]:w,[A.StartRecordingCallback]:y=>s({mediaRecordingUids:y})})),s({currentPage:e[l],avStream:p,screenPermissionRequested:m,nextQuestion:i,type:g,passthroughData:d,recordingMediaTypes:w})}});const h=e[l];return h.type===J.AvPermission&&Zt({currentPage:h,pages:e}),h}function nt({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:o}=de.getState(),{recorderEventEmitter:i,handleUploadUpdate:s,index:a}=F.getState(),c={value:{taskStatus:e},type:E.RecordedTask,questionId:(n==null?void 0:n.questionId)||1};!n||i.emit(Z.FinishTask,{[A.BeginCallback]:d=>{s({mediaRecordingUid:d,isSubmitted:!0,progressPct:0,isComplete:!1})},[A.ProgressCallback]:(d,l)=>{s({mediaRecordingUid:d,progressPct:l.detail,isSubmitted:!1,isComplete:!1})},[A.UploadCallback]:d=>{d&&s({mediaRecordingUid:d,isComplete:!0,isSubmitted:!0,progressPct:100})},[A.PassthroughData]:n,[A.CurrentIndex]:a,[A.TaskResponse]:c,[A.TaskCompleteCallback]:d=>{c.value.taskDurationMillisecond=d,r&&(c.value.mediaRecordingUids=r),o(),t(c)}})}function un({pages:e}){const{recorderEventEmitter:t,eventEmitFn:n}=F.getState(),{updatePage:r,currentPage:o,recordingMediaTypes:i,screenPermissionRequested:s}=de.getState();if(!o)return;const a=e.indexOf(o);switch(o.type){case J.AvPermission:{const c=s?a+2:a+1;s&&i&&t.emit(Z.BeginRecording,{[A.RecordingMediaTypes]:i,[A.StartRecordingCallback]:d=>{r({mediaRecordingUids:d})}}),r({currentPage:e[c]});return}case J.ScreenPermission:t.emit(Z.ScreenPermission,{[A.StreamReadyCallback]:(c,d)=>{const l=d?e[a+1]:o;d&&i&&t.emit(Z.BeginRecording,{[A.RecordingMediaTypes]:i,[A.StartRecordingCallback]:h=>{r({mediaRecordingUids:h})}}),r({currentPage:l,screenPermissionRequested:!0})},[A.StreamCanceledCallback]:()=>{nt({status:ee.Abandoned})}});return;case J.StartTask:n(X.RecordedTaskStart),t.emit(X.RecordedTaskStart),t.emit(Z.StartTask),r({currentPage:e[a+1],screenPermissionRequested:!0});return;case J.CompleteTask:return}}const Uo="ul-permission-graphics-container",Io="ul-permission-body",To=R([Uo,"ul_recorded-task-inset-spacing"]),Pt=R(["ul-horizontal-button-container","ul-horizontal-button-container-left"]),Po=({richTextBody:e})=>u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),pn=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:u(K,{className:R([n&&"ul-skip-button-below",b.InactiveButton]),onClick:nt.bind(null,{status:ee.Abandoned}),children:t||"Skip"}),Os=({content:e,pages:t})=>{const{buttonText:n,taskDetail:r}=e;return u("div",{className:"ul-task-page",children:[u(Po,{richTextBody:r}),u("div",{className:Pt,children:u(K,{onClick:un.bind(null,{pages:t}),children:n})})]},"start-task")},As=({content:e,properties:t})=>{const{buttonText:n,skipButtonText:r}=e,i=u(Le,{properties:t,defaultBody:()=>u("div",{className:Pt,children:[u(K,{className:"ul-complete-task-button",onClick:nt.bind(null,{status:ee.Completed}),children:n}),u(K,{className:R([b.InactiveButton]),onClick:nt.bind(null,{status:ee.GivenUp}),children:r})]})});return u("div",{className:"ul-task-page",children:[u(Po,{richTextBody:e.taskDetail}),i]},"complete-task")},Ds=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:o}=e,[i]=F(s=>[s.tabTitle]);return u("div",{children:[u("div",{className:To,children:[u("p",{style:{marginTop:"auto"},children:e.selectTabText}),u("div",{className:"ul-select-tab-container",children:u("p",{className:Io,children:i})})]}),u("div",{className:n?"":Pt,children:[u(K,{onClick:un.bind(null,{pages:t}),children:r}),u(pn,{required:n,skipButtonText:o})]})]})},Ns=({content:e})=>u("div",{className:R([Uo,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"]),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),Ms=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:o,skipButtonText:i,tryAgainButtonText:s}=e,a=Tt(t[0])?t[0]:null;return oe(()=>{const c=setInterval(()=>{a!==null&&Zt({currentPage:a,pages:t})},1e3);return()=>clearInterval(c)},[a,t]),a?u("div",{children:[u("div",{className:To,children:u("p",{className:"ul-av-permission-denied-paragraph",children:[u("span",{className:"ul-av-permission-denied-headline",children:r}),u("span",{className:Io,children:o})]})}),u("div",{className:Pt,children:[u(K,{onClick:Zt.bind(null,{currentPage:a,pages:t}),children:s}),u(pn,{required:n,skipButtonText:i})]})]}):null},Vs=({stream:e})=>u("video",{autoPlay:!0,className:R(["ul_recorded-task-inset-spacing"]),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),Hs=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,o=de(i=>i.avStream);return u("div",{children:[u(Vs,{stream:o}),u("div",{className:"ul-vertical-button-container-center",children:[u(K,{onClick:un.bind(null,{pages:t}),children:e.buttonText}),u(pn,{bottom:!0,required:n,skipButtonText:r})]})]})},$s=({properties:e})=>{const{pages:t,required:n}=e,r=de(i=>i.avStream),o=de(i=>i.currentPage);if(o===void 0)return null;switch(o==null?void 0:o.type){case J.AvPermission:{const i=Lo(r,o);return i===xe.RequestNeeded?u(Ns,{content:o}):i===xe.TryAgain?u(Ms,{content:o,pages:t,required:n}):u(Hs,{content:o,pages:t,required:n})}case J.ScreenPermission:return u(Ds,{content:o,pages:t,required:n});case J.StartTask:return u(Os,{content:o,pages:t});case J.CompleteTask:return u(As,{content:o,properties:e});default:return null}},Bs=({className:e,properties:t,next:n,questionId:r})=>{const o=F(),{headers:i,surveyId:s,responseGroupUid:a,userId:c}=o,d=de(),{screenPermissionRequested:l}=d,h=de(g=>g.avStream);let p=de(g=>g.currentPage);p||(p=js({questionId:r,surveyId:s,next:g=>{n(g)},pages:t.pages,responseGroupUid:a,userId:c}));let f=p.headline,m=p.captionText;const v=Lo(h,p);return Eo(p)&&l&&(f=p.permissionDeniedHeadline,m=p.permissionDeniedCaptionText),Tt(p)&&v===xe.Ready&&(f=p.permissionGrantedHeadline,m=p.permissionGrantedCaptionText),u("div",{className:R([...ue(b.CardMainContent,i["userleap-platform"])]),children:u("div",{className:R([e,"ul-center-horizontally",b.FadeInTransition]),children:[u(pe,{message:f,properties:{captionText:m}}),u($s,{properties:t})]})})},Fs={"{{user_id}}":"externalUserId","{{email}}":"email"},zs=(e=void 0,t={})=>{if(!e)return e;let n=e;const r=[];for(const[c,d]of Object.entries(Fs))if(n.toLowerCase().includes(c))if(t[d]){const l=new RegExp(c,"gi");n=n.replace(l,t[d])}else r.push(c);if(r.length===0||!n.includes("?"))return n;const o=n.slice(0,n.indexOf("?")),s=n.slice(n.indexOf("?")+1).split("&").map(c=>c.split("=")).filter(c=>!r.includes(c[1]));if(s.length===0)return o;const a=s.map(c=>c.join("=")).join("&");return`${o}?${a}`},qs=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{headers:s,visitorAttributes:a}=F(f=>({headers:f.headers,visitorAttributes:f.visitorAttributes})),c=s["userleap-platform"],d=(f,m=!1)=>{n({value:m?{skipped:!0}:void 0,questionId:o,type:i})},l=f=>{(f.key==="Enter"||f.key===" ")&&n({value:void 0,questionId:o,type:i})},h=()=>u("div",{className:"ul-card-button-group",children:[u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:zs(r&&r.buttonUrl,a),id:"ul-card-text__button",onClick:d,onKeyPress:l,rel:"noreferrer",role:"button",tabIndex:0,target:"_blank",children:qe(r)}),r.required===!1&&u("button",{className:"ul-card-skip__button",onClick:f=>d(f,!0),children:dn(r)})]}),p=(f,m)=>f?u("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:f},id:"ul-card__text-url-body-container"}):u("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(m?m.split(/\n\s*\n/g):[]).map((v,g)=>u("p",{children:v},g))});return u("div",{className:R(ue(b.CardMainContent,c)),children:u("div",{className:R([e,"ul-card__text-url-prompt",b.FadeInTransition]),children:[u(pe,{message:t}),p(r&&r.richTextBody,r&&r.body),u(Le,{defaultBody:h,properties:r})]},o)})},Ws=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:o,headers:i}=F(c=>({border:c.border,endCard:c.endCard,destroy:c.destroy,headers:c.headers}));oe(()=>{setTimeout(()=>{r(Ne)},2e3)},[r]);const s=o&&o.subheader?u("p",{className:b.Caption,children:o.subheader}):null,a=o&&o.headline?o.headline:"";return u("div",{className:R(ue(b.CardMainContent,i["userleap-platform"])),children:u("div",{className:R([e,"ul-card--thanks",b.FadeInTransition]),children:u("div",{children:u("div",{className:"ul-card--thanks-content",children:[u("div",{className:"ul-thanks-check",children:u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:n,fillRule:"evenodd"}),u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:n,fillRule:"evenodd"}),u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),u(pe,{message:a}),s]})})},t)})},Ie="https://cdn.sprig.com",I={document:void 0,videojs:void 0},Gs=`/* progress control styles */
|
|
29
|
+
.video-js .vjs-control {
|
|
30
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.video-js .vjs-progress-control .vjs-progress-holder {
|
|
34
|
+
margin: 0 0px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.video-js .vjs-progress-control {
|
|
38
|
+
position: absolute;
|
|
39
|
+
height: 3px;
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
/* position and align the buttons and button texts */
|
|
43
|
+
.ul-control-panel {
|
|
44
|
+
bottom: 0;
|
|
45
|
+
width: 100%;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
background-color: white;
|
|
48
|
+
height: fit-content;
|
|
49
|
+
z-index: 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ul-buttons-panel {
|
|
53
|
+
color: black;
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 20px;
|
|
56
|
+
height: 50px;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
margin: 10px;
|
|
59
|
+
padding: 2px 14px 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.video-js .vjs-volume-panel {
|
|
63
|
+
height: 30px;
|
|
64
|
+
width: 40px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ul-inactive {
|
|
68
|
+
opacity: 0.3;
|
|
69
|
+
cursor: default;
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* buttons */
|
|
74
|
+
.ul-buttons-panel > .vjs-button {
|
|
75
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
display: flex;
|
|
78
|
+
height: 3em;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
width: 3em;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.vjs-button>.vjs-icon-placeholder:before {
|
|
84
|
+
align-items: center;
|
|
85
|
+
display: flex;
|
|
86
|
+
font-size: unset;
|
|
87
|
+
line-height: 0.5;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
span.ul-button-text {
|
|
92
|
+
align-self: flex-end;
|
|
93
|
+
position: relative;
|
|
94
|
+
top: 14px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#ul-camera-button {
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.video-js .vjs-volume-control.vjs-volume-horizontal {
|
|
102
|
+
background-color: #fff;
|
|
103
|
+
z-index: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {
|
|
107
|
+
background-color: black;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,
|
|
111
|
+
.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
|
|
112
|
+
.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active {
|
|
113
|
+
width: 40px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,
|
|
117
|
+
.video-js .vjs-volume-panel .vjs-volume-control:active,
|
|
118
|
+
.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control ~ .vjs-volume-control,
|
|
119
|
+
.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,
|
|
120
|
+
.video-js .vjs-volume-panel:active .vjs-volume-control,
|
|
121
|
+
.video-js .vjs-volume-panel:focus .vjs-volume-control {
|
|
122
|
+
visibility: visible;
|
|
123
|
+
left: 40px;
|
|
124
|
+
position: absolute;
|
|
125
|
+
transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* play button customization */
|
|
129
|
+
.video-js .vjs-play-control {
|
|
130
|
+
color: black;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.video-js .vjs-play-control .vjs-icon-placeholder:before {
|
|
134
|
+
content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* position and style the current timer */
|
|
138
|
+
.ul-time-panel {
|
|
139
|
+
position: absolute;
|
|
140
|
+
bottom: 80px;
|
|
141
|
+
left: 10px;
|
|
142
|
+
height: 22px;
|
|
143
|
+
color: black;
|
|
144
|
+
border: 1px solid #e0e0eb;
|
|
145
|
+
border-radius: 23px;
|
|
146
|
+
background-color: white;
|
|
147
|
+
width: fit-content;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.video-js .vjs-current-time,
|
|
151
|
+
.vjs-no-flex .vjs-current-time {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
text-align: center;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* remove the dot progress indicator */
|
|
158
|
+
.video-js .vjs-play-progress:before,
|
|
159
|
+
.video-js .vjs-volume-level:before,
|
|
160
|
+
.vjs-icon-circle:before,
|
|
161
|
+
.vjs-seek-to-live-control .vjs-icon-placeholder:before {
|
|
162
|
+
content: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.video-js .vjs-mute-control .vjs-icon-placeholder:before {
|
|
166
|
+
content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.825.324A.75.75 0 019.25 1v11.667a.75.75 0 01-1.219.585l-3.96-3.169H1a.75.75 0 01-.75-.75v-5a.75.75 0 01.75-.75h3.07L8.031.414a.75.75 0 01.794-.09zM7.75 2.56L4.802 4.92a.75.75 0 01-.469.164H1.75v3.5h2.583a.75.75 0 01.469.165l2.948 2.358V2.56zM14.911.47a.75.75 0 011.061 0 9.084 9.084 0 010 12.844.75.75 0 01-1.06-1.06 7.584 7.584 0 000-10.724.75.75 0 010-1.06zM11.97 3.41a.75.75 0 011.06 0 4.917 4.917 0 010 6.953.75.75 0 11-1.06-1.06 3.417 3.417 0 000-4.832.75.75 0 010-1.06z' fill='%23262136'/%3E%3C/svg%3E");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {
|
|
170
|
+
content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.5 1.167L4.333 4.5H1v5h3.333L8.5 12.833V1.167zM17.17 4.5l-5 5M12.17 4.5l5 5' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {
|
|
174
|
+
content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3C/svg%3E%0A");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {
|
|
178
|
+
content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.9698 3.41124C12.2627 3.11839 12.7376 3.11846 13.0304 3.4114C13.9521 4.33341 14.4699 5.58376 14.4699 6.88748C14.4699 8.19121 13.9521 9.44156 13.0304 10.3636C12.7376 10.6565 12.2627 10.6566 11.9698 10.3637C11.6768 10.0709 11.6767 9.596 11.9696 9.30307C12.6101 8.66235 12.9699 7.79346 12.9699 6.88748C12.9699 5.98151 12.6101 5.11262 11.9696 4.4719C11.6767 4.17896 11.6768 3.70409 11.9698 3.41124Z' fill='%23262136'/%3E%3C/svg%3E%0A");
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.video-js .vjs-volume-control:hover .vjs-mouse-display {
|
|
182
|
+
display: none !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.video-js .vjs-play-progress {
|
|
186
|
+
background-color: black;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* position video player inside the container */
|
|
190
|
+
.video-js .vjs-tech {
|
|
191
|
+
position: static;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.video-js .vjs-time-tooltip {
|
|
195
|
+
padding: 0.25em 0.75em;
|
|
196
|
+
align-items: center;
|
|
197
|
+
color: #333;
|
|
198
|
+
background: #FCFCFD;
|
|
199
|
+
border-radius: 99px;
|
|
200
|
+
text-align: center;
|
|
201
|
+
border: 1px solid #E0E0EB;
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
top: -25px;
|
|
206
|
+
font-size: 12px !important;
|
|
207
|
+
width: 50px !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.video-js .vjs-play-progress.vjs-slider-bar .vjs-time-tooltip {
|
|
211
|
+
visibility: hidden !important;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.video-js .vjs-progress-control .vjs-mouse-display {
|
|
215
|
+
z-index: 2;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ul-video-player {
|
|
219
|
+
width: 100%;
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
height: auto;
|
|
223
|
+
border: 1px solid #E6E6E6;
|
|
224
|
+
background-color: white;
|
|
225
|
+
box-sizing: border-box;
|
|
226
|
+
border-radius: 4px;
|
|
227
|
+
background-clip: border-box;
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.video-js.vjs-fullscreen:not(.vjs-ios-native-fs) {
|
|
232
|
+
border: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
#video-response-player-secondary-video-player {
|
|
236
|
+
max-width: 200px;
|
|
237
|
+
margin-right: 20px;
|
|
238
|
+
background-color: transparent;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
#ul-card-video__player_recorder-video-recorder.vjs-fullscreen {
|
|
242
|
+
display: table;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.video-js div.vjs-progress-control {
|
|
246
|
+
margin-top: -3px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.video-js .vjs-progress-control .vjs-slider {
|
|
250
|
+
background-color: #B2BBBD;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.vjs-record.video-js .vjs-control.vjs-button.vjs-fullscreen-control {
|
|
254
|
+
position:relative;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {
|
|
258
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.82143 2.54004L12.2614 2.54004C12.9242 2.54004 13.4614 3.0773 13.4614 3.74004L13.4614 6.18004' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.17955 13.46L3.73955 13.46C3.07681 13.46 2.53955 12.9227 2.53955 12.26L2.53955 9.81996' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12.7772 3.22266L9.36475 6.63516' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.29434 9.70605L2.88184 13.1186' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {
|
|
262
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.583 9.813H5.25a1 1 0 011 1v3.666M5.375 10.688L1 15.061M14.917 5.813H11.25a1 1 0 01-1-1V1.146M15.063 1l-4.376 4.375' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before, .video-js .vjs-icon-replay:before {
|
|
266
|
+
content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before, .vjs-icon-pause:before {
|
|
270
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3.61885' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3Crect x='9.21797' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3C/svg%3E%0A");
|
|
271
|
+
padding: 2px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.vjs-error-display {
|
|
275
|
+
display: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.ul-video-player-video {
|
|
279
|
+
position: relative;
|
|
280
|
+
top: 0;
|
|
281
|
+
left: 0;
|
|
282
|
+
width: 100%;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.ul-video-container {
|
|
286
|
+
width: 100%;
|
|
287
|
+
height: auto;
|
|
288
|
+
left: 0px;
|
|
289
|
+
top: 0px;
|
|
290
|
+
|
|
291
|
+
background-color: transparent;
|
|
292
|
+
border-radius: 4px;
|
|
293
|
+
|
|
294
|
+
align-items: start;
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
|
|
298
|
+
/* Inside Auto Layout */
|
|
299
|
+
|
|
300
|
+
flex: none;
|
|
301
|
+
order: 0;
|
|
302
|
+
flex-grow: 0;
|
|
303
|
+
margin: 10px 0px;
|
|
304
|
+
position: relative;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.vjs-record button.vjs-device-button.vjs-control {
|
|
308
|
+
background: rgba(255, 255, 255, 96);
|
|
309
|
+
width: 100%;
|
|
310
|
+
height: 100%;
|
|
311
|
+
left: 0;
|
|
312
|
+
top: 0;
|
|
313
|
+
margin: 0;
|
|
314
|
+
border-radius: 0;
|
|
315
|
+
line-height: 0.6;
|
|
316
|
+
padding: 10px;
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
flex-direction: column;
|
|
320
|
+
justify-content: center;
|
|
321
|
+
z-index: 3;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.vjs-record .vjs-device-button.vjs-control:before {
|
|
325
|
+
font-size: 14px !important;
|
|
326
|
+
color: #333;
|
|
327
|
+
content: "Your browser needs to access your camera and microphone for video recording";
|
|
328
|
+
line-height: 135%;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.vjs-record .vjs-device-button.vjs-control.permission-denied:before {
|
|
332
|
+
font-size: 16px !important;
|
|
333
|
+
color: #262136;
|
|
334
|
+
content: "Unable to access your camera and microphone";
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.vjs-record .vjs-device-button.vjs-control:after {
|
|
338
|
+
display: inline-block;
|
|
339
|
+
background: #F0F0F5;
|
|
340
|
+
font-size: 13px;
|
|
341
|
+
border-radius: 4px;
|
|
342
|
+
content: "Request Permissions";
|
|
343
|
+
padding: 1em 2em;
|
|
344
|
+
color: #333;
|
|
345
|
+
margin-top: 20px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.vjs-record .vjs-device-button.vjs-control.permission-denied:after {
|
|
349
|
+
display: inline-block;
|
|
350
|
+
background: white;
|
|
351
|
+
font-size: 13px;
|
|
352
|
+
content: "Please go to your browser settings and update permissions to enable recording";
|
|
353
|
+
padding: 1em;
|
|
354
|
+
color: #4B575D;
|
|
355
|
+
margin: 5px;
|
|
356
|
+
line-height: 135%;
|
|
357
|
+
text-align: center;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.vjs-control.vjs-button.ul-video-recorder-delete-button, .vjs-control.vjs-button.ul-video-recorder-toggle-button, .vjs-control.vjs-button.ul-video-recorder-camera-off-button-audio-only, .vjs-control.vjs-button.ul-video-recorder-camera-off-button {
|
|
361
|
+
cursor: pointer;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.ul-video-recorder-delete-button .vjs-icon-placeholder:before {
|
|
365
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.21234 7.37549V11.1193M2.53931 4.25595H13.4593H2.53931ZM5.57234 4.25595V3.00833C5.57222 2.84433 5.60354 2.68192 5.6645 2.53038C5.72546 2.37884 5.81488 2.24115 5.92762 2.12519C6.04037 2.00922 6.17424 1.91726 6.32158 1.85456C6.46892 1.79185 6.62683 1.75964 6.78628 1.75977H9.21234C9.37179 1.75964 9.5297 1.79185 9.67703 1.85456C9.82437 1.91726 9.95824 2.00922 10.071 2.12519C10.1837 2.24115 10.2732 2.37884 10.3341 2.53038C10.3951 2.68192 10.4264 2.84433 10.4263 3.00833V4.25595H5.57234ZM12.2463 4.25595V12.9912C12.2463 13.3223 12.1184 13.6399 11.8907 13.8741C11.6631 14.1082 11.3543 14.2398 11.0323 14.2398H4.96628C4.64432 14.2398 4.33555 14.1082 4.10789 13.8741C3.88023 13.6399 3.75234 13.3223 3.75234 12.9912V4.25595H12.2463ZM6.78628 7.37549V11.1193V7.37549Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.ul-video-recorder-toggle-button .vjs-icon-placeholder:before {
|
|
369
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0Z' fill='%23D15153'/%3E%3C/svg%3E");
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.ul-video-recorder-toggle-button.ul-recording-in-session .vjs-icon-placeholder:before {
|
|
373
|
+
content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10L12 2C12 0.89543 11.1046 -4.85396e-07 10 -4.37114e-07L2 -8.74228e-08C0.89543 -3.91405e-08 -4.85396e-07 0.895431 -4.37114e-07 2L-8.74228e-08 10C-3.91405e-08 11.1046 0.895431 12 2 12L10 12C11.1046 12 12 11.1046 12 10Z' fill='%23D15153'/%3E%3C/svg%3E%0A");
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.ul-video-recorder-camera-off-button .vjs-icon-placeholder:before {
|
|
377
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.ul-video-recorder-camera-off-button-audio-only .vjs-icon-placeholder:before {
|
|
381
|
+
content: url("data:image/svg+xml,%3Csvg width='22' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.75 3A2.75 2.75 0 013.5.25h9.081A2.75 2.75 0 0115.331 3v9a2.75 2.75 0 01-2.75 2.75H3.5A2.75 2.75 0 01.75 12V3zM3.5 1.75c-.69 0-1.25.56-1.25 1.25v9c0 .69.56 1.25 1.25 1.25h9.081c.69 0 1.25-.56 1.25-1.25V3c0-.69-.56-1.25-1.25-1.25H3.5z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.53 2.03l-12 12-1.06-1.06 12-12 1.06 1.06zM20.87 1.525a.75.75 0 01.38.652v10.588a.75.75 0 01-1.134.644l-5.92-3.53a.75.75 0 01-.365-.643v-3.53a.75.75 0 01.366-.644l5.919-3.53a.75.75 0 01.754-.007zm-5.539 4.607V8.81l4.419 2.635V3.497l-4.419 2.635z' fill='%23262136'/%3E%3C/svg%3E");
|
|
382
|
+
transform: scale(0.75);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.ul-upload-progress-label {
|
|
386
|
+
padding: 0.15em 0.75em;
|
|
387
|
+
align-items: center;
|
|
388
|
+
font-size: 12px;
|
|
389
|
+
color: #333;
|
|
390
|
+
background: #FCFCFD;
|
|
391
|
+
border-radius: 99px;
|
|
392
|
+
text-align: center;
|
|
393
|
+
border: 1px solid #E0E0EB;
|
|
394
|
+
display: flex;
|
|
395
|
+
align-items: center;
|
|
396
|
+
justify-content: center;
|
|
397
|
+
position: absolute;
|
|
398
|
+
bottom: 75px;
|
|
399
|
+
left: calc(50% - 65px);
|
|
400
|
+
width: 130px;
|
|
401
|
+
z-index: 5;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.ul-upload-progress-label__time {
|
|
405
|
+
display: inline-flex;
|
|
406
|
+
margin-left: 0.8em;
|
|
407
|
+
align-items: center;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.ul-upload-progress-label__time:before {
|
|
411
|
+
content: "";
|
|
412
|
+
display: inline-flex;
|
|
413
|
+
width: 1px;
|
|
414
|
+
height: 12px;
|
|
415
|
+
background-color: #E0E0EB;
|
|
416
|
+
margin-right: 0.8em;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
@keyframes grow {
|
|
420
|
+
0% {
|
|
421
|
+
transform: scale(1);
|
|
422
|
+
background-color: #EEECFC;
|
|
423
|
+
}
|
|
424
|
+
50% {
|
|
425
|
+
transform: scale(1.2);
|
|
426
|
+
background-color: #E1DFF4;
|
|
427
|
+
}
|
|
428
|
+
100% {
|
|
429
|
+
transform: scale(1);
|
|
430
|
+
background-color: #EEECFC;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.ul-audio-recorder-placeholder:before {
|
|
435
|
+
width: 80px;
|
|
436
|
+
height: 80px;
|
|
437
|
+
border-radius: 120px;
|
|
438
|
+
background-color: #EEECFC;
|
|
439
|
+
content: "";
|
|
440
|
+
position: absolute;
|
|
441
|
+
left: calc(50% - 40px);
|
|
442
|
+
top: calc(50% - 40px);
|
|
443
|
+
animation: 6s infinite grow;
|
|
444
|
+
transform-origin: 50% 60%;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.ul-audio-recorder-placeholder:after {
|
|
448
|
+
content: url("data:image/svg+xml,%3Csvg width='98' height='98' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='98' height='98'%3E%3Ccircle cx='49' cy='49' r='49' fill='%23EDECF8'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Ccircle cx='49' cy='49' r='50' fill='%23645CC2'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.422 81.812c5.405-15.547 20.187-26.706 37.576-26.706 17.39 0 32.172 11.159 37.577 26.707-9.164 10.43-22.601 17.013-37.576 17.013-14.976 0-28.414-6.583-37.577-17.014z' fill='%23fff' fill-opacity='.6'/%3E%3Ccircle cx='49' cy='29' r='17' fill='%23fff' fill-opacity='.7'/%3E%3C/g%3E%3C/svg%3E");
|
|
449
|
+
position: absolute;
|
|
450
|
+
left: 50%;
|
|
451
|
+
top: 50%;
|
|
452
|
+
transform: translate(-50%, -50%);
|
|
453
|
+
transform: translate(-50%, -50%) scale(0.6);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.ul-audio-recorder-placeholder {
|
|
457
|
+
min-height: 150px;
|
|
458
|
+
width: 100%;
|
|
459
|
+
background-color: #fcfcfd;
|
|
460
|
+
display: block;
|
|
461
|
+
position: relative;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.vjs-fullscreen .ul-audio-recorder-placeholder {
|
|
465
|
+
vertical-align: middle;
|
|
466
|
+
display: table-cell;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.vjs-fullscreen .ul-control-panel {
|
|
470
|
+
height: 80px;
|
|
471
|
+
position: absolute;
|
|
472
|
+
bottom: 0;
|
|
473
|
+
left: 0;
|
|
474
|
+
width: 100%;
|
|
475
|
+
max-width: 100%;
|
|
476
|
+
background-color: #F8F8F8;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.vjs-playback-rate .vjs-playback-rate-value {
|
|
480
|
+
align-items: center;
|
|
481
|
+
display: flex;
|
|
482
|
+
font-size: 12px;
|
|
483
|
+
justify-content: center;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.vjs-playback-rate .vjs-menu {
|
|
487
|
+
left: -5px;
|
|
488
|
+
bottom: 3px;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.vjs-menu-button-popup .vjs-menu .vjs-menu-content {
|
|
492
|
+
background-color: white;
|
|
493
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
494
|
+
box-sizing: border-box;
|
|
495
|
+
border-radius: 4px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.vjs-menu li {
|
|
499
|
+
font-size: 12px;
|
|
500
|
+
padding: 5px 0;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.vjs-menu li.vjs-selected {
|
|
504
|
+
color: lightgray;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.vjs-menu li.vjs-menu-item:hover {
|
|
508
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.vjs-fullscreen .ul-buttons-panel {
|
|
512
|
+
top: calc(50% - 30px);
|
|
513
|
+
position: relative;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.vjs-fullscreen .vjs-record-indicator.vjs-control {
|
|
517
|
+
bottom: 90px !important;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.vjs-record.video-js div.vjs-control.vjs-record-indicator {
|
|
521
|
+
padding: 0.3em 0.75em 0.15em 15px;
|
|
522
|
+
align-items: center;
|
|
523
|
+
font-size: 12px;
|
|
524
|
+
color: #333;
|
|
525
|
+
background: #FCFCFD;
|
|
526
|
+
border-radius: 99px;
|
|
527
|
+
text-align: center;
|
|
528
|
+
border: 1px solid #E0E0EB;
|
|
529
|
+
display: flex;
|
|
530
|
+
justify-content: center;
|
|
531
|
+
align-items: center;
|
|
532
|
+
position: absolute;
|
|
533
|
+
bottom: 75px;
|
|
534
|
+
top: auto;
|
|
535
|
+
left: calc(50% - 21px);
|
|
536
|
+
width: 43px;
|
|
537
|
+
height: 16px;
|
|
538
|
+
z-index: 4;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.vjs-record.video-js div.vjs-control.vjs-record-indicator:after {
|
|
542
|
+
content: "";
|
|
543
|
+
background-color: #EB5757;
|
|
544
|
+
width: 6px;
|
|
545
|
+
height: 6px;
|
|
546
|
+
border-radius: 8px;
|
|
547
|
+
animation: none;
|
|
548
|
+
top: 4px;
|
|
549
|
+
left: 5px;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.vjs-record.video-js div.vjs-control.vjs-record-indicator:before {
|
|
553
|
+
position: relative;
|
|
554
|
+
font-size: 9px;
|
|
555
|
+
animation: none;
|
|
556
|
+
opacity: 1;
|
|
557
|
+
color: #333;
|
|
558
|
+
top: auto;
|
|
559
|
+
left: auto;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.ul-video-player-loading {
|
|
563
|
+
display: inline-block;
|
|
564
|
+
position: relative;
|
|
565
|
+
width: 6rem;
|
|
566
|
+
height: 6rem;
|
|
567
|
+
|
|
568
|
+
}
|
|
569
|
+
.ul-video-player-loading div {
|
|
570
|
+
box-sizing: border-box;
|
|
571
|
+
position: absolute;
|
|
572
|
+
display: block;
|
|
573
|
+
width: 80%;
|
|
574
|
+
height: 80%;
|
|
575
|
+
margin: 5px;
|
|
576
|
+
border: 5px solid #666;
|
|
577
|
+
border-radius: 50%;
|
|
578
|
+
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
579
|
+
border-color: #666 transparent transparent transparent;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.first {
|
|
583
|
+
animation-delay: -0.45s;
|
|
584
|
+
}
|
|
585
|
+
.second {
|
|
586
|
+
animation-delay: -0.3s;
|
|
587
|
+
}
|
|
588
|
+
.third {
|
|
589
|
+
animation-delay: -0.15s;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
@keyframes lds-ring {
|
|
593
|
+
0% {
|
|
594
|
+
transform: rotate(0deg);
|
|
595
|
+
}
|
|
596
|
+
100% {
|
|
597
|
+
transform: rotate(360deg);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.ul-video-btn {
|
|
602
|
+
width: 100%;
|
|
603
|
+
border: 1px solid #E6E6E6;
|
|
604
|
+
border-radius: 4px;
|
|
605
|
+
background-color: rgba(0, 0, 0, 0.02);
|
|
606
|
+
padding: 8px;
|
|
607
|
+
font-weight: 500;
|
|
608
|
+
font-size: 15px;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.ul-record-response-btn:before, .ul-record-response-btn:after, .ul-back-question-btn:before, .ul-back-question-btn:after {
|
|
612
|
+
margin: 0 5px;
|
|
613
|
+
vertical-align: middle;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.ul-record-response-btn:before {
|
|
617
|
+
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
|
|
618
|
+
display: inline-block;
|
|
619
|
+
transform: translate(0px, 2px);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.ul-record-response-btn:after {
|
|
623
|
+
content: 'Record your Response';
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.ul-back-question-btn:before {
|
|
627
|
+
content: url("data:image/svg+xml,%3Csvg width='15' height='16' viewBox='0 0 15 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.8757 8.22361L1.1118 14.6056C0.945578 14.6887 0.75 14.5678 0.75 14.382V1.61803C0.75 1.43219 0.945579 1.31131 1.1118 1.39443L13.8757 7.77639C14.06 7.86852 14.06 8.13148 13.8757 8.22361Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
628
|
+
display: inline-block;
|
|
629
|
+
transform: scale(0.85) translate(0, 1px);
|
|
630
|
+
-moz-transform: scale(0.85) translate(0, 2px);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.ul-back-question-btn:after {
|
|
634
|
+
content: 'Back to Question';
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.hidden {
|
|
638
|
+
display: none !important;
|
|
639
|
+
opacity: 0;
|
|
640
|
+
visibility: hidden;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.visible {
|
|
644
|
+
visibility: visible;
|
|
645
|
+
opacity: 1;
|
|
646
|
+
animation: fade 0.3s;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
@keyframes fade {
|
|
650
|
+
0% {
|
|
651
|
+
opacity: 0;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
100% {
|
|
655
|
+
opacity: 1;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
#ul-recording-countdown-screen {
|
|
660
|
+
width: 100%;
|
|
661
|
+
height: 100%;
|
|
662
|
+
color: black;
|
|
663
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
664
|
+
position: absolute;
|
|
665
|
+
text-align: center;
|
|
666
|
+
font-size: 15px;
|
|
667
|
+
z-index: 1;
|
|
668
|
+
display: table;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.ul-countdown-text {
|
|
672
|
+
vertical-align: middle;
|
|
673
|
+
display: table-cell;
|
|
674
|
+
transform: translate(0, -25px);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.vjs-fullscreen > #ul-recording-countdown-screen {
|
|
678
|
+
font-size: 25px;
|
|
679
|
+
transform: unset;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.vjs-poster {
|
|
683
|
+
background-size: cover;
|
|
684
|
+
}
|
|
685
|
+
`,Zs=e=>{const t=I.document.createElement("div");return t.className="ul-video-player-loading",t.id=fn(e),["first","second","third","fourth"].map(n=>{const r=I.document.createElement("div");r.className=n,t.appendChild(r)}),t},fn=e=>e+"-loading-spiner",W="hidden",Qn=".m3u8",Nt="questionId",Mt="ul-video-recorder-camera-off-button",Vt="ul-recording-in-session",Ys=[{type:"link",content:`${Ie}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${Ie}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${Ie}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${Ie}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${Ie}/userleap-web-upchunk-v2.2.2.js`}],Ro=[{type:"link",content:`${Ie}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${Ie}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:Gs}],jo="-video-player",Oo="-secondary-video-player",Ao="-video-recorder";let ae,Jn;const ye=async({event:e,apiBase:t,headers:n,visitorId:r,envId:o,metadata:i})=>{const s=I.document.documentElement;if(!r||!o)return;const a={event:`SDK - ${e}`,visitorId:r,environmentId:o,metadata:{...i||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${t}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:n,body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",e)},he=async(e,t,n,r,o,i)=>{ye({event:`Video Error ${t}`,apiBase:n,headers:r,visitorId:o,envId:i,metadata:{errorMessage:e.message}});const s=I.document.documentElement,a={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:s.clientWidth,clientHeight:s.clientHeight,location:window.location.href,language:navigator.language},c={action:t,err:{message:e.message,stack:e.stack},meta:a,vid:o,envId:i};(await fetch(`${n}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",e)},Ks=(e,{type:t,content:n})=>new Promise(function(r,o){let i;t==="script"?(i=I.document.createElement("script"),i.src=n):t==="link"?(i=I.document.createElement("link"),i.rel="stylesheet",i.href=n,i.type="text/css"):(i=I.document.createElement("style"),i.innerHTML=n),i.onload=function(){r(n)},i.onerror=function(){o(n)},i.async=!1,i.id=btoa(n),e.appendChild(i)}),Do=(e,t)=>{if(e.length===0)return t&&t();Promise.all(e.reduce((n,r)=>(n.push(Ks(I.document.head,r)),n),[])).then(()=>{I.videojs=I.document.defaultView.videojs,t&&t()}).catch(function(n){console.log(n+" failed to load")})},Xn=(e,t,n)=>{if(t==="start"&&(e.style.visibility="visible"),t==="none")e.style.visibility=W;else if(t==="success")e.style.visibility=W,e.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(n));e.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,e.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},Ht=(e,t)=>{const n=I.videojs(e.id());return n==null?void 0:n.payload[t]},Qs=(e,t,n,r,o)=>{const{surveyId:i,responseGroupUid:s,visitorId:a,envId:c}=e.payload;e.on("deviceError",function(){console.warn("device error: ",e.deviceErrorCode),e.deviceErrorCode.message==="Permission denied"?(e.deviceButton.addClass("permission-denied"),n&&n(O.ERROR,{type:O.PERMISSION_DENIED}),ye({event:"Video Permission Denied",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{questionId:Ht(e,Nt),responseGroupUid:s,surveyId:i}})):(n&&n(O.ERROR,{type:O.OTHER}),he(new Error(e.deviceErrorCode.message),"recorderDeviceError",t,o,a,c))}),e.on("error",function(d,l){he(l||e.error(),"recorderError",t,o,a,c)}),e.on("startRecord",function(d,l){r(e.uploadProgressLabel,"none"),ye({event:"Video Record Start",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{questionId:Ht(e,Nt),responseGroupUid:s,surveyId:i}})}),e.on("finishRecord",async function(){r(e.uploadProgressLabel,"start",0);const d=Ht(e,Nt);if(!i){const v="internal error: missing fields in payload";return n&&n(O.ERROR,{type:O.OTHER}),he(new Error(v),"finishRecord",t,o,a,c),null}e.record().stopDevice();const l=e.cameraOff?O.MEDIA_TYPE_AUDIO:O.MEDIA_TYPE_VIDEO,h=_t();ye({event:"Video Record Finish",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{mediaRecordingUid:h,questionId:d,responseGroupUid:s,surveyId:i,mediaType:l}});const p={surveyId:i,updatedAt:new Date().toISOString(),mediaType:l,mediaRecordingUid:h};d&&(p.questionId=d),s&&(p.responseGroupUid=s),a&&(p.visitorId=a);const m=await(async()=>{const v=await fetch(`${t}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(v.ok){const g=await v.json();return n&&n(O.UPLOAD_STARTED,{[O.UPLOAD_ID]:g.upload.id,[O.MEDIA_TYPE]:l,[O.MEDIA_RECORDING_UID]:h}),g.upload.url}else return n&&n(O.ERROR,{type:O.OTHER,response:v}),he(new Error("failed to get upload response with url"),"finishRecord",t,o,a,c),null})();!m||(ae=I.document.defaultView.UpChunk.createUpload({endpoint:m,file:new I.document.defaultView.File([e.recordedData],`recording ${l} ${Date.now()}`),chunkSize:5120}),ae.startTime=Date.now(),ye({event:"Video Upload Start",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{mediaRecordingUid:h,questionId:d,responseGroupUid:s,surveyId:i,mediaType:l,url:m}}),ae.on("error",v=>{r(e.uploadProgressLabel,"none"),n&&n(O.UPLOAD_FINISHED,{[O.MEDIA_RECORDING_UID]:h}),he(v,"finishRecord",t,o,a,c)}),ae.on("progress",v=>{n&&n(O.UPLOAD_PROGRESS,{[O.MEDIA_RECORDING_UID]:h,[O.UPLOAD_PROGRESS_PCT]:v.detail}),r(e.uploadProgressLabel,"progress",v.detail)}),ae.on("success",()=>{r(e.uploadProgressLabel,"success"),n&&n(O.UPLOAD_FINISHED,{[O.MEDIA_RECORDING_UID]:h}),ye({event:"Video Upload Success",apiBase:t,headers:o,visitorId:a,envId:c,metadata:{mediaRecordingUid:h,questionId:d,responseGroupUid:s,surveyId:i,mediaType:l,url:m,elapsedMs:ae.startTime&&Date.now()-ae.startTime}})}))})},No=(e,t)=>{const n=new(I.videojs.getComponent("Component"))(e);return n.addClass("ul-buttons-panel"),t.map(r=>{n.addChild(r)}),Js(n),n},Js=e=>{e.children().forEach(t=>{if(te[t.name_]){const n=vt(te[t.name_],`ul-${te[t.name_]}`);t.el_.appendChild(n)}})},vt=(e,t="")=>{const n=I.document.createElement("span");return n.className="ul-button-text",n.innerHTML=e,n.id=t,n},Mo=(e,t,n,r,o=!1,i)=>{e.addClass("ul-video-player");const s=new(I.videojs.getComponent("Component"))(e);s.addClass("ul-control-panel"),e.progressBar=s.addChild("ProgressControl"),n&&e.src(n),e.audioPlayerPlaceholder=new(I.videojs.getComponent("Component"))(e),e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const a=n&&n.src?sa(n.src):null;n&&(o||!a)?(e.children()[0].classList.add("vjs-hidden"),I.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.audioPlayerPlaceholder.hide(),I.document.getElementById(`${e.id()}_html5_api`).style.height="100%",a&&e.poster(a)),e.on("play",()=>{!o&&n&&!a&&ta(e,!1),i==null||i.play()}),e.on("pause",()=>{i==null||i.pause()}),e.on("seeked",()=>{i==null||i.currentTime(e.currentTime())}),e.on("ratechange",()=>{i==null||i.playbackRate(e.playbackRate())}),e.addChild(e.audioPlayerPlaceholder,{},1),s.addChild(t),e.addChild(s),r&&r(e)},Xs=(e,t,n)=>{e.addClass(`ul${Oo}`);const r=new(I.videojs.getComponent("Component"))(e);t&&e.src(t),e.addChild(r),n&&n(e)},ea=(e,t,n,r,o,i,s,a=!1)=>{Jn=Date.now();const d=St(t,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!d)return;d.payload=n;const{surveyId:l,questionId:h,responseGroupUid:p,visitorId:f,envId:m}=n;let v;const g=S=>{const _=Mt,L=Mt+"-audio-only";Xn(d.uploadProgressLabel,"none"),ae&&ae.startTime>=Jn&&ae.abort();const B=I.document.getElementById("ul-camera-button");S?(d.children()[0].classList.add("vjs-hidden"),x.removeClass(_),x.addClass(L),B.innerHTML=te.TurnOnCamera,d.audioPlayerPlaceholder.removeClass("vjs-hidden"),v==null||v.getTracks().forEach(Q=>{Q.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(Q=>{v=Q,Q.getVideoTracks().forEach(We=>{We.enabled=!1}),d.record().onDeviceReady(Q)}).catch(d.record().onDeviceError.bind(d.record()))):(v==null||v.getVideoTracks().forEach(Q=>{Q.enabled=!0}),d.children()[0].classList.remove("vjs-hidden"),d.record().getDevice(),x.removeClass(L),x.addClass(_),B.innerHTML=te.TurnOffCamera,d.audioPlayerPlaceholder.addClass("vjs-hidden"))},w=new(I.videojs.getComponent("Button"))(d,{clickHandler:()=>{w.hasClass(W)||(ye({event:"Video Delete Button Clicked",apiBase:r,headers:s,visitorId:f,envId:m,metadata:{questionId:h,responseGroupUid:p,surveyId:l}}),g(d.cameraOff),o(O.DELETE,{}),x.removeClass(W),w.addClass(W))}});w.addClass("ul-video-recorder-delete-button"),w.el_.appendChild(vt(te.DeleteButton,"ul-delete-button"));const y=I.document.getElementById(t),j=()=>{y.classList.contains("vjs-fullscreen")&&d.cameraOff?y.style.display="table":y.style.display="flex"};j();const x=new(I.videojs.getComponent("Button"))(d,{clickHandler:()=>{d.record().isRecording()||(d.cameraOff=!d.cameraOff,ye({event:"Video Camera Button Clicked",apiBase:r,headers:s,visitorId:n.visitorId,envId:n.envId,metadata:{questionId:h,responseGroupUid:p,surveyId:l,cameraOff:d.cameraOff}}),g(d.cameraOff),!w.hasClass(W)&&w.addClass(W),o(O.DELETE,{}),j())}});x.addClass(Mt),x.el_.appendChild(vt(te.TurnOffCamera,"ul-camera-button"));const U=new(I.videojs.getComponent("Button"))(d,{clickHandler:()=>{const S=I.document.getElementById("ul-recorder-toggle");if(d.record().isRecording())d.record().stop(),S&&(S.innerHTML=te.RecordButton),U.removeClass(Vt),w.removeClass(W);else{const _=I.document.getElementById("ul-recording-countdown-screen");if(_)_.remove(),S&&(S.innerHTML=te.RecordButton),g(d.cameraOff),o(O.DELETE,{}),x.removeClass(W),w.addClass(W),U.removeClass(Vt),T.show();else{U.addClass(Vt),T.hide(),x.addClass(W),w.addClass(W),S&&(S.innerHTML=te.StopButton);const L=I.document.createElement("div");L.id="ul-recording-countdown-screen",y.insertBefore(L,y.children[1]),L.style.height=`${y.offsetHeight}px`,Vo(d,3)}}}});U.addClass("ul-video-recorder-toggle-button"),U.el_.appendChild(vt(te.RecordButton,"ul-recorder-toggle"));const D=I.document.createElement("p");D.style.visibility="hidden",D.className="ul-upload-progress-label",e.appendChild(D),d.uploadProgressLabel=D;const C=No(d,[w,x,"PlayToggle",U,"FullscreenToggle"]),T=C.children().find(S=>S.name_==="FullscreenToggle");T.hasClass("vjs-disabled")&&T.hide();const P=C.children().find(S=>S.name_==="PlayToggle");P.hide(),i&&x.addClass(W),!i&&w.addClass(W),Mo(d,C,i,!1,a),d.on("stopRecord",()=>{U.hide(),P.show(),T.show(),w.removeClass(W)}),d.on("deviceReady",()=>{U.show(),P.hide(),w.addClass(W)}),Qs(d,r,o,Xn,s),i&&(d.deviceButton&&d.deviceButton.hide(),d.src(i),P.show(),U.hide(),w.removeClass(W));const M=[{name:"microphone"}];!d.cameraOff&&M.push({name:"camera"}),Promise.all(M.map(S=>{var _;return(_=navigator==null?void 0:navigator.permissions)==null?void 0:_.query(S)})).then(S=>{S.reduce((L,B)=>L&B.state==="granted",!0)&&d&&(d.deviceButton&&d.deviceButton.hide(),!i&&d.record().getDevice())}).catch(S=>{})},Vo=(e,t=3)=>{const n=I.document.getElementById("ul-recording-countdown-screen");n&&t===0?(n.remove(),e.record().start()):n&&(n.innerHTML=`<span class='ul-countdown-text'>Recording in... ${t}</span>`,setTimeout(()=>{Vo(e,t-1)},1e3))},Ho=e=>{const t=I.document.createElement("div");return t.className="ul-video-container",t.appendChild(Zs(e)),t},Yt=(e,t)=>{const n=I.document.createElement("video");n.id=e,n.className="video-js vjs-default-skin ul-video-player-video";const r=I.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const o=I.document.createElement("a");return o.href="https://videojs.com/html5-video-support/",o.target="_blank",o.innerHTML="supports HTML5 video",r.appendChild(o),n.appendChild(r),t.appendChild(n),t},ta=(e,t)=>{t?(e.children()[0].classList.add("vjs-hidden"),e.audioPlayerPlaceholder.show(),I.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.children()[0].classList.remove("vjs-hidden"),e.audioPlayerPlaceholder.hide(),I.document.getElementById(`${e.id()}_html5_api`).style.height="100%")},St=(e,t)=>I.document.getElementById(e)?t?I.videojs(e,t):I.videojs(e):(console.error(`Error in finding player element with ID, ${e}`),null),na=(e,t,n,r=!1,o="https://api.sprig.com",i=document,s=null,a=null)=>{I.document=i;const c=e+jo,d=Ho(c);return I.document.addEventListener("securitypolicyviolation",l=>{he(new Error(`Voice & Video feature violates ${l.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",o,{})}),Do(Ro,()=>{I.document.getElementById(fn(c)).remove(),Yt(c,d);const l={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const h=e+Oo;Yt(h,d);const p=St(c,l),f=St(h,{muted:!0,...l});if(!p||!f)return;Xs(f,s,a),s||f.addClass(W);const m=No(p,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),v=m.children().find(g=>g.name_==="FullscreenToggle");v.hasClass("vjs-disabled")&&v.hide(),Mo(p,m,t,n,r,f)}catch(h){he(new Error(`Error when creating video player object ${h}`),"playerDeviceError",o,{});return}}),d},ra=(e,t={},n="https://api.userleap.com",r,o,i,s=!1,a=document)=>{I.document=a;const c=e+Ao,d=Ho(c);return I.document.addEventListener("securitypolicyviolation",l=>{he(new Error(`Voice & Video feature violates ${l.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",n,i,t.visitorId,t.envId)}),Do(Ro.concat(Ys),()=>{Yt(c,d),I.document.getElementById(fn(c)).remove();try{ea(d,c,t,n,r,o,i,s)}catch(l){he(new Error(`Error when creating video recorder player object ${l}`),"recorderDeviceError",n,i,t.visitorId,t.envId);return}}),d},oa=e=>{const t=e+Ao;if(!!I.document.getElementById(t)&&!!I.videojs){try{if(!I.videojs(t).record().stream)return}catch{return}I.videojs(t).record().stop(),I.videojs(t).record().stopDevice()}},ia=e=>{const t=St(e+jo);t==null||t.pause()},sa=e=>{if(!e)return null;const t=e.match(/https:\/\/stream.mux.com\/(.*)/);let n=t?t[1]:null;return n.includes(Qn)&&(n=n.replace(Qn,"")),n?`https://image.mux.com/${n}/thumbnail.jpg?time=0`:null},O={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},te={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},Ge="ul-card-video__player_recorder",aa="ul-card-video__skip_button",la="ul-video-interview-form",er="ul-video-btn",ca=({className:e,message:t,next:n,properties:r,questionId:o,type:i})=>{const{apiURL:s,envId:a,handleUploadUpdate:c,headers:d,responseGroupUid:l,surveyId:h,viewDocument:p,visitorId:f}=F(L=>({apiURL:L.apiURL,envId:L.envId,handleUploadUpdate:L.handleUploadUpdate,headers:L.headers,responseGroupUid:L.responseGroupUid,surveyId:L.surveyId,viewDocument:L.viewDocument,visitorId:L.userId})),[m,v]=Y(!1),[g,w]=Y(null),[y,j]=Y(null),[x,U]=Y(0),D=d["userleap-platform"],C=r&&r.videoUrl,T=(L,B)=>{L===O.UPLOAD_STARTED?(w(B[O.UPLOAD_ID]),j(B[O.MEDIA_RECORDING_UID]),v(!0)):L===O.DELETE?(w(null),j(null),v(!1)):L===O.UPLOAD_PROGRESS?isNaN(B[O.UPLOAD_PROGRESS_PCT])?c({mediaRecordingUid:B[O.MEDIA_RECORDING_UID],isComplete:!0}):c({mediaRecordingUid:B[O.MEDIA_RECORDING_UID],progressPct:B[O.UPLOAD_PROGRESS_PCT]}):L===O.UPLOAD_FINISHED&&c({mediaRecordingUid:B[O.MEDIA_RECORDING_UID],isComplete:!0})},P=L=>{if(L&&L.children.length===0){const B=na(Ge,{src:C,type:"application/x-mpegURL"},void 0,r.mediaType===O.MEDIA_TYPE_AUDIO,s,p);L.appendChild(B)}},M=L=>{if(L&&L.children.length===0){const B=ra(Ge,{surveyId:h,responseGroupUid:l,questionId:o,visitorId:f,envId:a},s,T,void 0,{...d,"x-ul-video-recorder-origin":"sdk"},r.mediaType===O.MEDIA_TYPE_AUDIO,p);L.appendChild(B)}},S=L=>{L.preventDefault(),L.stopPropagation(),oa(Ge),g&&y?(c({mediaRecordingUid:y,isSubmitted:!0}),n({value:{mediaRecordingUid:y},questionId:o,type:i})):n({value:null,questionId:o,type:i})},_=()=>u(Le,{defaultBody:()=>u("button",{className:`${er} ul-record-response-btn`,onClick:L=>{L.preventDefault(),L.stopPropagation(),ia(Ge),U(1)}}),properties:r});return u("div",{className:R(ue(b.CardMainContent,D)),style:{marginTop:"unset"},children:u("form",{className:R([e,b.VideoCard,b.FadeInTransition]),id:la,children:[u(pe,{message:t,properties:r}),u("div",{id:"ul-card-voice__video",children:[u("div",{children:[u("div",{id:"ul-question-player-container",style:{display:x===0?"":"none"},children:[u("div",{id:Ge,ref:P}),_()]}),u("div",{style:{display:x===1?"block":"none"},children:[u("button",{className:`${er} ul-back-question-btn`,onClick:L=>{L.preventDefault(),L.stopPropagation(),U(0)}}),u("div",{id:"ul-recorder-player-container",ref:M})]})]}),u(K,{disabled:!m,onClick:S,children:qe(r)}),u("button",{className:`ul-card-text__button ${b.InactiveButton}`,id:aa,onClick:S,style:{display:r.required?"none":"block",...m?{display:"none"}:{}},children:dn(r)})]})]})})},da=({className:e})=>{const{headers:t,uploadProgress:n}=F(s=>({headers:s.headers,uploadProgress:s.uploadProgress}));let r,o;Object.values(n).filter(s=>s.isSubmitted).length>1?(r="Your responses are processing",o="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",o="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(n).filter(s=>s.isSubmitted).map(s=>s.progressPct)));return u("div",{className:R(ue(b.CardMainContent,t["userleap-platform"])),children:u("div",{className:R([e,"ul-card--uploading",b.FadeInTransition]),children:[u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:b.LoadingSpinnerContainer,role:"progressbar",children:u("div",{className:b.LoadingSpinner,children:[u("div",{className:b.LoadingSpinnerFirst}),u("div",{className:b.LoadingSpinnerSecond}),u("div",{className:b.LoadingSpinnerThird}),u("div",{className:b.LoadingSpinnerFourth})]})}),u(pe,{message:`${r} (${i}% complete)`}),u("p",{className:b.Caption,children:o})]})})},tr=()=>u("svg",{alt:"Powered by Sprig",fill:"none",height:"13",viewBox:"0 0 100 13",width:"100",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M3.0369 0.839981H0.0249023V8.99998H1.3209V6.53998H2.8569C4.8969 6.53998 6.2409 5.37598 6.2409 3.62398C6.2409 1.95598 4.9689 0.839981 3.0369 0.839981ZM3.0009 5.35198H1.3209V2.02798H3.0009C4.1769 2.02798 4.9689 2.67598 4.9689 3.62398C4.9689 4.65598 4.1769 5.35198 3.0009 5.35198Z",fill:"#5D696F"}),u("path",{d:"M9.90653 3.21598C8.15453 3.21598 6.90653 4.45198 6.90653 6.17998C6.90653 7.90798 8.15453 9.14398 9.90653 9.14398C11.6585 9.14398 12.9065 7.90798 12.9065 6.17998C12.9065 4.45198 11.6585 3.21598 9.90653 3.21598ZM9.90653 8.01598C8.88653 8.01598 8.15453 7.23598 8.15453 6.17998C8.15453 5.11198 8.88653 4.34398 9.90653 4.34398C10.9265 4.34398 11.6585 5.11198 11.6585 6.17998C11.6585 7.23598 10.9265 8.01598 9.90653 8.01598Z",fill:"#5D696F"}),u("path",{d:"M20.9631 3.35998L19.7391 7.11598L18.3951 3.35998H17.3271L15.9831 7.12798L14.7591 3.35998H13.4151L15.4431 8.99998H16.5351L17.8671 5.08798L19.1871 8.99998H20.2791L22.3071 3.35998H20.9631Z",fill:"#5D696F"}),u("path",{d:"M25.7246 3.21598C24.0086 3.21598 22.8206 4.51198 22.8206 6.17998C22.8206 7.85998 24.0206 9.14398 25.7966 9.14398C27.0206 9.14398 28.0166 8.54398 28.3766 7.52398H27.0086C26.7806 7.88398 26.3606 8.05198 25.8086 8.05198C24.7526 8.05198 24.2126 7.40398 24.0926 6.55198H28.5206C28.7606 4.64398 27.5966 3.21598 25.7246 3.21598ZM25.7366 4.27198C26.6126 4.27198 27.2126 4.76398 27.2846 5.68798H24.1166C24.2606 4.89598 24.8006 4.27198 25.7366 4.27198Z",fill:"#5D696F"}),u("path",{d:"M31.1297 4.12798V3.35998H29.8817V8.99998H31.1297V5.44798C31.6337 4.78798 32.3177 4.45198 33.2177 4.41598V3.23998C32.3537 3.23998 31.6457 3.56398 31.1297 4.12798Z",fill:"#5D696F"}),u("path",{d:"M36.8222 3.21598C35.1062 3.21598 33.9182 4.51198 33.9182 6.17998C33.9182 7.85998 35.1182 9.14398 36.8942 9.14398C38.1182 9.14398 39.1142 8.54398 39.4742 7.52398H38.1062C37.8782 7.88398 37.4582 8.05198 36.9062 8.05198C35.8502 8.05198 35.3102 7.40398 35.1902 6.55198H39.6182C39.8582 4.64398 38.6942 3.21598 36.8222 3.21598ZM36.8342 4.27198C37.7102 4.27198 38.3102 4.76398 38.3822 5.68798H35.2142C35.3582 4.89598 35.8982 4.27198 36.8342 4.27198Z",fill:"#5D696F"}),u("path",{d:"M45.4886 0.47998V3.80398C45.0086 3.43198 44.3966 3.21598 43.6766 3.21598C42.0926 3.21598 40.8206 4.53598 40.8206 6.16798C40.8206 7.82398 42.0926 9.14398 43.6766 9.14398C44.3966 9.14398 45.0086 8.92798 45.4886 8.54398V8.99998H46.7246V0.47998H45.4886ZM43.8566 8.01598C42.8246 8.01598 42.0686 7.17598 42.0686 6.16798C42.0686 5.17198 42.8246 4.34398 43.8566 4.34398C44.4806 4.34398 45.0686 4.55998 45.4886 5.15998V7.18798C45.0686 7.79998 44.4806 8.01598 43.8566 8.01598Z",fill:"#5D696F"}),u("path",{d:"M54.6797 3.21598C53.9597 3.21598 53.3477 3.43198 52.8797 3.79198V0.47998H51.6317V8.99998H52.8797V8.55598C53.3477 8.92798 53.9597 9.14398 54.6797 9.14398C56.2637 9.14398 57.5477 7.82398 57.5477 6.16798C57.5477 4.53598 56.2637 3.21598 54.6797 3.21598ZM54.4997 8.01598C53.8757 8.01598 53.2997 7.79998 52.8797 7.21198V5.13598C53.2997 4.54798 53.8757 4.34398 54.4997 4.34398C55.5437 4.34398 56.2997 5.17198 56.2997 6.16798C56.2997 7.17598 55.5437 8.01598 54.4997 8.01598Z",fill:"#5D696F"}),u("path",{d:"M63.3347 3.34798L61.3907 7.76398L59.2667 3.34798H57.9347L60.8147 9.08398L59.6267 11.784H60.9347L64.6547 3.34798H63.3347Z",fill:"#5D696F"}),u("path",{d:"M71.1466 4.34661C69.8092 4.05038 69.131 3.53001 69.131 2.80065C69.131 2.04705 69.8546 1.47822 70.8142 1.47822C71.8034 1.47822 72.5496 2.10339 72.5496 2.9321V2.99813H73.9165V2.9321C73.9165 1.41764 72.5883 0.272705 70.8271 0.272705C69.9784 0.272705 69.2009 0.533191 68.6379 1.0057C68.3584 1.23619 68.1339 1.52487 67.9805 1.8511C67.8271 2.17733 67.7486 2.53303 67.7506 2.89273C67.7451 3.22255 67.8137 3.54949 67.9515 3.84994C68.0894 4.15038 68.293 4.41686 68.5478 4.63012C69.0218 5.04266 69.6945 5.34798 70.5463 5.5388C71.9806 5.85502 72.7078 6.39296 72.7078 7.13686C72.7078 7.94316 71.9156 8.55076 70.8682 8.55076C69.7804 8.55076 68.9599 7.87531 68.9599 6.97996V6.91393H67.5918V6.97996C67.5918 8.56348 68.9942 9.75688 70.8535 9.75688C71.7426 9.75688 72.5588 9.48731 73.1518 8.99662C73.446 8.75831 73.6827 8.4581 73.8445 8.1179C74.0063 7.7777 74.0891 7.40611 74.087 7.03024C74.087 5.6854 73.0991 4.78217 71.1466 4.34661Z",fill:"#5D696F"}),u("path",{d:"M78.7986 2.50806C78.2874 2.50175 77.7823 2.6176 77.3263 2.84576C76.8703 3.07391 76.4768 3.40759 76.1795 3.81837V2.66738H74.8789V12.0752H76.1795V8.48716C76.4768 8.8979 76.8703 9.23152 77.3263 9.45957C77.7824 9.68763 78.2875 9.80335 78.7986 9.79687C80.8167 9.79687 82.3381 8.23031 82.3381 6.15246C82.3381 4.07462 80.8167 2.50806 78.7986 2.50806ZM80.9835 6.42264C80.9316 6.9629 80.6921 7.46879 80.3056 7.8544C79.919 8.24001 79.4093 8.48156 78.863 8.53804C78.1369 8.61074 77.4605 8.40295 76.9583 7.95407C76.4561 7.50518 76.1795 6.86365 76.1795 6.15246C76.1795 4.7846 77.2122 3.75295 78.5815 3.75295C79.2904 3.75295 79.9306 4.02191 80.3776 4.51018C80.8387 5.01116 81.054 5.69025 80.9835 6.42264Z",fill:"#5D696F"}),u("path",{d:"M98.2908 2.6692V3.80747C97.6776 2.97875 96.7302 2.50806 95.6583 2.50806C93.6482 2.50806 92.1323 4.04615 92.1323 6.08582C92.1323 8.1255 93.6482 9.66299 95.6583 9.66299C96.7345 9.66299 97.6819 9.19714 98.2908 8.37691V8.55198C98.2908 9.96891 97.3906 10.8843 95.9974 10.8843C95.0561 10.8843 94.2718 10.4766 93.8996 9.79384L93.8806 9.7587H92.5389L92.5695 9.84654C92.7961 10.514 93.2392 11.0889 93.8303 11.4822C94.4233 11.8723 95.1726 12.0783 95.9974 12.0783C97.0552 12.0783 97.9554 11.7451 98.6017 11.1157C99.2481 10.4862 99.5915 9.6012 99.5915 8.56773V2.6692H98.2908ZM97.5611 7.842C97.0092 8.36418 96.2225 8.58348 95.4001 8.44294C94.9132 8.35796 94.4664 8.12184 94.1245 7.76889C93.7827 7.41593 93.5636 6.96452 93.4992 6.48019C93.3833 5.66541 93.631 4.89364 94.1786 4.36418C94.6383 3.92741 95.2542 3.68788 95.8919 3.69782C96.0464 3.69795 96.2006 3.71031 96.3531 3.73477C97.3459 3.89349 98.1314 4.70403 98.2632 5.71024C98.3749 6.53835 98.1179 7.31436 97.5611 7.842Z",fill:"#5D696F"}),u("path",{d:"M90.705 0.0995975C90.4602 0.046773 90.2043 0.0911971 89.9925 0.223269C89.7806 0.35534 89.6299 0.564452 89.5729 0.805409C89.5159 1.04637 89.5571 1.29982 89.6877 1.51098C89.8183 1.72215 90.0277 1.87407 90.2708 1.93391C90.3415 1.94954 90.4136 1.95747 90.486 1.95754C90.72 1.9579 90.9458 1.87325 91.1206 1.71973C91.2955 1.5662 91.407 1.35452 91.4341 1.125C91.4611 0.89547 91.4017 0.664135 91.2673 0.475046C91.1329 0.285958 90.9327 0.152325 90.705 0.0995975V0.0995975Z",fill:"#5D696F"}),u("path",{d:"M89.8366 8.39143H88.715C87.9178 8.39143 87.4389 7.85531 87.4389 6.95693C87.4389 6.08096 87.8681 5.03659 88.7432 3.76444L88.7548 3.74748V3.38825L85.0271 2.86727C85.0284 2.71553 84.9886 2.56622 84.9118 2.43478C84.8351 2.30335 84.7241 2.19458 84.5905 2.11973C84.2563 1.938 83.8908 1.938 83.5879 2.11368C83.4361 2.2023 83.3122 2.33077 83.23 2.4848C83.1477 2.63884 83.1103 2.8124 83.1219 2.98618C83.1336 3.15996 83.1938 3.32714 83.2958 3.46914C83.3979 3.61114 83.5379 3.72238 83.7001 3.79049L82.5405 9.63753H83.8283L84.8977 4.08551L86.9115 4.42111C86.3701 5.38007 86.0953 6.27421 86.0953 7.07869C86.0953 8.56347 87.0041 9.53576 88.4734 9.62965V9.63753H91.1341V2.69099H89.8366V8.39143Z",fill:"#5D696F"})]}),ua=()=>{const{border:e,cards:t,headers:n,index:r,marketingUrl:o,showSurveyBrand:i,slugName:s,surveyId:a,viewedCardCount:c}=F(v=>({border:v.border,cards:v.cards,headers:v.headers,index:v.index,marketingUrl:v.marketingUrl,showSurveyBrand:v.showSurveyBrand,slugName:v.slugName,surveyId:v.surveyId,viewedCardCount:v.viewedCardCount})),d=ke(null),l=t.filter(v=>v.type!==E.Uploading&&v.type!==E.Thanks),h=ms(t,r),p=c+1,f=p/(p+h);oe(()=>{d.current&&(d.current.style.width=`${f*100}%`)},[f]);const m=()=>i?u("a",{href:`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${a}`,rel:"noreferrer",style:{display:"block",margin:"5px 0"},target:"_blank",children:u(tr,{})}):null;return!l||l.length===1?u("footer",{className:"ul-footer",style:i?{}:{marginBottom:"10px"},children:m()}):u("footer",{className:`ul-footer ${n["userleap-platform"]==="link"?"ul-footer__link":""}`,children:[l.length>1&&u("div",{id:"ul-progress-bar-container",children:u("div",{id:"ul-progress-bar-current",ref:d,style:{border:`1px solid ${e||"#000"}`}})}),i&&u("a",{href:`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${a}`,rel:"noreferrer",style:{display:"block",margin:"5px 0"},target:"_blank",children:u(tr,{})})]})},pa=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:o,destroy:i,endCard:s,eventEmitFn:a,fontFamily:c,headers:d,index:l,next:h,showStripes:p,update:f,useMobileStyling:m,viewDocument:v}=F(_=>({answers:_.answers,border:_.border,cards:_.cards,close:_.close,configureExitOnOverlayClick:_.configureExitOnOverlayClick,destroy:_.destroy,endCard:_.endCard,eventEmitFn:_.eventEmitFn,fontFamily:_.fontFamily,headers:_.headers,index:_.index,next:_.next,showStripes:_.showStripes,update:_.update,useMobileStyling:_.useMobileStyling,viewDocument:_.viewDocument})),g=ke(null),w=ke(!1),{props:y,type:j,name:x}=n[l],U=n.length;oe(()=>{g.current&&(g.current.classList.contains("ul-app--visible")||g.current.classList.add("ul-app--visible"),!w.current&&a&&(w.current=!0,a(N.SurveyAppeared)))},[a]),oe(()=>{f()},[l,f]),oe(()=>{o(()=>r())},[r,o]);const D=()=>r(Ne),C=_=>{_.key==="Enter"&&D()},T=async function(_){h({data:_,completeSurvey:()=>{i(Ne)},endCard:s}),ai(v)};if(e){for(const _ of e)if(_.questionId===x){let L;if(j===E.MultipleChoice){const B=y.options.find(({value:Q})=>Q===_.value);if(!B)break;L={[B.id]:B.value}}else L=_.value;T({value:L,type:j,questionId:_.questionId});break}}const P=()=>[je.Email,je.Link].includes(d["userleap-platform"])?!1:!s||l+1!==U,M=()=>m?{borderColor:t}:{borderColor:t,margin:"15px"},S=()=>{const _={className:"ul-card",next:T,questionId:x,type:j};switch(j){case E.ConsentLegal:return z(ks,{..._,...y,key:x});case E.Likert:return z(Ls,{..._,...y,key:x});case E.MultipleChoice:return z(Us,{..._,...y,key:x});case E.MultipleSelect:return z(Is,{..._,...y,key:x});case E.NPS:return z(Ts,{..._,key:x,props:y});case E.Open:return z(Ps,{..._,...y,key:x});case E.RecordedTask:return z(Bs,{..._,...y,key:x});case E.TextUrlPrompt:return z(qs,{..._,...y,key:x});case E.Thanks:return z(Ws,{..._,...y,key:x});case E.Uploading:return z(da,{..._,...y,key:x});case E.VideoVoice:return z(ca,{..._,...y,key:x});default:return null}};return u("div",{className:R("ul-app",Ve(d)?"ul-app--visible":"ul-app--overlay"),id:Ne,ref:g,style:{"--theme":t,...c?{fontFamily:c.replace(";","")}:{}},children:u("div",{className:"ul-app__container",children:[u("div",{className:R(q(b.CardContainer,m)),style:M(),children:[p&&u("div",{className:"ul-header__container",children:u("div",{className:"ul-header",children:"For development purposes only"})}),S(),u(ua,{})]}),P()&&u("div",{className:R(q(b.CloseContainer,m)),children:u("div",{"aria-label":"Close button",className:b.CloseButton,onClick:D,onKeyPress:C,role:"button",tabIndex:0,children:u("svg",{fill:"none",height:"18px",viewBox:"0 0 13 13",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})})]})})},fa=`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:left;margin:auto}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container{background:#ffffff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0 5px 20px}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:left;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{padding-top:15px;margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:left}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:left}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;height:fit-content;flex:0 0 fit-content}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{box-shadow:unset;border-radius:unset;border:none!important;position:unset}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:white}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.likert-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.likert-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-number-1{border-top-left-radius:5px;border-bottom-left-radius:5px}.likert-last-option{border-top-right-radius:5px;border-bottom-right-radius:5px}.likert-star--mobile{margin-left:-2px}.likert-star--desktop{margin-left:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px}.likert-smiley--mobile{margin-left:-2px}.likert-smiley--desktop{margin-left:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels span:last-child{text-align:right}.select-label{flex:1;overflow-wrap:anywhere;cursor:pointer;padding-left:15px}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.nps-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.nps-number-0{border-top-left-radius:5px;border-bottom-left-radius:5px}.nps-number-10{border-top-right-radius:5px;border-bottom-right-radius:5px}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--nps__labels span:last-child{text-align:right}.ul-card-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:white}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#ul-card-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#ffffff;border-radius:5px;text-align:left;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:30px}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.close-container--desktop,.close-container--mobile{height:22px;width:22px;border-radius:22px;background-color:#fff;align-items:center;justify-content:center}.close-container--desktop{top:25px;right:25px}.close-container--mobile{top:15px;right:10px}.close-container{background:transparent;box-sizing:border-box;display:flex;position:absolute}.close-btn{height:18px;width:18px;align-items:center;justify-content:center;display:flex;cursor:pointer}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:rgba(0,0,0,.01);border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}
|
|
686
|
+
`,ma=(e,t)=>{const n=[...e],r=new Set([E.VideoVoice,E.RecordedTask]);return e.some(o=>r.has(o.type))&&n.push({name:-2,props:{routingOptions:[]},type:E.Uploading}),t&&n.push({name:-1,props:{routingOptions:[]},type:E.Thanks}),n},ha=({mode:e=null,viewWindow:t,viewDocument:n})=>{const r=n.documentElement;return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:r.clientWidth,ch:r.clientHeight,p:t.location.href,l:t.navigator.language}};function va(e,t=!0){var x;const{answers:n,apiURL:r,customStyles:o,endCard:i,eventEmitFn:s,fontFamilyURL:a,frame:c,UpChunk:d,viewDocument:l,viewWindow:h}=e,p=Ve(e.headers)?e.frame:l.body,f=V,m=ma(e.cards,!!i);mt.configure(f,{cards:m,hasEndCard:!!i,apiURL:r,UpChunk:d}),F.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:m,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:s,fontFamily:e.fontFamily,frame:c,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:ha({mode:e.mode,viewWindow:h,viewDocument:l}),mode:e.mode,recorder:mt,recorderEventEmitter:f,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{seen:v}=F.getState();v();const{head:g}=l,w=l.createElement("style");if(w.textContent=fa,w.nonce=e.styleNonce,g.appendChild(w),e.fontFamily&&a&&parent){const U=l.createElement("link");U.rel="stylesheet",U.href=a,g.appendChild(U)}if(e.customStyles&&sr(l,o,e.styleNonce),!d)if(e.installationMethod!==Se.Npm){const U=l.createElement("script");U.src="https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js",U.onload=()=>{mt.setUpChunk(h.UpChunk)},U.onerror=()=>{console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure")},g.appendChild(U)}else console.warn("[Sprig] - recording functionality not configured due to missing UpChunk dependency");const y="2.21.1",j=s||((x=c.eventEmitter)==null?void 0:x.emit);j==null||j(X.VerifyViewVersion,{[Te.ViewVersion]:y}),p&&t&&$e(u(pa,{}),p)}const ga={configure:va};window.UserLeap&&window.Sprig&&(window.Sprig._gtm?window.Sprig=window.UserLeap:window.UserLeap=window.Sprig);window.UserLeap||(window.UserLeap=window.Sprig);window.Sprig||(window.Sprig=window.UserLeap);const _a="rgba(255,255,255, 0.95)",wa="rgba(0,0,0,0.9)",ya="360px",$t="0px",$o=()=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container",document.body.appendChild(window.UserLeap.container)},Bo=e=>{const t=window.UserLeap.container;if(!!t)try{document.body.removeChild(t),window.UserLeap.container=null,V.emit(N.SurveyLifeCycle,{state:"dismissed"}),V.emit(N.SurveyClosed,{name:N.SurveyClosed,initiator:e})}catch(n){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+t),n instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",n)}},Fo=()=>{V.on(N.SurveyWillClose,({initiator:e})=>{Bo(e)})},ba=(e,t)=>{const r={...{position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646}},o=t?e.overlayStyleMobile:e.overlayStyle;r["background-color"]=o==="light"?_a:wa,t||(r.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,r)},xa=(e,t,n)=>{var a,c;const r={position:"fixed",bottom:"0px",right:$t,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646},o=Object.assign({},t,window.UserLeap);let i,s=!1;return n?((a=window.UserLeap.windowDimensions)!=null&&a.width?r.width=`${window.UserLeap.windowDimensions.width}px`:r.width="100%",(c=window.UserLeap.windowDimensions)!=null&&c.height?r.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`:window.UserLeap.maxHeight?r.maxHeight=window.UserLeap.maxHeight:r.maxHeight=`${document.body.clientHeight-20}px`,["light","dark"].includes(o.overlayStyleMobile)&&(s=!0)):(r.width=ya,r.maxHeight=window.UserLeap.maxHeight||"66vh",o.framePosition===Ye.BottomLeft?i={left:$t}:o.framePosition===Ye.TopLeft?i={left:$t,top:"0px"}:o.framePosition===Ye.TopRight?i={top:"0px"}:o.framePosition===Ye.Center&&(s=!0,i={margin:"auto",position:"static"},r.maxHeight=null)),s&&ba(o,n),Object.assign(e.style,r,i),s},Ca=(e,t)=>{var a,c;const n="ul-frame";$o();const r=document.createElement("iframe");r.id=n,r.setAttribute("title","Sprig User Feedback Dialog");const o=xa(r,e,t);V.on(N.SurveyFadingOut,()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}),Fo(),r.setHeight=d=>{parseInt(r.style.height)!=d&&(r.style.height=`${d}px`,V.emit(N.SurveyHeight,{name:N.SurveyHeight,contentFrameHeight:r.clientHeight}))},(a=window.UserLeap.container)==null||a.appendChild(r),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{V.emit(N.CloseSurveyOnOverlayClick)}),V.emit(N.SurveyLifeCycle,{state:"presented"}),V.emit(N.SurveyPresented,{name:N.SurveyPresented});const i=(c=r.contentWindow)==null?void 0:c.document;i&&(i.open("text/html","replace"),i.write("<!doctype html><head></head><body></body></html>"),i.close());const s=i==null?void 0:i.head;return{frameId:n,contentWinDocHead:s,contentWindow:r.contentWindow,hasOverlay:o,iframe:r}},Sa="!optimizely_experiments_";class ka{constructor(){se(this,"_optimizelyData",{})}setOptimizelyExperiment(t){if(!t||typeof t!="object")return!1;const{experiments:n}=t;try{return Object.keys(this._optimizelyData).map(r=>{delete this._optimizelyData[r]}),n&&n.map(r=>{const{id:o,variation:i}=r,s=this.transformExperimentId(o);i&&typeof i=="string"&&(this._optimizelyData[s]=i)}),!0}catch(r){return r instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",r),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(t){return this._optimizelyData[this.transformExperimentId(t)]}transformExperimentId(t){return Sa+t}getAndSetWebOptimizelyExperiments(){var t;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const n=(t=window.optimizely.get("state"))==null?void 0:t.getExperimentStates({isActive:!0});if(n){const r=Object.keys(n).map(o=>{var i,s;return(i=n[o].variation)!=null&&i.name?{id:o,variation:(s=n[o].variation)==null?void 0:s.name}:{id:o,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r}),!0}return!1}return!1}catch(n){return n instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",n),!1}}}const gt=new ka;Object.freeze(gt);class Ea{constructor(t,n){se(this,"paused");se(this,"queue");se(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(n)}flush(t){const n=t.length;if(n)for(let r=0;r<n;r++)this.push(t[r])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const n=Array.prototype.slice.call(t,1),r=t[0],o=this.ul[r];o instanceof Function?o.apply(this.ul,n):r&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",r)}}perform(t){if(this.paused){let n=()=>{};const r=new Promise(function(o){n=function(){o(t())}});return this.queue.push(n),r}else return t()}empty(){this.queue.length=0}}const rt="userleap.ids",Kt="userleap.pageviews",La=["popState","pushState","replaceState"],Ua={test:"test"},Ze="!email",Ia=["ios","android"],Ce="environments",Qt="pageUrl",Ue="visitors",nr="ul-view-sdk-script",rr=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function mn(e,t){const{matchType:n,pattern:r}=e;return(n?rr[n]:rr.legacy)(r,t)}function Ta(e,t){const{pageUrlEvents:n,interactiveEvents:r,dismissOnPageChange:o}=window.UserLeap._config;if(!o)return!0;const i=[];n&&n.length&&i.push(...n),r&&r.length&&i.push(...r);const s=e&&i.find(a=>a.id===e);return s?mn(s,window.location.href):t===window.location.href}function ot(e){const{pageUrlEvents:t,interactiveEvents:n,dismissOnPageChange:r,platform:o}=window.UserLeap._config;o&&o!==je.Web||(t&&Da(window.location.href),n&&(qo(),Pa()),r&&e&&La.includes(e.type)&&window.UserLeap("dismissActiveSurvey",fe.PageChange))}const zo={capture:!0},Pa=()=>{const t=window.UserLeap._config.interactiveEvents.filter(r=>mn(r,window.location.href)).map(r=>{const{name:o,properties:i}=r,{selector:s,innerText:a}=i;return s?c=>(He(c.target)&&c.target.closest(s)&&window.UserLeap("track",o),!1):c=>(He(c.target)&&c.target.innerText===a&&window.UserLeap("track",o),!1)}),n=r=>t.forEach(o=>o(r));window.UserLeap._config.interactiveEventsHandler=n,window.addEventListener("click",n,zo)},qo=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,zo),delete window.UserLeap._config.interactiveEventsHandler};function Ra(){["hashchange","popstate"].forEach(e=>window.addEventListener(e,ot,!0))}function ja(){["hashchange","popstate"].forEach(e=>window.removeEventListener(e,ot,!0)),window.UserLeap._config.interactiveEvents&&qo()}function ce(e,t,n){const r=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(o=>{r.push(o),o===Ce?r.push(window.UserLeap.envId):o===Ue&&r.push(hn())}),n&&r.push(n),r.join("/")}function Oa(e,t){let n=ce("1",[Ce],"questions?");return e!=null&&(n+=`&vid=${e}`),t&&(t.surveyId&&(n+=`&surveyid=${t.surveyId}`),t.surveyTemplateId&&(n+=`&surveytemplateid=${t.surveyTemplateId}`)),n}function Aa(){try{if(typeof localStorage<"u"&&(localStorage.setItem("is_available","yes"),localStorage.getItem("is_available")==="yes"))return localStorage.removeItem("is_available"),!0}catch{return!1}return!1}function Ae(e){if(!window.UserLeap.localStorageAvailable)return null;const t=localStorage.getItem(rt);if(t)try{const r=JSON.parse(t)[window.UserLeap.envId];return r&&r[e]||null}catch(n){n instanceof Error&&(n.stack=t,window.UserLeap.reportError("Failed to parse local storage credentials",n)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",n)}return null}function ne(e,t){if(!window.UserLeap.localStorageAvailable)return;const n=localStorage.getItem(rt);let r={};if(n)try{r=JSON.parse(n)}catch(i){i instanceof Error&&(i.stack=n,window.UserLeap.reportError("Failed to parse local storage credentials",i)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",i)}let o=r[window.UserLeap.envId];o?o[e]=t:o={[e]:t},r[window.UserLeap.envId]=o;try{localStorage.setItem(rt,JSON.stringify(r))}catch(i){i instanceof Error&&console.warn(`[Sprig] (ERR-426) Unable to write to Local Storage:: ${i.message}`)}}function Wo(){window.previewMode||(window.UserLeap.visitorId=_t(),ne("vid",window.UserLeap.visitorId),V.emit(N.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}))}function hn(){return window.previewMode?"0":window.UserLeap.visitorId||""}function Da(e){if(!window.UserLeap.localStorageAvailable||e.endsWith("mock_snippet.html"))return;const t=window.UserLeap._config.pageUrlEvents;if(t&&t.length){let a=!1;for(let c=0;c<t.length&&(a=mn(t[c],e),!a);c++);if(!a)return}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const n=10,r=1;let o=[];const i={viewedAt:Date.now(),location:e},s=localStorage.getItem(Kt);try{if(s){if(o=JSON.parse(s),o.length>0){const a=o[o.length-1],c=(Date.now()-a.viewedAt)/1e3;(a.location!=e&&c>r||c>n)&&(window.UserLeap._queue.push(["track",Qt,null,{url:e}]),o.push(i))}}else window.UserLeap._queue.push(["track",Qt,null,{url:e}]),o.push(i);o.length>5&&o.splice(0,o.length-5);try{localStorage.setItem(Kt,JSON.stringify(o))}catch(a){a instanceof Error&&console.warn(`[Sprig] Unable to write to Local Storage: ${a.message}`)}}catch(a){a instanceof Error&&(a.stack=s||"",window.UserLeap.reportError("trackPageView",a)),console.warn("[Sprig] (ERR-425) Failed to update page views in local storage")}}function Na(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const o=t.apply(this,r),i=new Event("pushState");return window.dispatchEvent(i),ot(i),o})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const o=t.apply(this,r),i=new Event("replaceState");return window.dispatchEvent(i),ot(i),o})(e.replaceState)),Ra()}async function Bt(e,t){const n=hn();e&&!t&&(window.UserLeap._config.mode=Ua.test);const r=await we(Oa(n,e),{},0,!0);return r.ok?(r.json.delay&&await wt(r.json.delay),Go(r.json)):(r.reportError&&r.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",r.error),window.UserLeap.reportError("getQuestions",r.error)),{success:!1,surveyState:"no survey"})}const Go=e=>{var M,S;const{context:t,endCard:n,locale:r,productConfig:o,questions:i,responseGroupUid:s,surveyId:a,uuid:c,vid:d}=e,l=it(window.UserLeap),h=vn(l),p=Ma(l);if(d==null||!i||!i.length)return{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(window.UserLeap.container){const _="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(_),{success:!1,message:_,surveyState:"no survey"}}if(d!==window.UserLeap.visitorId&&c!==window.UserLeap.visitorId&&!window.previewMode){const _="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(_)),{success:!1,message:_,surveyState:"no survey"}}Ft.disable(),V.emit(N.SurveyWillPresent,{name:N.SurveyWillPresent,[or.SurveyId]:a});let f,m=document.createElement("div"),v,g,w;const y=_=>{const{[Te.ViewVersion]:L}=_;L!==l["x-ul-sdk-version"]&&Bo(),V.removeListener(X.VerifyViewVersion,y)};V.on(X.VerifyViewVersion,y),Ve(l)?(f="ul-direct-embeded-frame",v=document.head,g=window,w=!1,h&&($o(),m.id=f,window.UserLeap.container.appendChild(m),Fo(),V.emit(N.SurveyLifeCycle,{state:"presented"}),V.emit(N.SurveyPresented,{name:N.SurveyPresented}))):{frameId:f,contentWinDocHead:v,contentWindow:g,hasOverlay:w,iframe:m}=Ca(o,p),window.UserLeap.frameId=f,window.UserLeap.useMobileStyling=p;const j=_=>{V.on(N.CloseSurveyOnOverlayClick,_)},x=Object.assign({frame:m,envId:window.UserLeap.envId,surveyId:a,userId:c,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},cards:i,context:t,locale:r,fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,apiURL:window.UserLeap._API_URL,responseGroupUid:s,headers:l,endCard:n,useMobileStyling:p,mobileSDKVersion:window.UserLeap.mobileSDKVersion,configureExitOnOverlayClick:j,eventEmitFn:V.emit.bind(V),ulEvents:Xt,viewDocument:g==null?void 0:g.document,viewWindow:g,tabTitle:document.title,startingQuestionIdx:(M=window.UserLeap.config)==null?void 0:M.startingQuestionIdx,styleNonce:window.UserLeap.styleNonce},window.UserLeap._config);(S=window.UserLeap.config)!=null&&S.startingQuestionIdx&&(window.UserLeap.config={...window.UserLeap.config,startingQuestionIdx:null}),window.UserLeap.customStyles&&(x.customStyles=window.UserLeap.customStyles),g&&(g.__cfg=x);function U(){const _=document.createElement("script");return window.UserLeap.nonce&&_.setAttribute("nonce",window.UserLeap.nonce),_.id=nr,_}const D=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:x.path,C=document.getElementById(nr);C&&C.remove();const T=U(),P=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};return x.installationMethod===Se.Npm?(ga.configure(x),w&&window.UserLeap.container&&P()):D&&(T.src=D,w&&T.addEventListener("load",()=>{window.UserLeap.container&&P()}),g==null||g.addEventListener("error",_=>{_.target instanceof HTMLScriptElement&&_.target.src===D&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0})),v==null||v.appendChild(T),{success:!0,surveyState:"ready"}};function Ma(e){if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=window.UserLeap.windowDimensions&&window.UserLeap.windowDimensions.width||document.body.clientWidth;return vn(e)||t>10&&t<ei}function vn(e){return Ia.includes(e[le.Platform])}function Va(e){let t=e.length;for(;t;){const n=Math.floor(Math.random()*t);t-=1;const r=e[t];e[t]=e[n],e[n]=r}}function Ha(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:n,dismissOnPageChange:r}=e;t&&Va(t),(t||n||r)&&(Na(),ot())}async function we(e,t,n=0,r=!1){var i,s;t.headers=Object.assign(it(window.UserLeap),t.headers);const o=await ge(e,t,n,r);if(o.ok){const a=(i=o.headers)==null?void 0:i.get("Authorization"),c=a?a.split(" "):void 0,d=c&&c.length===2?c[1]:void 0,l=(s=o.headers)==null?void 0:s.get(le.VisitorID);d&&l&&(l!==window.UserLeap.visitorId||window.UserLeap.token!==d)&&(ne("token",d),ne("vid",l),V.emit(N.VisitorIDUpdated,{visitorId:l}),window.UserLeap.token=d,window.UserLeap.visitorId=l)}return o.json&&o.json.logMessage&&console.warn(`[Sprig] ${o.json.logMessage}`),o}async function $a(e){var t;!((t=e==null?void 0:e.json)!=null&&t.delay)||(window.UserLeap.delayingSurvey=!0,await wt(e.json.delay),window.UserLeap.delayingSurvey=!1)}const Ba=function(e){if(!window.UserLeap)return;const t=async(r={})=>{var p,f;const{userId:o,anonymousId:i,metadata:s={},properties:a}=r;let{eventName:c}=r;if(window.UserLeap.debugMode&&c!==Qt&&console.info("[DEBUG] Sprig track",r),e.mode==="test")return;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!o){const m="[Sprig] - Skipping tracking without userId";return console.warn(m),{success:!1,message:m,surveyState:"no survey"}}if(!c||c.trim().length===0){c=c?String(c):"";const m="[Sprig] - Invalid event name "+c;return console.warn(m),{success:!1,message:m,surveyState:"no survey"}}const d=window.location.href;if(s.url||(s.url=d),(f=(p=window.UserLeap)==null?void 0:p._config)!=null&&f.optimizelyEnabled){const m=it(window.UserLeap);vn(m)||gt.getAndSetWebOptimizelyExperiments(),s.optimizelyExperiments=Object.assign({},gt.getAllOptimizelyExperiments())}o&&(window.UserLeap.userId=o),i&&(window.UserLeap.partnerAnonymousId=i),a&&(s.eventProperties=a);const l=window.UserLeap.delayingSurvey?await we(ce("1",[Ue],"events/batch"),{body:JSON.stringify({events:[{event:c,metadata:s}]}),method:"POST"},0,!0):await we(ce("1",[Ue],"events"),{body:JSON.stringify({event:c,metadata:s}),method:"POST"},0,!0);if(!l.ok){const m="[Sprig] (ERR-421) Failed to track event";return l.reportError&&(console.warn(m,l.error),l.error&&window.UserLeap.reportError("track",l.error)),{success:!1,message:m,error:l.error,surveyState:"no survey"}}o&&ne("uid",o),i&&ne("aid",i);const h=l.json;return await $a(l),Ta(h.eventId,d)?Go(h):{success:!1,message:"Study should not be displayed after page navigation",surveyState:"no survey"}},n={async displaySurvey(r){return console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",fe.Override),Bt({surveyId:r},!0)},previewSurvey(r){window.UserLeap("dismissActiveSurvey",fe.Override),Bt({surveyTemplateId:r},!1)},reviewSurvey(r){window.UserLeap("dismissActiveSurvey",fe.Override),Bt({surveyId:r},!1)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(r=fe.API){V.emit(N.SurveyWillClose,{name:N.SurveyWillClose,initiator:r})},async setAttribute(r,o){if(!r||!o&&o!==0){const i="[Sprig] - Disregarding empty attribute / value provided";return console.warn(i),{success:!1,message:i}}return this.setAttributes({[r]:o})},async setAttributes(r){if(r==null||Object.keys(r).length===0){const o="[Sprig] - Disregarding empty attributes provided";return console.warn(o),{success:!1,message:o}}return this.identifyAndSetAttributes({attributes:r})},async identifyAndSetAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",r),e.mode==="test")return;if(r===null||typeof r!="object"||!(r.userId||r.anonymousId||r.attributes)){const d="[Sprig] - Disregarding empty payload provided";return console.warn(d),{success:!1,message:d}}const{userId:o,anonymousId:i,attributes:s}=r;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!o){const d="[Sprig] - Skipping tracking without userId";return console.warn(d),{success:!1,message:d}}if(!s&&(!o||window.UserLeap.userId===o)&&(!i||window.UserLeap.partnerAnonymousId===i))return{success:!0};const a={};o&&(a.userId=window.UserLeap.userId=o),i&&(a.partnerAnonymousId=window.UserLeap.partnerAnonymousId=i);let c;return s?(s.email&&!Object.prototype.hasOwnProperty.call(s,Ze)&&(s[Ze]=s.email,delete s.email),c=await we(ce("1",[Ce,Ue],"attributes"),{body:JSON.stringify(s),method:"PUT"}),!c.ok&&c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await we(ce("1",[Ce,Ue]),{body:JSON.stringify(a),method:"PUT"}),s&&s[Ze]&&(window.UserLeap.email=s[Ze]),c.ok&&(o&&ne("uid",o),i&&ne("aid",i)),{success:!!c.ok}},async removeAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",r),e.mode==="test")return;if(r==null||r.length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const i="[Sprig] - Skipping tracking without userId";return console.warn(i),{success:!1,message:i}}const o=await we(ce("1",[Ce,Ue],"attributes"),{body:JSON.stringify({delete:r}),method:"DELETE"});return!o.ok&&o.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",o.error),o.error&&window.UserLeap.reportError("removeAttributes",o.error)),{success:!!o.ok}},async addSurveyListener(r){V.on(N.SurveyLifeCycle,r)},async removeSurveyListener(r){V.removeListener(N.SurveyLifeCycle,r)},async addListener(r,o){V.on(r,o)},async removeListener(r,o){V.removeListener(r,o)},async removeAllListeners(){V.removeAllListeners()},setVisitorAttribute(r,o){return console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(r,o)},async setEmail(r){return n.setAttribute(Ze,r)},async setVisitorEmail(r){return console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(r)},async setUserId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",r),r==null){const i=`[Sprig] - Invalid userId ${r}`;return console.warn(i),{success:!1,message:i}}if(e.mode==="test"||r===window.UserLeap.userId)return;window.UserLeap.userId=r;const o=await we(ce("1",[Ce,Ue]),{body:JSON.stringify({userId:r}),method:"PUT"});if(!o.ok){o.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",o.error),o.error&&window.UserLeap.reportError("setUserId",o.error));return}ne("uid",r)},async setPartnerAnonymousId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",r),r==null){const o=`[Sprig] - Invalid partnerAnonymousId ${r}`;return console.warn(o),{success:!1,message:o}}return window.UserLeap.partnerAnonymousId=r,ne("aid",r),{success:!0}},async track(r,o,i={}){return t({eventName:r,properties:o,metadata:i})},async identifyAndTrack(r){return await t(r)},applyStyles(r){if(window.UserLeap.customStyles=r,window.UserLeap.container){const o=window.UserLeap.container.children[0].contentDocument;if(o){const i=o.getElementById(b.CustomStyle);i?i.textContent=r:sr(o,r,window.UserLeap.styleNonce)}}},setWindowDimensions(r,o){var c,d;const i=typeof r=="string"?parseInt(r,10):r,s=typeof o=="string"?parseInt(o,10):o;if(!isNaN(i)&&!isNaN(s)&&(window.UserLeap.windowDimensions={width:i,height:s}),!window.UserLeap.frameId)return;const a=document.getElementById(window.UserLeap.frameId);!a||(window.UserLeap.useMobileStyling&&((c=window.UserLeap.windowDimensions)!=null&&c.width&&(a.style.width=`${window.UserLeap.windowDimensions.width}px`),(d=window.UserLeap.windowDimensions)!=null&&d.height&&(a.style.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`),a.contentDocument&&(a.style.height=String(ar(a.contentDocument))+"px")),V.emit(N.SurveyDimensions,{name:N.SurveyDimensions,contentFrameWidth:a.clientWidth,contentFrameHeight:a.clientHeight}))},logoutUser(){window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,window.UserLeap.localStorageAvailable&&(localStorage.removeItem(rt),localStorage.removeItem(Kt)),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),Wo(),window.UserLeap._queue.unpause()},teardown(){ja(),window.UserLeap("dismissActiveSurvey",fe.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(r){const o=JSON.parse(r);gt.setOptimizelyExperiment(o)}};Object.assign(window.UserLeap,n)};async function Fa(e){const t=it(window.UserLeap);let n=await ge(ce("1",[Ce],"config"),{headers:t});const r="TypeError";if(window.UserLeap.error=n.error,!n.ok&&n.error&&n.error.name===r&&(window.UserLeap._API_URL="https://api.sprig.com",window.UserLeap.reportError("sprigDomainRequest",n.error),n=await ge(ce("1",[Ce],"config"),{headers:t})),!n.ok)return n.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",n.error),n.error&&window.UserLeap.reportError("applyRemoteConfig",n.error)),zt("Disabled: failed to fetch configuration"),e;const o=n.json;return o!=null&&o.disabled?(zt(`Disabled: ${o.disabled}`),{disabled:o.disabled}):Object.assign({},e,o)}async function za(e,t){const n=window.__cfg&&window.__cfg.mode,r=hn(),o=window.UserLeap.envId,i=window.document.documentElement,s={mode:n,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:i.clientWidth,clientHeight:i.clientHeight,location:window.location.href,language:window.navigator.language},a={action:e,err:{message:t.message,stack:t.stack},meta:s,vid:r,envId:o};(await we(ce("1",null,"errors"),{method:"POST",headers:{[le.Error]:window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)},0,!0)).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function qa(e={}){async function t(){if(window.UserLeap.loaded)return;if(window.UserLeap.UPDATES=Xt,window.UserLeap.reportError=za,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const a in window.UserLeap._config)window.UserLeap[a]=window.UserLeap._config[a];if(!window.UserLeap.envId)if(window.UserLeap.appId)window.UserLeap.envId=window.UserLeap.appId;else throw new Error("Missing Environment id");window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const n=Aa();window.UserLeap.localStorageAvailable=n;const r=window.UserLeap.sampleRate;if(r)if(!n)window.UserLeap.debugMode&&console.info("[DEBUG] Sprig cannot sample users without localStorage permissions");else{let a=Ae("sampled");if(a===null&&(a=Math.random()<r,ne("sampled",a)),!a)return}else n&&Ae("sampled")!==null&&ne("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new Ea(window.UserLeap,[]),window.UserLeap._queue.pause();for(let a=0;a<o.length;a++)window.UserLeap._queue.push(o[a]);const i=Ae("token");i?(window.UserLeap.token=i,window.UserLeap.visitorId=Ae("vid"),window.UserLeap.userId=Ae("uid"),window.UserLeap.partnerAnonymousId=Ae("aid")):(window.UserLeap.localStorageAvailable&&localStorage.removeItem(rt),Wo());const s=await Fa(e);Ba(s),await Ha(s),window.UserLeap._queue.unpause(),V.emit(N.SDKReady),V.emit(N.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}document.readyState==="complete"?t():window.attachEvent?window.attachEvent("onload",t):window.addEventListener("load",t,!1)}class kt{constructor(){se(this,"UPDATES",Xt)}displaySurvey(t){window.Sprig("displaySurvey",t)}previewSurvey(t){window.Sprig("previewSurvey",t)}reviewSurvey(t){window.Sprig("reviewSurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,n){window.Sprig("setAttribute",t,n)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,n){window.Sprig("addListener",t,n)}removeListener(t,n){window.Sprig("removeListener",t,n)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,n={},r={}){window.Sprig("track",t,n,r)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,n){window.Sprig("setWindowDimensions",t,n)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}}const Jt={configure:e=>{if(!e.envId&&!e.environmentId)throw new Error("Initialization Error: Sprig configure requires an environmentId");if(e.envId||(e.envId=e.environmentId||""),e.installationMethod=Se.Npm,window.Sprig)return window.Sprig;window.Sprig=function(){window.Sprig._queue.push(arguments)},Object.getOwnPropertyNames(kt.prototype).map(n=>{n!=="constructor"&&(window.Sprig[n]=kt.prototype[n])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,qa(e),window.Sprig}},Wa={sprig:Jt,SprigAPI:kt,configure:Jt.configure};exports.SprigAPI=kt;exports.default=Wa;exports.sprig=Jt;
|