@telia-ace/knowledge-widget-types-grid 1.0.54 → 1.1.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/create-params-13c11e30.js +1 -0
- package/create-params-4e652cc7.mjs +24 -0
- package/index-373df3a5.js +6 -0
- package/index-37d41a7c.js +1 -0
- package/index-4000749f.mjs +18 -0
- package/index-4a7683d6.mjs +7686 -0
- package/index-53f86cb1.mjs +80 -0
- package/index-5c9c2abf.mjs +883 -0
- package/index-6573c0b0.js +1258 -0
- package/index-83935001.js +1 -0
- package/index-89e0c636.js +1 -0
- package/index-8ea3d174.mjs +81 -0
- package/index-a20f39e4.mjs +1709 -0
- package/index-a53df8cf.js +642 -0
- package/index-da27700c.js +9 -0
- package/index-f2febaed.mjs +792 -0
- package/index.js +1 -0
- package/index.mjs +23 -0
- package/package.json +14 -25
- package/render-6b17449a.js +1 -0
- package/render-e363a527.mjs +57 -0
- package/unmount-063d8ea3.mjs +5 -0
- package/unmount-7ebc3b77.js +1 -0
- package/{dist/widget → widget}/services.d.ts +1 -1
- package/LICENSE.txt +0 -6
- package/README.md +0 -4
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/widget → widget}/extended-widget.d.ts +0 -0
- /package/{dist/widget → widget}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function b(a={}){const{phrase:f="",category:e,guideCategory:i,contactCategory:o,take:c,connectionKey:d,accordion:g,id:p,uriName:s,sorting:u,tag:r,tagId:n,tagTitle:l,...m}=a,t={};return Object.keys(m).forEach(y=>{typeof a[y]=="string"&&(t[y]=a[y])}),typeof f=="string"&&f.length&&(t.phrase=f),f===null&&(t.phrase=f),typeof i=="string"&&i!=="0"&&(t.guideCategory=i),typeof i=="number"&&i!==0&&(t.guideCategory=i),typeof i=="object"&&i!==null&&(typeof i.id=="string"&&i.id!=="0"&&(t.guideCategory=i.id),typeof i.id=="number"&&i.id!==0&&(t.guideCategory=i.id)),typeof o=="string"&&o!=="0"&&(t.contactCategory=o),typeof o=="number"&&o!==0&&(t.contactCategory=o),typeof o=="object"&&o!==null&&(typeof o.id=="string"&&o.id!=="0"&&(t.contactCategory=o.id),typeof o.id=="number"&&o.id!==0&&(t.contactCategory=o.id)),typeof e=="string"&&e!=="0"&&(t.category=e),typeof e=="number"&&e!==0&&(t.category=e),typeof e=="object"&&e!==null&&(typeof e.id=="string"&&e.id!=="0"&&(t.category=e.id),typeof e.id=="number"&&e.id!==0&&(t.category=e.id)),p&&(t.id=p),s&&(+t.category||+t.guideCategory||+t.guide||+t.contactCategory||+t.contactMethod)&&(t.uriName=s),d&&(t.connectionKey=d),c&&(t.take=c),u&&(t.sorting=u),typeof g=="string"&&g.length>0&&(t.accordion=g),typeof r=="string"&&r!=="0"&&(t.tag=r),typeof r=="number"&&r!==0&&(t.tag=r),Array.isArray(r)&&r.length&&(t.tag=r),(typeof n=="string"||typeof n=="number")&&(t.tagId=n),typeof l=="string"&&(t.tagTitle=l),typeof t.tag=="string"&&(t.tag=t.tag.split(",")),t}exports.createParams=b;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function m(a = {}) {
|
|
2
|
+
const {
|
|
3
|
+
phrase: f = "",
|
|
4
|
+
category: e,
|
|
5
|
+
guideCategory: i,
|
|
6
|
+
contactCategory: o,
|
|
7
|
+
take: c,
|
|
8
|
+
connectionKey: d,
|
|
9
|
+
accordion: g,
|
|
10
|
+
id: p,
|
|
11
|
+
uriName: s,
|
|
12
|
+
sorting: u,
|
|
13
|
+
tag: r,
|
|
14
|
+
tagId: n,
|
|
15
|
+
tagTitle: l,
|
|
16
|
+
...b
|
|
17
|
+
} = a, t = {};
|
|
18
|
+
return Object.keys(b).forEach((y) => {
|
|
19
|
+
typeof a[y] == "string" && (t[y] = a[y]);
|
|
20
|
+
}), typeof f == "string" && f.length && (t.phrase = f), f === null && (t.phrase = f), typeof i == "string" && i !== "0" && (t.guideCategory = i), typeof i == "number" && i !== 0 && (t.guideCategory = i), typeof i == "object" && i !== null && (typeof i.id == "string" && i.id !== "0" && (t.guideCategory = i.id), typeof i.id == "number" && i.id !== 0 && (t.guideCategory = i.id)), typeof o == "string" && o !== "0" && (t.contactCategory = o), typeof o == "number" && o !== 0 && (t.contactCategory = o), typeof o == "object" && o !== null && (typeof o.id == "string" && o.id !== "0" && (t.contactCategory = o.id), typeof o.id == "number" && o.id !== 0 && (t.contactCategory = o.id)), typeof e == "string" && e !== "0" && (t.category = e), typeof e == "number" && e !== 0 && (t.category = e), typeof e == "object" && e !== null && (typeof e.id == "string" && e.id !== "0" && (t.category = e.id), typeof e.id == "number" && e.id !== 0 && (t.category = e.id)), p && (t.id = p), s && (+t.category || +t.guideCategory || +t.guide || +t.contactCategory || +t.contactMethod) && (t.uriName = s), d && (t.connectionKey = d), c && (t.take = c), u && (t.sorting = u), typeof g == "string" && g.length > 0 && (t.accordion = g), typeof r == "string" && r !== "0" && (t.tag = r), typeof r == "number" && r !== 0 && (t.tag = r), Array.isArray(r) && r.length && (t.tag = r), (typeof n == "string" || typeof n == "number") && (t.tagId = n), typeof l == "string" && (t.tagTitle = l), typeof t.tag == "string" && (t.tag = t.tag.split(",")), t;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
m as c
|
|
24
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var p=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},b={searchParams:"URLSearchParams"in p,iterable:"Symbol"in p&&"iterator"in Symbol,blob:"FileReader"in p&&"Blob"in p&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in p,arrayBuffer:"ArrayBuffer"in p};function re(t){return t&&DataView.prototype.isPrototypeOf(t)}if(b.arrayBuffer)var ne=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],se=ArrayBuffer.isView||function(t){return t&&ne.indexOf(Object.prototype.toString.call(t))>-1};function S(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function M(t){return typeof t!="string"&&(t=String(t)),t}function G(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return b.iterable&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}d.prototype.append=function(t,e){t=S(t),e=M(e);var r=this.map[t];this.map[t]=r?r+", "+e:e};d.prototype.delete=function(t){delete this.map[S(t)]};d.prototype.get=function(t){return t=S(t),this.has(t)?this.map[t]:null};d.prototype.has=function(t){return this.map.hasOwnProperty(S(t))};d.prototype.set=function(t,e){this.map[S(t)]=M(e)};d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)};d.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),G(t)};d.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),G(t)};d.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),G(t)};b.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function L(t){if(!t._noBody){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}}function W(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function oe(t){var e=new FileReader,r=W(e);return e.readAsArrayBuffer(t),r}function ie(t){var e=new FileReader,r=W(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}function ae(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function V(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function K(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?typeof t=="string"?this._bodyText=t:b.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:b.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():b.arrayBuffer&&b.blob&&re(t)?(this._bodyArrayBuffer=V(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):b.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||se(t))?this._bodyArrayBuffer=V(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof t=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var t=L(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=L(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(b.blob)return this.blob().then(oe);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var t=L(this);if(t)return t;if(this._bodyBlob)return ie(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ae(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(ue)}),this.json=function(){return this.text().then(JSON.parse)},this}var ce=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function he(t){var e=t.toUpperCase();return ce.indexOf(e)>-1?e:t}function j(t,e){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof j){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=he(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in p){var s=new AbortController;return s.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function ue(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),o=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(s))}}),e}function fe(t){var e=new d,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var o=n.split(":"),s=o.shift().trim();if(s){var a=o.join(":").trim();try{e.append(s,a)}catch(c){console.warn("Response "+c.message)}}}),e}K.call(j.prototype);function P(t,e){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}K.call(P.prototype);P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})};P.error=function(){var t=new P(null,{status:200,statusText:""});return t.status=0,t.type="error",t};var le=[301,302,303,307,308];P.redirect=function(t,e){if(le.indexOf(e)===-1)throw new RangeError("Invalid status code");return new P(null,{status:e,headers:{location:t}})};var O=p.DOMException;try{new O}catch{O=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},O.prototype=Object.create(Error.prototype),O.prototype.constructor=O}function Y(t,e){return new Promise(function(r,n){var o=new j(t,e);if(o.signal&&o.signal.aborted)return n(new O("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var i={statusText:s.statusText,headers:fe(s.getAllResponseHeaders()||"")};o.url.startsWith("file://")&&(s.status<200||s.status>599)?i.status=200:i.status=s.status,i.url="responseURL"in s?s.responseURL:i.headers.get("X-Request-URL");var u="response"in s?s.response:s.responseText;setTimeout(function(){r(new P(u,i))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){n(new O("Aborted","AbortError"))},0)};function c(i){try{return i===""&&p.location.href?p.location.href:i}catch{return i}}if(s.open(o.method,c(o.url),!0),o.credentials==="include"?s.withCredentials=!0:o.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(b.blob?s.responseType="blob":b.arrayBuffer&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof d||p.Headers&&e.headers instanceof p.Headers)){var h=[];Object.getOwnPropertyNames(e.headers).forEach(function(i){h.push(S(i)),s.setRequestHeader(i,M(e.headers[i]))}),o.headers.forEach(function(i,u){h.indexOf(u)===-1&&s.setRequestHeader(u,i)})}else o.headers.forEach(function(i,u){s.setRequestHeader(u,i)});o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){s.readyState===4&&o.signal.removeEventListener("abort",a)}),s.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}Y.polyfill=!0;p.fetch||(p.fetch=Y,p.Headers=d,p.Request=j,p.Response=P);self.fetch.bind(self);const F="functional",U="Humany__parameters";function de(t){const e={};return t&&Object.keys(t).forEach(r=>{const n=t[r];(_(n)==="array"?n:[n]).forEach(o=>{typeof e[r]>"u"&&(e[r]=[]),e[r].push(o)})}),e}class pe{constructor(e,r){this.isLoaded=!!e,this.parameters=de(e),r&&typeof r.get=="function"&&(this.container=r)}getAll(){return this.ensureIsLoaded(),l(!0,{},this.parameters)}add(e,r){this.ensureIsLoaded(),this.parameters[e]||(this.parameters[e]=[]),this.parameters[e].push(r),this.persist()}set(e,r){this.ensureIsLoaded(),this.parameters[e]=[r],this.persist()}remove(e,r){if(this.ensureIsLoaded(),typeof r>"u")delete this.parameters[e];else{const n=this.parameters[e]||[];n.forEach((o,s)=>{o===r&&n.splice(s,1)}),this.parameters[e]=n}this.persist()}clear(){this.ensureIsLoaded(),this.parameters={},this.persist()}persist(){try{R(this.container).indexOf(F)>-1?C(U,this.parameters,1):C(U,"",-1)}catch(e){window.console&&window.console.warn&&window.console.warn("Error occured when persisting parameter bag.",e)}}ensureIsLoaded(){if(!this.isLoaded){try{const e=q(U);this.parameters=e||{},R(this.container).indexOf(F)===-1&&C(U,"",-1)}catch(e){window.console&&window.console.warn&&window.console.warn("Error occured when loading parameter bag.",e)}this.isLoaded=!0}}}function E(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}function z(){return E()+E()+"-"+E()+"-"+E()+"-"+E()+"-"+E()+E()+E()}const Z="analytical",k="Humany__clientId";let T="";function ye(t){if(R(t).indexOf(Z)===-1)return C(k,"",-1),T.length||(T=z()),T;const e=q(k);return e||(T.length||(T=z()),C(k,T,1)),e||T}function be(){return"Default"}function me(...t){const e=window.location;return[t[0]!==!1?"http:":e.protocol,"//",e.host,e.pathname].join("")}function ge(){}const we={"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object String]":"string"};function _(t){return t==null?t+"":typeof t=="object"||typeof t=="function"?we[{}.toString.call(t)]||"object":typeof t}function f(t){return _(t)==="function"}function J(t){let e;if(!t||_(t)!=="object"||t.nodeType)return!1;try{if(t.constructor&&!Object.prototype.hasOwnProperty.call(t,"constructor")&&!Object.prototype.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(e in t);return e===void 0||Object.prototype.hasOwnProperty.call(t,e)}function l(...t){let e,r,n,o,s,a,c=t[0]||{},h=1;const i=t.length;let u=!1;for(typeof c=="boolean"&&(u=c,c=t[1]||{},h=2),typeof c!="object"&&!f(c)&&(c={});h<i;h++)if((e=t[h])!=null)for(r in e)n=c[r],o=e[r],c!==o&&(u&&o&&(J(o)||(s=_(o)==="array"))?(s?(s=!1,a=n&&_(n)==="array"?n:[]):a=n&&J(n)?n:{},c[r]=l(u,a,o)):o!==void 0&&(c[r]=o));return c}const q=t=>{const e=new RegExp(`(?:^|;)\\s?${t}=(.*?)(?:;|$)`,"i"),r=document.cookie.match(e),n=r&&r[1];if(n){if(t==="Humany__clientId")try{return JSON.parse(n)}catch{const s=JSON.stringify(n);return JSON.parse(s)}return JSON.parse(n)}},C=(t,e,r)=>{const n=JSON.stringify(e).trim().replace(/^"+|"+$/g,""),o=`${t}=${n}`,s=`expires=${ve(r)}`,a="path=/",c="SameSite=None",h="Secure";return document.cookie=`${o}; ${s}; ${a}; ${c}; ${h}`},R=t=>{const e=["necessary"];if(!t)return e;const r=t.get("$widget");if(!r||!r.implementation||!r.implementation.tenant)return e;const{implementation:{tenant:n}}=r,o=q(`humany_${n}`);return!o||!o.storagePolicy||!o.storagePolicy.value||!Array.isArray(o.storagePolicy.value)||!o.storagePolicy.value.length?e:o.storagePolicy.value},ve=(t=1)=>{const e=new Date;return e.setTime(e.getTime()+t*24*60*60*1e3),e.toUTCString()},Pe=(t=["necessary"])=>{t.indexOf(F)===-1&&C(U,"",-1),t.indexOf(Z)===-1&&C(k,"",-1)};function $(t,e,r){if(typeof e>"u"||typeof r>"u")return t;const n=t&&t.indexOf("?")!==-1?"&":"?";return`${t}${n}${encodeURIComponent(e)}=${encodeURIComponent(r)}`}const X="p.";function ee(t,e){let r=t;return Object.keys(e).forEach(n=>{const o=e[n];_(o)==="array"?o.forEach(s=>{r=$(r,`${X}${n}`,s)}):r=$(r,`${X}${n}`,o)}),r}class Q{constructor(e,r){l(!0,this,e,{_client:r})}}class H{constructor(e,r){l(!0,this,e,{_client:r})}}function A(t,e,r,n){const o=[];return t[e].forEach(s=>{const a=new r(s,n),c=s[e],h=_(c);s[e]&&(h==="array"||h==="object")&&(a[e]=A(s,e,r,n)),o.push(a)}),o}class N{constructor(e,r){l(!0,this,e,{_client:r})}}function x(t,e){return f(t)?e?t.call(e):t.call(window):t}function I(t,e,r,n){let o=Promise.resolve(r);for(let s=0,a=t.length;s<a;s++){const c=t[s][e];f(c)&&(o=o.then(()=>c(r,n)))}return o}class Ee{constructor(e,r={}){this.setBaseUrl(e),this.globalOptions=r,this.interceptors=r.interceptors||[]}constructUrl(e){return this.baseUrl+e}setBaseUrl(e){this.baseUrl=e+(e[e.length-1]!=="/"?"/":"")}request(e,r){const n=l(!0,{},this.globalOptions,r);let o=this.constructUrl(e);const s=this.interceptors;return n.credentials==="include"&&(o=$(o,"credentials","true")),new Promise((a,c)=>{I(s,"request",{url:o,options:n}).then(h=>fetch(h.url,h.options).then(i=>({response:i,request:h}))).then(({response:h,request:i})=>{if(h.ok){const u=h;return h.json().then(w=>{I(s,"response",{response:h,json:w,request:i}).then(()=>{n.envelope?a({json:w,response:u}):a(w),I(s,"responseEnd",{response:h,json:w,request:i})})})}else I(s,"responseError",h).then(u=>{f(n.onError)&&n.onError(u),c(u)})}).catch(h=>{I(s,"responseError",h).then(i=>{f(n.onError)&&n.onError(i),c(i)})})})}}const te=Ee;/*!
|
|
3
|
+
* Humany Service Client Library
|
|
4
|
+
* Version: 2.0
|
|
5
|
+
* Copyright 2017, Telia Company AB, http://www.humany.com/
|
|
6
|
+
*/class B{constructor(...e){const r=e[1]||{};if(this.proxy=typeof e[0]=="string"?new te(e[0]):e[0],this.settings=l(!0,{},B.defaults,e[1]||{}),this.parameters=new pe(e[2],e[3]),this.current={phrase:r.phrase},this.guideCache={},this.feedbackTypes={positive:"Positive",negative:"Negative",comment:"Comment"},this.handoverTypes={email:"Email",chat:"Chat",callback:"Callback",phone:"Phone",emailComplementary:"ComplementaryEmail",chatComplementary:"ComplementaryChat",callbackComplementary:"ComplementaryCallback",phoneComplementary:"ComplementaryPhone"},this.subscriptions=[],e[3]&&typeof e[3].get=="function"){this.container=e[3];const n=this.container.get("$widget");n&&n.events&&this.subscriptions.push(n.events.subscribe("storage:policy-changed",(o,s)=>Pe(s)))}}getConfiguration(){return{language:x(this.settings.language,this),client:x(()=>this.settings.client(this.container),this),funnel:x(this.settings.funnel,this),site:x(this.settings.site,this),reader:x(this.settings.reader,this),perspective:x(this.settings.perspective,this)}}customRequest(e,r,n={}){const o=n.configuration||{},s=n.parameters;return e=this.constructPath(e,o,s),this.proxy.request(e,{method:r,body:n.body}).then(a=>(n.success&&n.success(a),a)).catch(a=>(n.error&&n.error(a),a))}constructPath(e,r,n=!0){let o=e;const s=l(this.getConfiguration(),r);if(Object.keys(s).filter(a=>{const c=s[a];return c!==null&&typeof c<"u"}).forEach(a=>o=$(o,a,x(s[a]))),n){const a=n===!0?this.parameters.getAll():n;o=ee(o,a)}return o}match(...e){const r=e[0];let n={},o,s;typeof e[1]=="object"?(n=e[1]||{},o=e[2],s=e[3]):(o=e[1],s=e[2]);function a(y){if(f(o)){const v=this;y=this.settings.useProxyClasses&&y?(()=>(y.Matches=A(y,"Matches",N,v),y))():y,o(y)}return y}function c(y){f(s)&&s(y)}const h=l(!0,this.getConfiguration(),this.settings.paging,n),i={};let u="GET";i.categories=h.categories||h.categoryId,i.language=h.language,i.phrase=r,i.attributes=h.attributes,i.skip=h.skip,i.take=h.take,i.reader=h.reader,i.disableNotices=h.disableNotices,i.tags=h.tags,i.includeCategories=h.includeCategories,i.groupByCategory=h.groupByCategory,n.statisticsDisabled||(u="POST",i.funnel=h.funnel,i.client=h.client,i.site=h.site,this.current.phrase=r);const w="guides";n.sorting&&(i["sorting.type"]=n.sorting.type,i["sorting.direction"]=n.sorting.direction);const m=this.constructPath(w,i);return this.proxy.request(m,{method:u}).then(a.bind(this)).catch(c.bind(this))}getGuide(...e){const r=e[0];let n,o={},s,a;typeof e[1]=="function"?(s=e[1],a=e[2]):typeof e[1]=="object"?(o=e[1]||{},s=e[2],a=e[3]):typeof e[1]=="string"?(n=e[1],typeof e[2]=="function"?(s=e[2],a=e[3]):(o=e[2]||{},s=e[3],a=e[4])):!e[1]&&typeof e[2]=="function"&&(s=e[2],a=e[3]);function c(v){if(f(s)){const g=this.settings.useProxyClasses&&v?new N(v,this):v;this.guideCache[g.Id]=g,s(g)}return v}function h(v){return f(a)&&a(v),Promise.reject(v)}const i=l(!0,this.getConfiguration(),o),u={};let w="GET";u.connectionId=n||i.connectionId,u.perspective=i.perspective,u.reader=i.reader,u.phrase=this.current.phrase,this.parameters.remove("LastGuideId"),this.parameters.add("LastGuideId",r);let m=`guides/${r}`;u.connectionId&&(m+=`/${u.connectionId}`);let y="";return!o.statisticsDisabled&&!u.connectionId?(w="POST",y=this.constructPath(m,l({},this.current,o))):y=this.constructPath(m,l({},this.current,o),!1),this.proxy.request(y,{method:w}).then(c.bind(this)).catch(h.bind(this))}getCategories(...e){let r={},n,o;typeof e[0]=="object"?(r=e[0]||{},n=e[1],o=e[2]):(n=e[0],o=e[1]);function s(i){if(f(n)){const u=this;i=this.settings.useProxyClasses&&i?(()=>(i.Children=A(i,"Children",Q,u),i))():i,n(i)}return i}function a(i){f(o)&&o(i)}let c="categories";r.categoryId&&(c+="/"+r.categoryId);const h=this.constructPath(c,l({},this.current,r));return this.proxy.request(h,{method:"GET"}).then(s.bind(this)).catch(a.bind(this))}answer(...e){const r=e[0],n=e[1];let o={},s,a,c;typeof e[2]=="object"?(o=e[2]||{},s=e[3],a=e[4]):(s=e[2],a=e[3]);const h=!!o.persist;function i(){!h&&c&&this.parameters.remove(c.Condition.ParameterName,c.Condition.Value)}function u(g){if(i(),f(s)){const D=this.settings.useProxyClasses&&g?new N(g,this):g;this.guideCache[D.Id]=D,s(D)}}function w(g){i(),f(a)&&a(g)}const m=this.guideCache[r];m.Options&&m.Options.forEach(g=>{this.parameters.remove(g.Condition.ParameterName,g.Condition.Value),g.ConnectionId===n&&(c=g)}),this.parameters.add(c.Condition.ParameterName,c.Condition.Value);const y=`guides/${r}/${n}`,v=this.constructPath(y,l({},this.current,o));return this.proxy.request(v,{method:"GET"}).then(u.bind(this)).catch(w.bind(this))}giveFeedback(...e){const r=e[0];let n,o,s={},a,c;typeof e[2]=="string"?(n=e[1],o=e[2],typeof e[3]=="object"?(s=e[3]||{},a=e[4],c=e[5]):(a=e[3],c=e[4])):(o=e[1],typeof e[2]=="object"&&(s=e[2]||{},a=e[3],c=e[4]));function h(m){return f(a)&&a(m),m}function i(m){return f(c)&&c(m),m}const u=`guides/${r}${n?"/"+n:""}/feedback`,w=this.constructPath(u,l({},s,{feedbackType:o}));return this.proxy.request(w,{method:"POST"}).then(h.bind(this)).catch(i.bind(this))}completeContactMethod(...e){const r=e[0];let n={},o,s;typeof e[1]=="object"?(n=e[1],o=e[2],s=e[3]):(o=e[1],s=e[2]);function a(u){f(o)&&o(u)}function c(u){f(s)&&s(u)}const h=`contactmethods/${r}/completed`,i=this.constructPath(h,n);return this.proxy.request(i,{method:"PUT"}).then(a.bind(this)).catch(c.bind(this))}getContactMethod(...e){const r=e[0];let n={},o,s;typeof e[1]=="object"?(n=e[1],o=e[2],s=e[3]):(o=e[1],s=e[2]);function a(u){if(f(o))o(u.ContactMethod);else return u}function c(u){if(f(s))s(u);else return u}const h=`contactmethods/${r}`,i=this.constructPath(h,l({},this.current,n));return this.proxy.request(i,{method:"GET"}).then(a.bind(this)).catch(c.bind(this))}contactMethods(...e){let r,n={},o,s;typeof e[0]=="number"?(r=e[0],n=e[1]||{},o=e[2],s=e[3]):typeof e[0]=="object"?(n=e[0]||{},o=e[1],s=e[2]):(o=e[0],s=e[1]);function a(u){return f(o)&&(u=this.settings.useProxyClasses&&u?(()=>(u.Matches=A(u,"Matches",H),u))():u,o(u)),u}function c(u){return f(s)&&s(u),u}const h=r?`guides/${r}/contactmethods`:"contactmethods",i=this.constructPath(h,l({},this.current,n));return this.proxy.request(i,{method:"GET"}).then(a.bind(this)).catch(c.bind(this))}contacts(...e){let r,n={},o,s;typeof e[0]=="number"?(r=e[0],typeof e[1]=="object"?(n=e[1],o=e[2],s=e[3]):(o=e[1],s=e[2])):typeof e[0]=="object"?(n=e[0]||{},o=e[1],s=e[2]):(o=e[0],s=e[1]);function a(i){if(f(o))i&&this.settings.useProxyClasses&&(i.Children&&(i.Children=A(i,"Children",Q)),i.Matches&&(i.Matches=A(i,"Matches",H)),i.Highlighted&&(i.Highlighted=A(i,"Highlighted",H))),o(i);else return i}function c(i){if(f(s))s(i);else return i}const h=this.constructPath(`contacts/${r||""}`,l({},this.current,n));return this.proxy.request(h,{method:"GET"}).then(a.bind(this)).catch(c.bind(this))}getSettings(e){const r=this.constructPath("config",this.current);return this.proxy.request(r,{method:"GET"}).then(e)}getAuthorized(e,r){const n=this.constructPath("interfaceauthorized",this.current);return this.proxy.request(n,{method:"GET",credentials:"include"}).then(e).catch(r)}submitForm(e,r,n,o,s){let a="forms/"+e;return n&&(a+="/"+n),a=this.constructPath("config",l({},this.current,r)),this.proxy.request(a,"POST",r,o,s)}getTab(e,r,n,o){var s=arguments;typeof s[1]=="object"?(r=s[1],n=s[2],o=s[3]):(r={},n=s[1],o=s[2]);const a=`tabs/${e}`;return this.proxy.request(a,{method:"GET"}).then(n).catch(o)}dispose(){this.subscriptions.forEach(e=>e())}}B.feedbackTypes={positive:"Positive",negative:"Negative",comment:"Comment"};B.handoverTypes={email:"Email",chat:"Chat",callback:"Callback",phone:"Phone",emailComplementary:"ComplementaryEmail",chatComplementary:"ComplementaryChat",callbackComplementary:"ComplementaryCallback",phoneComplementary:"ComplementaryPhone"};B.defaults={client:ye,funnel:be,site:me,language:ge,paging:{skip:0,take:10},useProxyClasses:!1};B.version="1.0";const Ce=B;exports.ServiceClient=Ce;exports.ServiceProxy=te;exports.appendParameters=ee;exports.appendQueryString=$;exports.getCookie=q;exports.getStoragePolicyConsent=R;exports.setCookie=C;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var a=(n,e,t)=>e in n?p(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>(a(n,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-6573c0b0.js");require("react/jsx-runtime");require("@emotion/styled");require("@emotion/react");require("react");require("react-transition-group");require("react-dom");require("react-router-dom");require("react-router");class m{constructor(e){s(this,"events");const{events:t}=e.get("$widget");this.events=t.createChild(this)}action(e,t,r){this.events.dispatch("data:action",{action:t,value:r,target:e},{bubbles:!0})}subscribe(e,t){return this.events.subscribe("data:action",(r,{action:i,value:c,target:l})=>e===l&&t(e,i,c))}}class u{constructor(e){s(this,"aliases",new Map);s(this,"components",new Map);s(this,"events");s(this,"logger",new o.Logger);const{events:t}=e.get("$widget");this.events=t}getComponent(e){const t=this.aliases.get(e),r=this.components.get(t||e)||null;return process.env.NODE_ENV!=="production"&&(r||this.logger.warn(t||e,`Unable to resolve component: "${t||e}". You most likely forgot to register the required plugin for: ${t||e}.`)),r}registerComponent(e,t){return this.components.set(e,t),this.events.dispatch("component-resolver:resolve",e),()=>{this.components.delete(e)}}registerResolver(e,t){return this.events.subscribe("component-resolver:resolve",(r,i)=>{if(i===e){const c=this.getComponent(e);t(c)}})}registerAlias(e,t){return this.aliases.set(e,t),this.events.dispatch("component-resolver:resolve",e),()=>{this.aliases.delete(e)}}}exports.ActionsController=o.ActionsController;exports.ComponentNode=o.ComponentNode;exports.ComponentNodeController=o.ComponentNodeController;exports.ComponentPlatform=o.ComponentPlatform;exports.ComponentQuery=o.ComponentQuery;exports.WidgetRenderState=o.WidgetRenderState;exports.asDescriptor=o.asDescriptor;exports.createChildren=o.createChildren;exports.createComponentModel=o.createComponentModel;exports.createEventSubscriber=o.createEventSubscriber;exports.findComponent=o.findComponent;exports.findVisibleComponents=o.findVisibleComponents;exports.traverseComponents=o.traverseComponents;exports.ActionResolver=m;exports.ComponentResolver=u;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { D as n, a as T, F as c, S as D, b as S, d, f } from "./index-4a7683d6.mjs";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@emotion/styled";
|
|
4
|
+
import "@emotion/react";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-transition-group";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-router-dom";
|
|
9
|
+
import "react-router";
|
|
10
|
+
export {
|
|
11
|
+
n as DataClient,
|
|
12
|
+
T as DataType,
|
|
13
|
+
c as FeedbackType,
|
|
14
|
+
D as ServiceClientQueryType,
|
|
15
|
+
S as SortingType,
|
|
16
|
+
d as determineServiceClientQueryType,
|
|
17
|
+
f as formatLegacyData
|
|
18
|
+
};
|