@luizleon/sf.prefeiturasp.vuecomponents 4.1.27 → 4.1.28

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.
@@ -407,5 +407,5 @@ If you think this parameter should be updatable, request it here: https://github
407
407
  - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
408
408
  - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
409
409
 
410
- For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),i.enable=!1,e.silentCheckSsoFallback&&(e.silentCheckSsoRedirectUri=!1)),document.body.removeChild(p),window.removeEventListener("message",b),u.setSuccess()))};window.addEventListener("message",b,!1)}else u.setSuccess();return Q(u.promise,e.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function Ye(u){if(!u||u=="default")return{login:function(w){return window.location.assign(e.createLoginUrl(w)),Y().promise},logout:async function(w){if(((w==null?void 0:w.logoutMethod)??e.logoutMethod)==="GET"){window.location.replace(e.createLogoutUrl(w));return}const P=e.createLogoutUrl(w),A=await fetch(P,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:e.idToken,client_id:e.clientId,post_logout_redirect_uri:n.redirectUri(w,!1)})});if(A.redirected){window.location.href=A.url;return}if(A.ok){window.location.reload();return}throw new Error("Logout failed, request returned an error code.")},register:function(w){return window.location.assign(e.createRegisterUrl(w)),Y().promise},accountManagement:function(){var w=e.createAccountUrl();if(typeof w<"u")window.location.href=w;else throw"Not supported by the OIDC server";return Y().promise},redirectUri:function(w,_){return w&&w.redirectUri?w.redirectUri:e.redirectUri?e.redirectUri:location.href}};if(u=="cordova"){i.enable=!1;var p=function(w,_,P){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(w,_,P):window.open(w,_,P)},b=function(w){return w&&w.cordovaOptions?Object.keys(w.cordovaOptions).reduce(function(_,P){return _[P]=w.cordovaOptions[P],_},{}):{}},S=function(w){return Object.keys(w).reduce(function(_,P){return _.push(P+"="+w[P]),_},[]).join(",")},y=function(w){var _=b(w);return _.location="no",w&&w.prompt=="none"&&(_.hidden="yes"),S(_)},E=function(){return e.redirectUri||"http://localhost"};return{login:function(w){var _=Y(),P=y(w),A=e.createLoginUrl(w),N=p(A,"_blank",P),H=!1,ve=!1,ae=function(){ve=!0,N.close()};return N.addEventListener("loadstart",function(le){if(le.url.indexOf(E())==0){var Xe=ee(le.url);I(Xe,_),ae(),H=!0}}),N.addEventListener("loaderror",function(le){if(!H)if(le.url.indexOf(E())==0){var Xe=ee(le.url);I(Xe,_),ae(),H=!0}else _.setError(),ae()}),N.addEventListener("exit",function(le){ve||_.setError({reason:"closed_by_user"})}),_.promise},logout:function(w){var _=Y(),P=e.createLogoutUrl(w),A=p(P,"_blank","location=no,hidden=yes,clearcache=yes"),N;return A.addEventListener("loadstart",function(H){H.url.indexOf(E())==0&&A.close()}),A.addEventListener("loaderror",function(H){H.url.indexOf(E())==0||(N=!0),A.close()}),A.addEventListener("exit",function(H){N?_.setError():(e.clearToken(),_.setSuccess())}),_.promise},register:function(w){var _=Y(),P=e.createRegisterUrl(),A=y(w),N=p(P,"_blank",A);return N.addEventListener("loadstart",function(H){if(H.url.indexOf(E())==0){N.close();var ve=ee(H.url);I(ve,_)}}),_.promise},accountManagement:function(){var w=e.createAccountUrl();if(typeof w<"u"){var _=p(w,"_blank","location=no");_.addEventListener("loadstart",function(P){P.url.indexOf(E())==0&&_.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(w){return E()}}}if(u=="cordova-native")return i.enable=!1,{login:function(w){var _=Y(),P=e.createLoginUrl(w);return universalLinks.subscribe("keycloak",function(A){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var N=ee(A.url);I(N,_)}),window.cordova.plugins.browsertab.openUrl(P),_.promise},logout:function(w){var _=Y(),P=e.createLogoutUrl(w);return universalLinks.subscribe("keycloak",function(A){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),e.clearToken(),_.setSuccess()}),window.cordova.plugins.browsertab.openUrl(P),_.promise},register:function(w){var _=Y(),P=e.createRegisterUrl(w);return universalLinks.subscribe("keycloak",function(A){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var N=ee(A.url);I(N,_)}),window.cordova.plugins.browsertab.openUrl(P),_.promise},accountManagement:function(){var w=e.createAccountUrl();if(typeof w<"u")window.cordova.plugins.browsertab.openUrl(w);else throw"Not supported by the OIDC server"},redirectUri:function(w){return w&&w.redirectUri?w.redirectUri:e.redirectUri?e.redirectUri:"http://localhost"}};throw"invalid adapter type: "+u}var He=function(){if(!(this instanceof He))return new He;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var u=this;function p(){for(var b=new Date().getTime(),S=0;S<localStorage.length;S++){var y=localStorage.key(S);if(y&&y.indexOf("kc-callback-")==0){var E=localStorage.getItem(y);if(E)try{var w=JSON.parse(E).expires;(!w||w<b)&&localStorage.removeItem(y)}catch{localStorage.removeItem(y)}}}}u.get=function(b){if(b){var S="kc-callback-"+b,y=localStorage.getItem(S);return y&&(localStorage.removeItem(S),y=JSON.parse(y)),p(),y}},u.add=function(b){p();var S="kc-callback-"+b.state;b.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(S,JSON.stringify(b))}},je=function(){if(!(this instanceof je))return new je;var u=this;u.get=function(y){if(y){var E=b("kc-callback-"+y);if(S("kc-callback-"+y,"",p(-100)),E)return JSON.parse(E)}},u.add=function(y){S("kc-callback-"+y.state,JSON.stringify(y),p(60))},u.removeItem=function(y){S(y,"",p(-100))};var p=function(y){var E=new Date;return E.setTime(E.getTime()+y*60*1e3),E},b=function(y){for(var E=y+"=",w=document.cookie.split(";"),_=0;_<w.length;_++){for(var P=w[_];P.charAt(0)==" ";)P=P.substring(1);if(P.indexOf(E)==0)return P.substring(E.length,P.length)}return""},S=function(y,E,w){var _=y+"="+E+"; expires="+w.toUTCString()+"; ";document.cookie=_}};function mt(){try{return new He}catch{}return new je}function xe(u){return function(){e.enableLogging&&u.apply(console,Array.prototype.slice.call(arguments))}}}function Wd(t){const e=String.fromCodePoint(...t);return btoa(e)}class Gd{constructor(e){Re(this,"oidc");Re(this,"isAuthenticated",!1);Re(this,"authenticatedWith",null);this.oidc=new _i(e)}async InitAsync(e={}){return await this.oidc.init(e).then(async n=>(this.isAuthenticated=n,this.authenticatedWith=this.AuthenticatedWith(),n)).catch(n=>(console.info("Ocorreu um erro na inicialização. Verifique o console para mais detalhes."),console.error(n),!1))}LoginGovBr(){this.oidc.login({idpHint:"GOV.BR"})}LoginSenhaweb(){var n;const e=(n=this.oidc.authServerUrl)!=null&&n.startsWith("https://keycloak.dev.apps.sf.prefeitura.sp.gov.br/")?"senhawebdev":"senhaweb";this.oidc.login({idpHint:e})}AuthenticatedWith(){var n,o;const e=this.oidc.tokenParsed;return e?(n=e.identity_provider)!=null&&n.startsWith("GOV.BR")?"govbr":(o=e.identity_provider)!=null&&o.startsWith("senhaweb")?"senhaweb":"ad":null}}let ki;function qd(t){ki=new Gd(t)}const Yd=()=>ki;class Xd{constructor(e=null){Re(this,"errors",[]);Re(this,"_value",null);Re(this,"_httpStatusCode");this._value=e,this._httpStatusCode=200}get value(){return this._value}set value(e){this._value=e}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}get httpStatusCode(){return this._httpStatusCode}set httpStatusCode(e){this._httpStatusCode=e}WithError(e){this.errors.push(e),this._httpStatusCode===200&&(this._httpStatusCode=400)}WithErrors(e){e.forEach(n=>this.WithError(n))}}class An{static get IsTouch(){return window.matchMedia("(pointer: coarse)").matches}static GetMaxZindex(e=[]){let n="body > *:not(script):not(style)";for(const r of e)n+=`, ${r}`;const o=Math.max(...Array.from(document.querySelectorAll(n)).map(r=>{const i=getComputedStyle(r).zIndex;return+i==+i?+i:0}));return o>=100?o:100}static AjustarFuso(e){const n=e.getTimezoneOffset()/60;e.setHours(e.getHours()-n)}static Mask(e,n){let o=0,r=e.toString();return n.replace(/#/g,()=>r[o++]||"")}static MaskCpf(e){return An.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return An.Mask(e.padStart(14,"0"),"##.###.###/####-##")}static async DelayAsync(e){return new Promise(n=>setTimeout(n,e))}}function Zd(){document.documentElement.classList.add("app-mounted")}function Si(){st.SetInitialTheme()}function Jd(){st.Toggle()}function Qd(){st.EnableDarkMode()}function ef(){st.EnableLightMode()}function tf(){st.ClearStoredTheme()}Si(),U.AppResult=Xd,U.ClearStoredTheme=tf,U.ConfigAuth=qd,U.EnableDarkMode=Qd,U.EnableLightMode=ef,U.RemovePreloader=Zd,U.SetInitialTheme=Si,U.SfButton=ys,U.SfContent=us,U.SfDrawer=ks,U.SfIcon=ln,U.SfLayout=ns,U.SfMessage=Cs,U.SfNavMenu=vl,U.SfTabNavigation=ps,U.SfTooltip=Nn,U.ToggleTheme=Jd,U.UseAlertService=xd,U.UseAuth=Yd,U.UseConfirmService=Ld,U.UseNavMenuService=Bn,U.Utilities=An,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});
410
+ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),i.enable=!1,e.silentCheckSsoFallback&&(e.silentCheckSsoRedirectUri=!1)),document.body.removeChild(p),window.removeEventListener("message",b),u.setSuccess()))};window.addEventListener("message",b,!1)}else u.setSuccess();return Q(u.promise,e.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function Ye(u){if(!u||u=="default")return{login:function(w){return window.location.assign(e.createLoginUrl(w)),Y().promise},logout:async function(w){if(((w==null?void 0:w.logoutMethod)??e.logoutMethod)==="GET"){window.location.replace(e.createLogoutUrl(w));return}const P=e.createLogoutUrl(w),A=await fetch(P,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:e.idToken,client_id:e.clientId,post_logout_redirect_uri:n.redirectUri(w,!1)})});if(A.redirected){window.location.href=A.url;return}if(A.ok){window.location.reload();return}throw new Error("Logout failed, request returned an error code.")},register:function(w){return window.location.assign(e.createRegisterUrl(w)),Y().promise},accountManagement:function(){var w=e.createAccountUrl();if(typeof w<"u")window.location.href=w;else throw"Not supported by the OIDC server";return Y().promise},redirectUri:function(w,_){return w&&w.redirectUri?w.redirectUri:e.redirectUri?e.redirectUri:location.href}};if(u=="cordova"){i.enable=!1;var p=function(w,_,P){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(w,_,P):window.open(w,_,P)},b=function(w){return w&&w.cordovaOptions?Object.keys(w.cordovaOptions).reduce(function(_,P){return _[P]=w.cordovaOptions[P],_},{}):{}},S=function(w){return Object.keys(w).reduce(function(_,P){return _.push(P+"="+w[P]),_},[]).join(",")},y=function(w){var _=b(w);return _.location="no",w&&w.prompt=="none"&&(_.hidden="yes"),S(_)},E=function(){return e.redirectUri||"http://localhost"};return{login:function(w){var _=Y(),P=y(w),A=e.createLoginUrl(w),N=p(A,"_blank",P),H=!1,ve=!1,ae=function(){ve=!0,N.close()};return N.addEventListener("loadstart",function(le){if(le.url.indexOf(E())==0){var Xe=ee(le.url);I(Xe,_),ae(),H=!0}}),N.addEventListener("loaderror",function(le){if(!H)if(le.url.indexOf(E())==0){var Xe=ee(le.url);I(Xe,_),ae(),H=!0}else _.setError(),ae()}),N.addEventListener("exit",function(le){ve||_.setError({reason:"closed_by_user"})}),_.promise},logout:function(w){var _=Y(),P=e.createLogoutUrl(w),A=p(P,"_blank","location=no,hidden=yes,clearcache=yes"),N;return A.addEventListener("loadstart",function(H){H.url.indexOf(E())==0&&A.close()}),A.addEventListener("loaderror",function(H){H.url.indexOf(E())==0||(N=!0),A.close()}),A.addEventListener("exit",function(H){N?_.setError():(e.clearToken(),_.setSuccess())}),_.promise},register:function(w){var _=Y(),P=e.createRegisterUrl(),A=y(w),N=p(P,"_blank",A);return N.addEventListener("loadstart",function(H){if(H.url.indexOf(E())==0){N.close();var ve=ee(H.url);I(ve,_)}}),_.promise},accountManagement:function(){var w=e.createAccountUrl();if(typeof w<"u"){var _=p(w,"_blank","location=no");_.addEventListener("loadstart",function(P){P.url.indexOf(E())==0&&_.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(w){return E()}}}if(u=="cordova-native")return i.enable=!1,{login:function(w){var _=Y(),P=e.createLoginUrl(w);return universalLinks.subscribe("keycloak",function(A){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var N=ee(A.url);I(N,_)}),window.cordova.plugins.browsertab.openUrl(P),_.promise},logout:function(w){var _=Y(),P=e.createLogoutUrl(w);return universalLinks.subscribe("keycloak",function(A){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),e.clearToken(),_.setSuccess()}),window.cordova.plugins.browsertab.openUrl(P),_.promise},register:function(w){var _=Y(),P=e.createRegisterUrl(w);return universalLinks.subscribe("keycloak",function(A){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var N=ee(A.url);I(N,_)}),window.cordova.plugins.browsertab.openUrl(P),_.promise},accountManagement:function(){var w=e.createAccountUrl();if(typeof w<"u")window.cordova.plugins.browsertab.openUrl(w);else throw"Not supported by the OIDC server"},redirectUri:function(w){return w&&w.redirectUri?w.redirectUri:e.redirectUri?e.redirectUri:"http://localhost"}};throw"invalid adapter type: "+u}var He=function(){if(!(this instanceof He))return new He;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var u=this;function p(){for(var b=new Date().getTime(),S=0;S<localStorage.length;S++){var y=localStorage.key(S);if(y&&y.indexOf("kc-callback-")==0){var E=localStorage.getItem(y);if(E)try{var w=JSON.parse(E).expires;(!w||w<b)&&localStorage.removeItem(y)}catch{localStorage.removeItem(y)}}}}u.get=function(b){if(b){var S="kc-callback-"+b,y=localStorage.getItem(S);return y&&(localStorage.removeItem(S),y=JSON.parse(y)),p(),y}},u.add=function(b){p();var S="kc-callback-"+b.state;b.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(S,JSON.stringify(b))}},je=function(){if(!(this instanceof je))return new je;var u=this;u.get=function(y){if(y){var E=b("kc-callback-"+y);if(S("kc-callback-"+y,"",p(-100)),E)return JSON.parse(E)}},u.add=function(y){S("kc-callback-"+y.state,JSON.stringify(y),p(60))},u.removeItem=function(y){S(y,"",p(-100))};var p=function(y){var E=new Date;return E.setTime(E.getTime()+y*60*1e3),E},b=function(y){for(var E=y+"=",w=document.cookie.split(";"),_=0;_<w.length;_++){for(var P=w[_];P.charAt(0)==" ";)P=P.substring(1);if(P.indexOf(E)==0)return P.substring(E.length,P.length)}return""},S=function(y,E,w){var _=y+"="+E+"; expires="+w.toUTCString()+"; ";document.cookie=_}};function mt(){try{return new He}catch{}return new je}function xe(u){return function(){e.enableLogging&&u.apply(console,Array.prototype.slice.call(arguments))}}}function Wd(t){const e=String.fromCodePoint(...t);return btoa(e)}class Gd{constructor(e){Re(this,"oidc");Re(this,"isAuthenticated",!1);Re(this,"authenticatedWith",null);this.oidc=new _i(e)}async InitAsync(e={}){return await this.oidc.init(e).then(async n=>(this.isAuthenticated=n,this.authenticatedWith=this.AuthenticatedWith(),n)).catch(n=>(console.info("Ocorreu um erro na inicialização. Verifique o console para mais detalhes."),console.error(n),!1))}LoginGovBr(){this.oidc.login({idpHint:"GOV.BR"})}LoginSenhaweb(){var n;const e=(n=this.oidc.authServerUrl)!=null&&n.startsWith("https://keycloak.dev.apps.sf.prefeitura.sp.gov.br")?"senhawebdev":"senhaweb";this.oidc.login({idpHint:e})}AuthenticatedWith(){var n,o;const e=this.oidc.tokenParsed;return e?(n=e.identity_provider)!=null&&n.startsWith("GOV.BR")?"govbr":(o=e.identity_provider)!=null&&o.startsWith("senhaweb")?"senhaweb":"ad":null}}let ki;function qd(t){ki=new Gd(t)}const Yd=()=>ki;class Xd{constructor(e=null){Re(this,"errors",[]);Re(this,"_value",null);Re(this,"_httpStatusCode");this._value=e,this._httpStatusCode=200}get value(){return this._value}set value(e){this._value=e}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}get httpStatusCode(){return this._httpStatusCode}set httpStatusCode(e){this._httpStatusCode=e}WithError(e){this.errors.push(e),this._httpStatusCode===200&&(this._httpStatusCode=400)}WithErrors(e){e.forEach(n=>this.WithError(n))}}class An{static get IsTouch(){return window.matchMedia("(pointer: coarse)").matches}static GetMaxZindex(e=[]){let n="body > *:not(script):not(style)";for(const r of e)n+=`, ${r}`;const o=Math.max(...Array.from(document.querySelectorAll(n)).map(r=>{const i=getComputedStyle(r).zIndex;return+i==+i?+i:0}));return o>=100?o:100}static AjustarFuso(e){const n=e.getTimezoneOffset()/60;e.setHours(e.getHours()-n)}static Mask(e,n){let o=0,r=e.toString();return n.replace(/#/g,()=>r[o++]||"")}static MaskCpf(e){return An.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return An.Mask(e.padStart(14,"0"),"##.###.###/####-##")}static async DelayAsync(e){return new Promise(n=>setTimeout(n,e))}}function Zd(){document.documentElement.classList.add("app-mounted")}function Si(){st.SetInitialTheme()}function Jd(){st.Toggle()}function Qd(){st.EnableDarkMode()}function ef(){st.EnableLightMode()}function tf(){st.ClearStoredTheme()}Si(),U.AppResult=Xd,U.ClearStoredTheme=tf,U.ConfigAuth=qd,U.EnableDarkMode=Qd,U.EnableLightMode=ef,U.RemovePreloader=Zd,U.SetInitialTheme=Si,U.SfButton=ys,U.SfContent=us,U.SfDrawer=ks,U.SfIcon=ln,U.SfLayout=ns,U.SfMessage=Cs,U.SfNavMenu=vl,U.SfTabNavigation=ps,U.SfTooltip=Nn,U.ToggleTheme=Jd,U.UseAlertService=xd,U.UseAuth=Yd,U.UseConfirmService=Ld,U.UseNavMenuService=Bn,U.Utilities=An,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});
411
411
  //# sourceMappingURL=sf.prefeiturasp.vuecomponents.umd.cjs.map